参考:
https://blog.csdn.net/tanmx219/article/details/107591416
https://www.icode9.com/content-3-620640.html
下载NVIDIA驱动网址
https://www.nvidia.com/Download/Find.aspx?lang=en-us
1.如何卸载Nouveau
这是因为,在安装前,Nouveau可能已经启动,所以无法安装Nvidia成功。
#---open a terminal---
sudo apt-get remove nvidia*
sudo apt autoremove
sudo apt-get install dkms build-essential linux-headers-generic
sudo vim /etc/modprobe.d/blacklist.conf
#---save the following info into file blacklist.conf---
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
#---end of the info saved----
#---go back to the terminal---
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
reboot
附2:安装过程中碰到的问题
也会用这样的显示步骤,看清楚了
The distribution-provided pre-install script failed! Are you sure you want to continue? 选择 yes 继续。
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later? 选择 No 继续。
问题没记住,选项是:install without signing
问题大概是:Nvidia's 32-bit compatibility libraries? 选择 No 继续。
Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up. 选择 Yes 继续
这些选项如果选择错误可能会导致安装失败,没关系,只要前面不出错,多尝试几次就好。
The distribution-provided pre-install script failed! Are you sure you want
to continue?
Continue installation Abort installation
----> Continue installation
Would you like to register the kernel module sources with DKMS? This will
allow DKMS to automatically build a new module, if you install a different
kernel later.
Yes No
---->No
The CC version check failed:
The kernel was built with gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1),
but the current compiler version is cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.
This may lead to subtle problems; if you are not certain whether the
mismatched compiler will be compatible with your kernel, you may wish to
abort installation, set the CC environment variable to the name of the
compiler used to compile your kernel, and restart installation.
Ignore CC version check Abort installation
----> select ignore
WARNING: Ignoring CC version mismatch:
The kernel was built with gcc version 7.4.0 (Ubuntu
7.4.0-1ubuntu1~18.04.1), but the current compiler version is cc
(Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.
OK
----> OK
Install NVIDIA's 32-bit compatibility libraries?
Yes No
----> No
An incomplete installation of libglvnd was found. All of the essential
libglvnd libraries are present, but one or more optional components are
missing. Do you want to install a full copy of libglvnd? This will overwrite
any existing libglvnd libraries.
Don't install Install and overw Abort installation.
---->Install and overw
Would you like to run the nvidia-xconfig utility to automatically update
your X configuration file so that the NVIDIA X driver will be used when you
restart X? Any pre-existing X configuration file will be backed up.
Yes No
---->Yes
Your X configuration file has been successfully updated. Installation of
the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 440.100)
is now complete.
OK
----> OK
3.驱动安装后的检查
nvidia-smi
Screenshot from 2022-09-08 10-39-40.png
网友评论