apt-get升级后Nvidia图形驱动程序和CUDA的问题


9

我以前使用从Nvidia安装的“ deb(网络)”在Ubuntu 14.04上安装了CUDA 7.5。它已经工作了几个月,直到我sudo apt-get upgrade今天运行。完成此操作后,我遇到了以下问题

$ nvidia-smi
modprobe: ERROR: ../libkmod/libkmod-module.c:809 kmod_module_insert_module() could not find module by name='nvidia_352'
modprobe: ERROR: could not insert 'nvidia_352': Function not implemented
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 nvidia-smi没有什么不同。我无法以GUI模式登录(输入密码后,它会返回到登录屏幕),但是我可以访问终端。

我已经能够恢复图形功能,但是在此之后我很难重新安装CUDA。你能帮我么?

恢复图形

我发现我可以通过执行以下操作使图形重新工作

$ sudo apt-get remove --purge nvidia*
$ sudo apt-get autoremove

然后编辑/etc/apt/sources.list.d/cuda.list以删除所有行,然后执行

$ sudo apt-get install nvidia-352

并重新启动系统。在此之后,nvidia-smi正在重新工作。但是,我仍然需要重新安装CUDA。

尝试重新安装CUDA

我尝试还原的内容,/etc/apt/sources.list.d/cuda.list然后再做sudo apt-get install cuda。我注意到此错误消息:

Loading new nvidia-352-352.93 DKMS files...
Building only for 3.13.0-68-generic
Building for architecture x86_64
Building initial module for 3.13.0-68-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-352.0.crash'
Error! Bad return status for module build on kernel: 3.13.0-68-generic (x86_64)

完成此操作后,系统将在开始时恢复其行为。例如,nvidia-smi打印上面的错误消息,在构建和运行后,deviceQuery我得到一个类似的错误:

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

modprobe: ERROR: ../libkmod/libkmod-module.c:809 kmod_module_insert_module() could not find module by name='nvidia_352'
modprobe: ERROR: could not insert 'nvidia_352': Function not implemented
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL

我似乎记得,当我第一次安装CUDA时,只有在不更新nvidia-352Nvidia存储库中的软件包的情况下,它才可以工作。但是,现在我似乎没有选择的余地,因为运行时sudo apt-get install cuda它会自动升级nvidia-352软件包:

Unpacking nvidia-352 (352.93-0ubuntu1) over (352.63-0ubuntu0.14.04.1) ...

如果尝试显式设置版本,则会得到

$ sudo apt-get install cuda-drivers nvidia-352=352.63-0ubuntu0.14.04.1 nvidia-352-dev=352.63-0ubuntu0.14.04.1
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 cuda-drivers : Depends: nvidia-352 (>= 352.93) but 352.63-0ubuntu0.14.04.1 is to be installed
                Depends: nvidia-352-dev (>= 352.93) but 352.63-0ubuntu0.14.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

实际上,如果我尝试使用version 352.63-0ubuntu1而不是352.63-0ubuntu0.14.04.1这样做

$ sudo apt-get install nvidia-352=352.63-0ubuntu1

那么这足以破坏图形登录并导致nvidia-smi在上面显示错误消息。

诊断程序

$ lspci | grep -i vga
01:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX TITAN X] (rev a1)

$ dpkg -l | grep -i nvidia
ii  bbswitch-dkms                                         0.7-2ubuntu1                                        amd64        Interface for toggling the power on nVidia Optimus video cards
ii  libcuda1-352                                          352.93-0ubuntu1                                     amd64        NVIDIA CUDA runtime library
ii  nvidia-352                                            352.93-0ubuntu1                                     amd64        NVIDIA binary driver - version 352.93
ii  nvidia-352-dev                                        352.93-0ubuntu1                                     amd64        NVIDIA binary Xorg driver development files
ii  nvidia-352-uvm                                        352.93-0ubuntu1                                     amd64        Transitional package for nvidia-352
ii  nvidia-modprobe                                       352.93-0ubuntu1                                     amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-opencl-icd-352                                 352.93-0ubuntu1                                     amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                                          0.6.2                                               amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                                       352.93-0ubuntu1                                     amd64        Tool for configuring the NVIDIA graphics driver

Answers:


6

我有一个类似的问题。通过安装推荐版本的nvidia驱动程序可以解决此问题。

sudo apt-get install ubuntu-drivers-common

sudo ubuntu-drivers devices

sudo apt-get install <recommended version>

3
在上面的命令之后,我必须发出命令“ sudo modprobe nvidia”,然后一切正常
MARK

@MARK我通过modprobe遇到错误:错误:无法插入'nvidia_396':所需的密钥不可用。有小费吗?
Aerin

4

一个朋友能够为我解决!

他向我展示的解决方案是(像以前一样删除所有nvidia软件包之后)

$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get install nvidia-364

然后从Nvidia下载.run CUDA安装程序(对我来说是cuda_7.5.18_linux.run),当询问是否要安装CUDA附带的驱动程序时,请小心选择“否”。

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.