admin管理员组

文章数量:1530517

几次安装都会出现一些问题,因此记录本次成功安装的过程。

安装前需要做:

  1. 打开blacklist.conf
sudo gedit /etc/modprobe.d/blacklist.conf
  1. 在blacklist.conf文件最后部分插入以下两行内容
blacklist nouveau
options nouveau modeset=0
  1. 更新系统
sudo update-initramfs -u
  1. 重启系统
sudo reboot
  1. 验证nouveau是否已禁用
lsmod | grep nouveau

没有任何信息显示,说明nouveau已被禁用,接下来可以安装nvidia的显卡驱动了。

安装NVIDIA显卡驱动

1. 查看显卡型号

在终端输入:

lspci | grep -i nvidia

显示如下图:
似乎看不出是什么型号?可采用这个链接查看:
PCI devices

2. NVIDIA官网下载驱动

官网下载链接:NVIDIA 驱动程序下载
根据自己电脑系统,显卡型号进行搜索下载。
将下载后的.run文件拷贝至home目录下。

3. 显卡驱动安装

在ubuntu下按ctrl+alt+f3(我的电脑是f3,有些电脑是f1、f2…)进入命令行界面,输入用户名和密码。(密码是不显示的)
接着在命令行依次输入以下命令:

sudo service lightdm stop
sudo apt-get remove nvidia-*
sudo chmod a+x NVIDIA-Linux-x86_64-525.60.11.run     # 给驱动文件赋予权限 (自己的文件名)
sudo sh ./NVIDIA-Linux-x86_64-525.60.11.run -no-x-check -no-nouveau-check -no-opengl-files

-no-x-check:安装驱动时关闭X服务
-no-nouveau-check:安装驱动时禁用nouveau
-no-opengl-files:只安装驱动文件,不安装OpenGL文件

安装过程中的选项:
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 继续

4. 挂载NVIDIA驱动

modprobe nvidia

5. 检查驱动是否安装成功

nvidia-smi

如果出现下面信息,则安装成功:

sudo reboot     # 重启

重启黑屏

若重启后发现黑屏,只有一个断线在一直闪。
这个时候重新进入到bios中,将secure boot设为disable, boot选择descrete graphic.
完美解决!
|
|
[1]: https://blog.csdn/weixin_42546496/article/details/88640174?spm=1001.2014.3001.5502
[2]: https://blog.csdn/Perfect886/article/details/119109380?spm=1001.2014.3001.5502

本文标签: 重启显卡驱动黑屏NVIDIA