Ubuntu18.04 + RTX 2080 Ti 安装NVIDIA显卡驱动的一些坑

记录一下踩到的坑。

一般情况下,驱动装好了,可以用下面的命令来查看显卡状况:

nvidia-smi

当成功弹出下面的内容的时候,说明驱动装成功了:
在这里插入图片描述
安装驱动的方法我这里就不写了,可以参考一下:
https://blog.csdn.net/weixin_40859436/article/details/83152249
http://www.52nlp.cn/从零开始搭建深度学习服务器环境配置ubuntu-1080ti-cuda-cudnn

如果遇到下面的问题,就说明没装好,或装的有问题:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running


遇到这个问题可以先重启一下试试,如果装的时候操作没什么问题的话,基本上重启一下就可以解决了。

当然,也有可能重启也解决不了,后来发现不知道为什么没装成功。如果是这种情况,推荐从官网上下载驱动安装:https://www.nvidia.cn/Download/index.aspx?lang=cn

选好需要的版本,可以下到一个NVIDIA-Linux-*.run文件,修改权限就可以跑了:

chmod +x NVIDIA-Linux-x86_64-410.93.run
./NVIDIA-Linux-x86_64-410.93.run


中间有一些选项,基本上有默认的选默认的,有些选项查一下什么意思看着选就好了。

然而,这种方法还是不一定能成功,不过用这个装有个好处,就是会给出错误日志,会提示查看错误日志,应该是这个文件:

cat /var/log/nvidia-installer.log


我遇到的问题是这个:

ERROR: Unable to find the kernel source tree for the currently running kernel.  Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed.  If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.


查了一下,在这里看到了方案:https://ubuntuforums.org/showthread.php?t=843914

sudo apt-get install linux-headers-`uname -r` 


然后重新运行安装程序,就装好了。

发布了443 篇原创文章 · 获赞 149 · 访问量 55万+

猜你喜欢

转载自blog.csdn.net/qian99/article/details/86706137