![Nvidia 驱动程序 460 无法与 Ubuntu 18.04 中的 5.4.0-64 内核配合使用](https://linux22.com/image/1070006/Nvidia%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%20460%20%E6%97%A0%E6%B3%95%E4%B8%8E%20Ubuntu%2018.04%20%E4%B8%AD%E7%9A%84%205.4.0-64%20%E5%86%85%E6%A0%B8%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8.png)
尝试安装cuda-10-2
包含 460 nivida 驱动程序时,出现以下错误。
INFO:Enable nvidia DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/dell_latitude DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here Loading
new nvidia-460.32.03 DKMS files... Building for 5.4.0-64-generic
Building for architecture x86_64 Building initial module for
5.4.0-64-generic Error! Bad return status for module build on kernel: 5.4.0-64-generic (x86_64) Consult /var/lib/dkms/nvidia/460.32.03/build/make.log for more information.
Setting up nvidia-driver-460 (460.32.03-0ubuntu1) ...
看起来驱动程序和内核不兼容。
答案1
我可以通过这样做解决我的问题 - 删除所有 nvidia 驱动程序,使用以下命令序列安装 gcc-8:
sudo apt-get autoremove --purge nvidia-*
sudo apt-get autoremove --purge nvidia-driver-*
sudo apt install gcc-8
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-8 10
sudo apt-get install --reinstall linux-headers-$(uname -r)
sudo apt-get install nvidia-driver-460
reboot