在安装显卡之前请先把ubuntu 18.04系统提前安装好。
需要准备的资料:
驱动的下载地址,在此下载页面选择合适的显卡,目前最新的显卡驱动版本是430.26,切记选择.run文件。
由于目前ubuntu 18.04使用的内核版本是4.15.0,比较新的显卡还没有同步更新到位,所以我们需要手动更新一下支持的PCI ID。
- sudo update-pciids
-
- sudo cat /usr/share/misc/pci.ids | grep -i rtx
-
- 1043 8673 TURBO-RTX2070-8G
- 1043 8673 TURBO-RTX2070-8G
- 1043 8673 TURBO-RTX2070-8G
- 1e02 TU102 [TITAN RTX]
- 1e04 TU102 [GeForce RTX 2080 Ti]
- 1e07 TU102 [GeForce RTX 2080 Ti Rev. A]
- ...
-
有些发行版是在/usr/share/hwdata/pci.ids文件内。
- lspci | grep -i nvidia
-
- 42:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
- 42:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
- 42:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Controller (rev a1)
- 42:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 UCSI Controller (rev a1)
-
- sudo apt-get install gcc g++ make
-
因为安装过程需要这些工具,g++不一定需要,保险安装。
- sudo gedit /etc/modprobe.d/blacklist.conf
-
在文件末尾加入:
- blacklist nouveau
- options nouveau modeset=0
-
执行下面命令生效:
- sudo update-initramfs -u
-
此步骤完成后需要重启系统,切记。- sudo telinit 3
-
之后会进入一个新的命令行会话,使用当前的用户名密码登录- sudo chmod +x NVIDIA-Linux-x86_64-430.26.run # 添加执行权限
- sudo bash NVIDIA-Linux-x86_64-430.26.run –no-opengl-files –no-x-check
-
参数介绍:
打开终端执行:
- nvidia-smi
-
输出结果如下代表成功:
- Tue Jul 9 20:55:38 2019
- +-----------------------------------------------------------------------------+
- | NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 |
- |-------------------------------+----------------------+----------------------+
- | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
- | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
- |===============================+======================+======================|
- | 0 GeForce RTX 208... Off | 00000000:42:00.0 On | N/A |
- | 0% 44C P8 17W / 300W | 295MiB / 11011MiB | 0% Default |
- +-------------------------------+----------------------+----------------------+
-
- +-----------------------------------------------------------------------------+
- | Processes: GPU Memory |
- | GPU PID Type Process name Usage |
- |=============================================================================|
- | 0 1418 G /usr/lib/xorg/Xorg 18MiB |
- | 0 1449 G /usr/bin/gnome-shell 57MiB |
- | 0 1718 G /usr/lib/xorg/Xorg 100MiB |
- | 0 1832 G /usr/bin/gnome-shell 109MiB |
- | 0 3780 G gnome-control-center 6MiB |
- +-----------------------------------------------------------------------------+
-