NVIDIA驱动程序发布Ubuntu 16.04


8

我正在尝试安装最新的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

Answers:


5

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或更高版本不兼容。


谢谢你的工作!我不得不使用sudo update-alternatives --config gcc从4.8切换到4.9,因为我以前在某些编程项目中都使用了这两个gcc版本,却忘记了切回。
t2k32316 '16
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.