记录Ubuntu 18.04 (.run)方式安装 Nvidia driver

环境 Ubuntu 18.04 CUDA Version: 11.1

  1. 从官网下载对应的 驱动版本
eg:  NVIDIA-Linux-x86_64-455.23.04.run 
  1. 卸载旧版本
sudo apt-get remove --purge nvidia*
sudo systemctl isolate multi-user.target
sudo modprobe -r nvidia-drm
  1. 开始安装
sudo -i 
chmod +x NVIDIA-Linux-x86_64-455.23.04.run
./NVIDIA-Linux-x86_64-455.23.04.run
  1. 安装过程出现的问题该如何选择
1. There appears to already be a driver installed on your system (version:      
  390.42).  As part of installing this driver (version: 390.42), the existing  
  driver will be uninstalled.  Are you sure you want to continue? 
  Continue installation      Abort installation 
(选择 Coninue,如果是重装的话)
2. The distribution-provided pre-install script failed!  Are you sure you want
  to continue?                                                                 
 Continue installation      Abort installation       
(选择 Cotinue)
3. 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)
4. Install NVIDIA's 32-bit compatibility libraries?
    Yes                       No  
(这里选 No)
5. Installation of the kernel module for the NVIDIA Accelerated Graphics Driver
  for Linux-x86_64 (version 390.42) is now complete.                           
  OK
6.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                       No  
(这里选 Yes)
注意事项:一定要安装完重启,利用命令:(此处我没有重启也成功了)
 sudo reboot  

5) 挂载驱动

modprobe nvidia

检查结果

nvidia-smi

6) 遇到的坑
很多网页说需要禁用nouveau 驱动再重启以解决和NVIDIA官方自带的驱动冲突的问题,一般情况下不存在这样的冲突,只是和旧版本冲突。重启可能会产生无法进入系统的问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值