基于ubuntu系统,经常遇到的显卡驱动问题进行汇总。
方法都验证过,希望可以帮到大家。
原因分析:
1.系统内核自动/人工升级
2.非正常关机
1. 问题一:NVIDIA-SMI couldn’t find libnvidia-ml.so library in your system…
root@keds-SYS-7048GR-TR:/opt# nvidia-smi
NVIDIA-SMI couldn’t find libnvidia-ml.so library in your system. Please make sure that the
NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.#应该是显卡驱动安装不完善,例如安装驱动过程中以外中断。
#卸载对应版本驱动
./NVIDIA-Linux-x86_64-440.44.run --uninstall
#重新安装
Chmod 777 NVIDIA-Linux-x86_64-440.44.run ./NVIDIA-Linux-x86_64-440.44.run -no-x-check -no-nouveau-check -no-opengl-files
2. 问题二:NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
2.1. 方法一:
#如果有之前安装版本的驱动文件,可以先尝试重新安装下驱动
Chmod 777 NVIDIA-Linux-x86_64-440.44.run
./NVIDIA-Linux-x86_64-440.44.run -no-x-check -no-nouveau-check -no-opengl-files#如果安装过程报错,重新执行nvidia-smi 还是报错可以尝试方法二。
2.1. 方法二:dkms:
2.2.1. Dkms 安装成功
#首先更新安装
dkms root@keds-SYS-7048GR-TR:/opt# apt-get install dkms
#查看驱动以及内核信息
root@keds-SYS-7048GR-TR:/# ls /usr/src/
linux-headers-5.0.0-23 linux-headers-5.4.0-193
nvidia-535.183.01 linux-headers-5.0.0-23-generic
linux-headers-5.4.0-193-generic
说明我们安装的驱动版本是 535.183.01
#按照驱动版本进行安装
root@keds-SYS-7048GR-TR:/# dkms install -m nvidia -v 535.183.01Kernel preparation unnecessary for this kernel. Skipping… applying
patc