几天前我尝试将我的 Nvidia 驱动程序从 384 更新到 390。更新后驱动程序不起作用。
内核日志向我显示了此错误:
nvidia: version magic '4.4.0-119-generic SMP mod_unload modversions ' should be '4.4.0-119-generic SMP mod_unload modversions retpoline '
Xorg 日志显示了以下内容:
[ 407.015] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 407.015] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[ 407.015] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[ 407.015] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[ 407.015] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 407.023] (WW) "glamoregl" will not be loaded unless you've specified it to be loaded elsewhere.
modprobe nvidia
没有找到所需模块:
modprobe: ERROR: could not insert 'nvidia': No such device
但系统发现了卡:
lspci | grep NVIDIA
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
核心4.4.0-119-通用 系统:Ubuntu 16.04
如何解决这个问题?
答案1
经过一天的时间,我找到了这个问题的解决方案。主要问题出在 gcc 编译器上,它是从测试存储库安装的(我需要它来处理 golang),但它会破坏内核。
所以我做了什么来解决这个问题:
使用登录屏幕上的Ctrl- Alt-登录到 tty1 。F1
使用以下方式停止 lightdm 服务
sudo service lightdm stop
使用“sudo apt purge nvidia-* cuda-*”清除所有 nvidia 和 cuda 包
安装 purge ppa 工具:
sudo apt-get install ppa-purge
删除测试 ppa:
sudo ppa-purge ppa:ubuntu-toolchain-r/test
检查gcc版本,现在应该是5.4.0。
gcc --version
删除旧内核:
sudo apt-get purge linux-headers-4.4.0-119 linux-headers-4.4.0-119-generic linux-image-4.4.0-119-generic linux-image-extra-4.4.0-119-generic linux-signed-image-4.4.0-119-generic
重新安装内核:
sudo apt-get install linux-generic linux-signed-generic
重启
sudo reboot
(重启后你可能会看到黑屏,没关系)重复1-2
安装 nvidia 驱动程序
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt install nvidia-390 nvidia-390-dev
重新安装 ubuntu-desktop
sudo apt install --reinstall ubuntu-desktop
重启
利润!