NVIDIA 引领人工智能计算 - NVIDIA
https://www.nvidia.cn/
GEFORCE 驱动程序
https://www.geforce.cn/drivers
卸载安装过的驱动,执行命令:
sudo /usr/bin/nvidia-uninstall
sudo apt-get remove --purge nvidia*
strong@foreverstrong:~$ sudo service lightdm stop
[sudo] password for strong:
strong@foreverstrong:~$
strong@foreverstrong:~$ sudo /usr/bin/nvidia-uninstall
strong@foreverstrong:~$
If you plan to no longer use the NVIDIA driver, you should make sure that no X screens are configured to use the NVIDIA X driver in your X configuration file. If you used nvidia-xconfig to configure X, it may have created a backup of your original configuration. Would you like to run nvidia-xconfig --restore-original-backup
to attempt restoration of the original X configuration file? -> No
Uninstallation of existing driver: NVIDIA Accelerated Graphics Driver for Linux-x86_64 (430.14) is complete. -> OK
查看电脑支持的驱动版本:
sudo apt-cache search nvidia*
查看 Ubuntu 推荐的驱动版本:
ubuntu-drivers devices
strong@foreverstrong:~$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
vendor : NVIDIA Corporation
modalias : pci:v000010DEd00001B80sv00007377sd00001110bc03sc00i00
driver : nvidia-384 - distro non-free
driver : nvidia-415 - third-party free
driver : nvidia-410 - third-party free
driver : nvidia-430 - third-party free recommended
driver : nvidia-396 - third-party free
driver : xserver-xorg-video-nouveau - distro free builtin
driver : nvidia-390 - third-party free
driver : nvidia-418 - third-party free
strong@foreverstrong:~$
BIOS 中务必关闭 Secure Boot。不然会出现 Unable to load the ‘nvidia-drm’ kernel module. 的报错。
NVIDIA-Linux-x86_64-430.14.run
To determine which distribution and release number you’re running, type the following at the command line:
$ uname -m && cat /etc/*release
deepnorth@deepnorth-amax:~$ uname -m && cat /etc/*release
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
deepnorth@deepnorth-amax:~$
To verify the version of gcc installed on your system, type the following on the command line:
$ gcc --version
deepnorth@deepnorth-amax:~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
deepnorth@deepnorth-amax:~$
The version of the kernel your system is running can be found by running the following command:
$ uname -r
deepnorth@deepnorth-amax:~$ uname -r
4.15.0-54-generic
deepnorth@deepnorth-amax:~$
Ubuntu:
The kernel headers and development packages for the currently running kernel can be installed with:
$ sudo apt-get install linux-headers-$(uname -r)
deepnorth@deepnorth-amax:~$ uname -r
4.15.0-54-generic
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ sudo apt-get install linux-headers-$(uname -r)
[sudo] password for deepnorth:
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-4.15.0-54-generic is already the newest version (4.15.0-54.58~16.04.1).
linux-headers-4.15.0-54-generic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ sudo service lightdm stop
deepnorth@deepnorth-amax:~$
图形界面将会被关闭。可以使用 CTRL + ALT + F7 检查一下。
如果后续需要关闭图形界面,执行如下命令:
sudo /etc/init.d/lightdm stop
sudo service lightdm stop
如果后续需要开启图形界面,执行如下命令:
sudo service lightdm start
sudo /etc/init.d/lightdm start
To install the Display Driver, the Nouveau drivers must first be disabled. Each distribution of Linux has a different method for disabling Nouveau.
The Nouveau drivers are loaded if the following command prints anything:
$ lsmod | grep nouveau
deepnorth@deepnorth-amax:~$ lsmod | grep nouveau
nouveau 1724416 0
mxm_wmi 16384 1 nouveau
video 45056 1 nouveau
ttm 106496 2 ast,nouveau
drm_kms_helper 172032 2 ast,nouveau
i2c_algo_bit 16384 3 igb,ast,nouveau
drm 401408 5 drm_kms_helper,ast,ttm,nouveau
wmi 24576 2 mxm_wmi,nouveau
deepnorth@deepnorth-amax:~$
Ubuntu:
/etc/modprobe.d/blacklist-nouveau.conf
with the following contents:blacklist nouveau
options nouveau modeset=0
$ sudo update-initramfs -u
i -> INSERT
blacklist nouveau
options nouveau modeset=0
ESC -> 退出编辑模式
:wq -> 保存
deepnorth@deepnorth-amax:~$ sudo vim /etc/modprobe.d/blacklist-nouveau.conf
deepnorth@deepnorth-amax:~$ cat /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
deepnorth@deepnorth-amax:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-4.15.0-54-generic
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ reboot
Failed to set wall message, ignoring: Interactive authentication required.
Failed to reboot system via logind: Interactive authentication required.
Failed to start reboot.target: Interactive authentication required.
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon.
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ sudo reboot
lsmod | grep nouveau
如果没有输出内容,则禁用成功。
deepnorth@deepnorth-amax:~$ lsmod | grep nouveau
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ sudo service lightdm stop
deepnorth@deepnorth-amax:~$
图形界面将会被关闭。可以使用 CTRL + ALT + F7 检查一下。
deepnorth@deepnorth-amax:~$ cd software/
deepnorth@deepnorth-amax:~/software$ ll
total 120776
drwxrwxr-x 2 deepnorth deepnorth 4096 7月 9 21:06 ./
drwxr-xr-x 19 deepnorth deepnorth 4096 7月 9 21:54 ../
-rw-rw-r-- 1 deepnorth deepnorth 110886277 7月 9 21:04 NVIDIA-Linux-x86_64-43 0.14.run
-rwxrwxrwx 1 deepnorth deepnorth 12771800 7月 9 09:20 teamviewer_13.2.75536_ amd64.deb*
deepnorth@deepnorth-amax:~/software$
deepnorth@deepnorth-amax:~/software$ chmod a+x NVIDIA-Linux-x86_64-430.14.run
deepnorth@deepnorth-amax:~/software$
deepnorth@deepnorth-amax:~/software$ ll
total 120776
drwxrwxr-x 2 deepnorth deepnorth 4096 7月 9 21:06 ./
drwxr-xr-x 19 deepnorth deepnorth 4096 7月 9 21:54 ../
-rwxrwxr-x 1 deepnorth deepnorth 110886277 7月 9 21:04 NVIDIA-Linux-x86_64-430.14.run*
-rwxrwxrwx 1 deepnorth deepnorth 12771800 7月 9 09:20 teamviewer_13.2.75536_amd64.deb*
deepnorth@deepnorth-amax:~/software$
deepnorth@deepnorth-amax:~/software$ sudo sh ./NVIDIA-Linux-x86_64-430.14.run -no-opengl-files
-no-opengl-files 只安装驱动文件,不安装OpenGL文件。务必添加这个参数。
-no-x-check 安装驱动时不检查 x 服务,安装驱动时关闭 x 服务。
-no-nouveau-check 安装驱动时不检查 nouveau,安装驱动时禁用 nouveau。
The distribution-provided pre-install script failed! Are you sure you want to continue? -> Continue installation
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later? -> Yes
Dynamic Kernel Module Support,DKMS:动态内核模块支持
WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries. Your system may not be set up for 32-bit compatibility. 32-bit compatibility files will not be installed; if you wish to install them, re-run the installation and set a valid directory with the --compat32-libdir option. -> OK
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up. -> Yes
Your X configuration file has been successfully updated. Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 430.14) is now complete. -> OK
deepnorth@deepnorth-amax:~/software$ sudo sh ./NVIDIA-Linux-x86_64-430.14.run -no-opengl-files
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 430.14..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
deepnorth@deepnorth-amax:~/software$ (version: 430.14) is now complete.
deepnorth@deepnorth-amax:~/software$ nvidia-smi
Tue Jul 9 22:24:29 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.14 Driver Version: 430.14 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:1B:00.0 Off | N/A |
| 32% 48C P0 66W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... Off | 00000000:1C:00.0 Off | N/A |
| 34% 49C P0 60W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 2 GeForce RTX 208... Off | 00000000:1D:00.0 Off | N/A |
| 34% 49C P0 63W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 3 GeForce RTX 208... Off | 00000000:1E:00.0 Off | N/A |
| 33% 49C P0 54W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 4 GeForce RTX 208... Off | 00000000:89:00.0 Off | N/A |
| 32% 48C P0 78W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 5 GeForce RTX 208... Off | 00000000:8A:00.0 Off | N/A |
| 34% 49C P0 65W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 6 GeForce RTX 208... Off | 00000000:8B:00.0 Off | N/A |
| 33% 49C P0 52W / 250W | 0MiB / 11019MiB | 1% Default |
+-------------------------------+----------------------+----------------------+
| 7 GeForce RTX 208... Off | 00000000:8C:00.0 Off | N/A |
| 33% 50C P0 55W / 250W | 0MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
deepnorth@deepnorth-amax:~/software$
查看显卡驱动版本:
cat /proc/driver/nvidia/version
yongqiang@famu-sys:~$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 390.48 Thu Mar 22 00:42:57 PDT 2018
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
yongqiang@famu-sys:~$
deepnorth@deepnorth-amax:~/software$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 430.14 Wed May 8 01:10:53 UTC 2019
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
deepnorth@deepnorth-amax:~/software$