Ubuntu安装NVIDIA驱动


软硬件环境

  • 系统版本:Ubuntu Desktop 18.04 LST
  • 显卡型号:NVIDIA TITAN RTX
  • 驱动版本:440.44

NVIDIA驱动官方下载地址
Ubuntu安装CUDA+cuDNN


1 禁用nouveau

因为 NVIDIA的官方驱动和系统自带的nouveau驱动冲突,所以需要先禁用。

创建文件

sudo vim /etc/modprobe.d/blacklist-nouveau.conf

在文件内插入以下内容

blacklist nouveau
options nouveau modeset=0

执行以下命令使禁用生效并且重启

sudo update-initramfs -u
# 重启
sudo reboot

重启后验证是否生效, 执行命令,若没有输出,则禁用生效

lsmod | grep nouveau

2 安装驱动

下载好驱动,执行命令进行安装。

sudo sh NVIDIA-Linux-x86_64-440.44-titan_rtx.run

可能会遇到错误,具体解决方法请看本文后面的第3小节。 选择Continue installation继续安装,可以查看具体错误。


如果没有错误,进入下一步,会出现警告,意思是缺少32位相关的兼容库,不用管,回车进入下一步

 WARNING: Unable to find a suitable destination to install 32-bit
          compatibility libraries. Your system may not be set up for 32-bit
          compatibility. 32-bit compatibility files will not be installed; if 
          you wish to install them, re-run the installation and set a valid
          directory with the --compat32-libdir option.  


意思是发现现在的libglvnd不是完整的,问你要不要安装完整版的libglvnd,可以装也可以不装,我这里选择不装Don't install

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.


上一步没安装libglvnd,所以出现警告,忽略,回车进入下一步

 WARNING: Unable to determine the path to install the libglvnd EGL vendor     
          library config files. Check that you have pkg-config and the        
          libglvnd development libraries installed, or specify a path with    
          --glvnd-egl-config-path.


问你要不要用nvidia-xconfig工具自动更新NVIDIA X的配置文件,不知道有啥用,选No,下一步

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.   


OK,回车,安装完成


输入命令nvidia-smi,验证是否安装成功,如果安装成功,会出现显卡的相关信息


3 可能会遇到的错误


原因:NVIDIA的官方驱动和系统自带的nouveau驱动冲突
解决:参照第1小节,禁用nouveau


ERROR: Unable to find the development tool `cc` in your path; please make    
       sure that you have the package 'gcc' installed.  If gcc is installed  
       on your system, then please check that `cc` is in your PATH.


原因:缺少gcc
解决:安装 sudo apt-get install gcc


 ERROR: Unable to find the development tool `make` in your path; please make  
        sure that you have the package 'make' installed.  If make is          
        installed on your system, then please check that `make` is in your    
        PATH.


原因:缺少make
解决:安装 sudo apt-get install make


记录,分享,交流。

  • 27
    点赞
  • 138
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值