我以前使用从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-352
Nvidia存储库中的软件包的情况下,它才可以工作。但是,现在我似乎没有选择的余地,因为运行时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