首先你得先查到你的电脑显卡型号对应驱动版本,NVIDIA官网 ,我的电脑是 940mx, 对应版本号是418

nvidia-install.png
nvidia-info.png


对于Ubuntu 18.04,Linux Mint 19,Ubuntu 18.10,Ubuntu 19.04,您可以执行以下步骤来添加PPA并安装最新的NVIDIA 418驱动程序。

1.通过Ctrl + Alt + T键盘快捷键或从应用程序菜单中搜索“终端”来打开终端。打开时,运行命令:

sudo add-apt-repository ppa:graphics-drivers/ppa

2.对于Linux Mint 19,您可能需要运行命令来刷新系统包缓存:

sudo apt update

3.启动Software&Updates实用程序,然后导航到Additional Drivers

选项卡。

然后从列表中选择“使用nvidia-driver-418的NVIDIA驱动程序元数据包”,然后单击“ 应用更改”

软件和更新安装nvidia.png

此外,如果在单击“应用更改”后未安装驱动程序,请尝试在终端中运行命令:

sudo apt install nvidia-driver-418 nvidia-settings

对于未满足的依赖性问题,请先尝试删除旧的NVIDIA专有驱动程序。




或者使用apt安装

sudo apt-get update

apt search nvidia-driver-418

使用apt search搜索驱动程序

apt-search-nvidia-driver-418.png

安装驱动:

sudo apt-get install nvidia-driver-418

apt-get-install-nvidia-driver.png



或者使用安装包安装

首先在NVIDIA官网下载好驱动文件

https://www.nvidia.com/


nvidia-file.png

打开终端,进入改文件目录

执行安装命令:

chmod +x NVIDIA-Linux-x86_64-418.56.run 
sudo ./NVIDIA-Linux-x86_64-418.56.run 

console-install-code.png

console-install-nvidia.png

报错了

 ERROR: The Nouveau kernel driver is currently in use by your system.  This driver is incompatible with the NVIDIA driver, and must be disabled before        

         proceeding.  Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau  

         kernel driver.

One or more modprobe configuration files to disable Nouveau have been written.  For some distributions, this may be sufficient to disable Nouveau; other     

  distributions may require modification of the initial ramdisk.  Please reboot your system and attempt NVIDIA driver installation again.  Note if you later   

  wish to reenable Nouveau, you will need to delete these files: /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

                                                                             

install-nvidia-error.png


到达下面的情况时,选择yes

nvidia-accelerated.pngnvidia=accelerated-graphics-driver.png


重启一下

not-cc.png


依然报错,这次是没有安装gcc (不要切换源,不然总是报错, E:无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系)

 sudo apt-get install gcc

再试一下,还有问题,安装'make'

 sudo apt-get install make

再次执行安装命令终于完成了

chmod +x NVIDIA-Linux-x86_64-418.56.run 
sudo ./NVIDIA-Linux-x86_64-418.56.run 


最后在终端验证是否安装成功

$ nvidia-smi #如果出现GPU列表,则驱动安装成功

ubuntu-nvidia.png


安装nvidia显卡驱动参考:

https://blog.csdn.net/tjuyanming/article/details/80862290

https://blog.csdn.net/qq_37935670/article/details/80377196

https://blog.csdn.net/new_delete_/article/details/81544438

0条评论 顺序楼层
请先登录再回复