4 篇文章带有标签 “driver”

Ubuntu 上将 NVIDIA GPU 切换为 Intel 集成显卡 IGD

IGD(Integrated Graphics Device)

操作系统:Ubuntu 18.04,主机有一张 NVIDIA 的独立显卡 GP106 [GeForce GTX 1060 6GB],还有 Intel 酷睿处理器 i5 8500 自带的集成显卡(Intel UHD Graphics 630)。为了更充分的使用独立显卡用于深度学习计算,需要把集成显卡用于显示。在这个过程中遇到了各种各样的问题:

  • 鼠标和键盘失灵。
  • 登录 X Window 时,输入正确的密码不能登录。

BIOS 设置

显卡设置

  • IGD 内置图形显示集成显卡
  • PEG 独立PCI Express接口图形显卡

选择 IGD,保存退出。

配置 X Window 显示显卡设备信息 lspci lspci -k | grep -EA3 'VGA|3D|Display' | | | | | - Only VGA is not good enough, | | | | | because Nvidia mobile adapters | | | | | are shown as 3D and some AMD | | | | | adapters are shown as Display. | | | | --------- Print 3 lines after the regexp match.

NVIDIA 软件栈搭建

NVIDIA 软件栈

GPU Driver

NVIDIA 驱动程序下载

Ubuntu

  1. 搜索有效的显卡驱动
sudo ubuntu-drivers devices
#搜索匹配
sudo apt search nvidia-
  1. 安装驱动
sudo apt install nvidia-driver-510
  1. 重启系统
sudo reboot
  1. 查看
nvidia-smi
  1. 卸载驱动
sudo apt purge nvidia*

CUDA Toolkit

CUDA Toolkit 自带驱动。

下载

这里下载 run 格式安装包。

CUDA Toolkit 下载

安装

$ sudo sh cuda_xx.x.x_xxx.xx.xx_linux.run

deviceQuery $ ./deviceQuery ./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "NVIDIA GeForce GTX 1060 6GB" CUDA Driver Version / Runtime Version 11.6 / 11.

在Linux上安装CUDA Toolkit

安装 CUDA Toolkit

下载

wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run

安装 $ sudo sh cuda_11.5.1_495.29.05_linux.run =========== = Summary = =========== Driver: Installed Toolkit: Installed in /usr/local/cuda-11.5/ Samples: Installed in /home/lnsoft/, but missing recommended libraries Please make sure that - PATH includes /usr/local/cuda-11.5/bin - LD_LIBRARY_PATH includes /usr/local/cuda-11.5/lib64, or, add /usr/local/cuda-11.5/lib64 to /etc/ld.so.

在Ubuntu上安装NVIDIA GPU驱动

在一台新安装的 Ubuntu20.04 系统上安装 NVIDIA GPU 驱动。

安装 gcc make 工具

$ sudo apt-get install gcc make

禁用系统默认驱动 nouveau

  1. 编辑配置文件
$ sudo nano /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
## 另一种方法
# cat << EOF >/etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
EOF
  1. 更新 initramfs
$ sudo update-initramfs -u
  1. 重启系统
$ sudo reboot
  1. 验证 nouveau 是否禁用成功(当什么也不显示出来时代表成功)
$ lsmod | grep nouveau

安装 NVIDIA 驱动 查看显卡型号 $ lspci | grep -i nvidia 0000:43:00.0 3D controller: NVIDIA Corporation TU104GL [Tesla T4] (rev a1) 0000:47:00.