我正在尝试安装最新的 Nvidia 驱动程序。安装后nvidia-smi
找不到它。
显卡是 GeForce 860m,我的笔记本电脑运行的是 Ubuntu 16.04.1 LTS。
我目前所做的:
$ sudo apt-get purge nvidia-*
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo apt-get install nvidia-367
$ reboot
$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
我怎样才能让它工作?
编辑:我意识到$ sudo apt-get install nvidia-367
返回了错误:
Error! Bad return status for module build kernel: 4.4.0-36-generic (x86_64)
Consult /var/lib/dkms/nvidia-367/367.44/build/make.log for more information.
尽管司机实际上正在行驶。
make.log
包含如下行:
Makefile:676: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
和这个:
cc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/Makefile.build:258: recipe for target '/var/lib/dkms/nvidia-367/367.44/build/nvidia/nv-instance.o' failed
make[2]: *** [/var/lib/dkms/nvidia-367/367.44/build/nvidia/nv-instance.o] Error 1
Makefile:1403: recipe for target '_module_/var/lib/dkms/nvidia-367/367.44/build' failed
make[1]: *** [_module_/var/lib/dkms/nvidia-367/367.44/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-36-generic'
Makefile:81: recipe for target 'modules' failed
make: *** [modules] Error 2
答案1
gcc-4.8
不支持-fstack-protector-strong
我安装了gcc-4.9
该驱动程序,然后清除并重新安装,现在它运行正常。
$ nvidia-smi
Tue Sep 13 17:31:24 2016
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.44 Driver Version: 367.44 |
|-------------------------------+----------------------+----------------------+
| 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 GTX 860M Off | 0000:01:00.0 Off | N/A |
| N/A 54C P0 N/A / N/A | 0MiB / 4043MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
具有讽刺意味的是,我之所以使用,是gcc-4.8
因为IIRC,以前版本的 CUDA 与 4.9 或更高版本不兼容。