ubuntu重装英伟达显卡驱动

发布时间 2023-11-28 15:00:05作者: 随遇而安jason

最近因为种种原因需要修改ubuntu 显卡驱动,但是按照网上种种教程操作后都是出现,经过多次尝试后发现是 内核问题,于是安装相关内容包解决

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

  1. 在官网下载英伟达驱动

https://www.nvidia.com/Download/index.aspx?lang=en-us

NVIDIA-Linux-x86_64-525.147.05.run

然后利用*.RUN 进行安装提示

sudo ./NVIDIA-Linux-x86_64-525.147.05.run -no-x-check -no-nouveau-check -no-opengl-files, 发现报错,

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 system, 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.

2、于是使用命令查看机器 kernel

uname -r

>>5.15.0-051500-generic

3、于是从 Ubuntu 官方内核库中下载 kernel 5.15

wget https://kernel.ubuntu.com/mainline/v5.15/amd64/linux-headers-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb

wget https://kernel.ubuntu.com/mainline/v5.15/amd64/linux-headers-5.15.0-051500_5.15.0-051500.202110312130_all.deb

wget https://kernel.ubuntu.com/mainline/v5.15/amd64/linux-image-unsigned-5.15.0-051500-generic_5.15.0-051500.202110312130_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb

4、下载完成后安装

sudo dpkg -i *.deb

5、并使用如下命令更新 Grub 引导加载程序:

sudo update-grub

6、如果使用 BURG 引导加载程序,请运行:

sudo update-burg

7、重启系统