当前位置: 代码迷 >> 综合 >> 记录Ubuntu 18.04 (.run)方式安装 Nvidia driver
  详细解决方案

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

热度:116   发布时间:2023-11-22 18:00:28.0

环境 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 wantto 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 Driverfor 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官方自带的驱动冲突的问题,一般情况下不存在这样的冲突,只是和旧版本冲突。重启可能会产生无法进入系统的问题。

  相关解决方案