当前位置:   article > 正文

ubuntu显卡驱动安装以及问题汇总_ubuntu显卡驱动问题

ubuntu显卡驱动问题

Ubuntu20.04(Noetic版本)显卡驱动安装以及问题汇总

一、显卡驱动安装
1-1 删除之前的显卡驱动
sudo apt-get remove --purge nvidia-*  //卸载原来的驱动
  • 1
1-2 禁用Ubuntu自带的nouveau显示驱动
//打开黑名单文件
sudo gedit /etc/modprobe.d/blacklist.conf	
//在文本文件中,添加如下
blacklist nouveau
options nouveau modeset=0
//在终端进行更新
sudo update-initramfs –u 
    
//重启检测是否禁用成功
reboot
lsmod | grep nouveau//如果没有输出禁用成功
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
1-3 安装驱动前 需要更新软件列表并且安装必要的软件和依赖
sudo apt-get update   //更新软件列表
 
sudo apt-get install g++
 
sudo apt-get install gcc
 
sudo apt-get install make
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
1-4 查看显卡驱动型号并去官网下载对应版本驱动xxx.run文件
lspci | grep -i nvidia  //查看显卡的型号
  • 1
1-5 进行驱动安装(需要进入文本终端关闭nvidia相关服务)

常见错误:nvidia-drm正在运行(要关闭当前一些nvidia的服务)

ERROR: An NVIDIA kernel module ‘nvidia-drm’ appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module’s usage count, for which the simplest remedy is to reboot your computer.
  • 1

第一步:首先进入文本终端

ctrl+alt+F3	//我的是拯救者Y7000P使用这个进入,其他型号可以试试F1、F2...   退出:ctrl+alt+F1
  • 1

第二步:关闭nvidia的相关服务+安装驱动

sudo systemctl isolate multi-user.target //Isolate multi-user.target
    
lsmod | grep nvidia.drm	//Note that nvidia-drm is currently in use. 查看是否在运行
    
sudo modprobe -r nvidia-drm	//Unload nvidia-drm
    
lsmod | grep nvidia.drm	//Note that nvidia-drm is not in use anymore. 
    
sudo chmod a+x NVIDIA-Linux-x86_64-xxx.run  //赋予权限

sudo ./NVIDIA-Linux-x86_64-xxx.run -no-x-check -no-nouveau-check -no-opengl-files
//-no-x-check:安装驱动时关闭X服务	-no-nouveau-check:安装驱动时禁用nouveau	-no-opengl-files:只安装驱动文件,不安装OpenGL文件
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

第三步:安装的选项内容

he 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 继续
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 继续
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
问题汇总:
一、安装完成后,重启黑屏,并且有一个光标跳动
1、进入bios系统,将secure boot设置为disable boot
2、将独显直连打开
  • 1
  • 2
参考资料

《ubuntu16.04系统run方式安装nvidia显卡驱动》https://blog.csdn.net/xunan003/article/details/81665835

《ERROR: An NVIDIA kernel module ‘nvidia-drm‘ appears to already be loaded in your kernel.》https://blog.csdn.net/Jessica__Chan/article/details/118224245

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/72660
推荐阅读
相关标签
  

闽ICP备14008679号