- 在线安装:
- 去官网搜索适应自己显卡的驱动版本
- 安装驱动
- sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-375 #此处要根据上面查询到的版本适当更改
sudo apt-get install mesa-common-dev
sudo apt-get install freeglut3-dev
- sudo add-apt-repository ppa:graphics-drivers/ppa
- 重启电脑,测试
- reboot
nvidia-smi
- reboot
- 离线安装:
- 去官网下载需要的显卡驱动,以NVIDIA-Linux-x86_64-390.87.run为例。
- 禁用 nouveau驱动
- lsmod | grep nouveau # 查看有没有输出,如果有信息输出,则需要禁掉
- sudo gedit /etc/modprobe.d/blacklist.conf
- 在blacklist.conf的最后添加下面几行:
- blacklist vga16fb
- blacklist nouveau
- blacklist rivafb
- blacklist rivatv
- blacklist nvidiafb
- 保存,关闭
- 更新
- sudo update-initramfs -u
- 重启
- lsmod | grep nouveau # 查看有没有输出,如果没有任何信息输出,则说明ok
- 进入tty模式进行安装
- Ctrl+Alt+F1进入文本模式
- sudo service lightdm stop # 关闭图形界面
- sudo sh NVIDIA-Linux-x86_64-390.87.run --no-opengl-files –no-x-check –no-nouveau-check
- –no-opengl-files 只安装驱动文件,不安装OpenGL文件。这个参数最重要
- –no-x-check 安装驱动时不检查X服务
- –no-nouveau-check 安装驱动时不检查nouveau
后面两个参数可不加。 - 如果在装的过程中出现以下信息,请选择:
- The 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 继续。
- Nvidia's 32-bit compatibility libraries? 选择 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. 选择 no 继续
- sudo service lightdm restart # 重新开启图形界面
- nvidia-smi # 查看是否安装成功
- 如果遇到循环登陆的情况,请参考:
在线安装参考:https://www.cnblogs.com/chay/p/8038195.html
离线安装参考:https://blog.youkuaiyun.com/u014797226/article/details/79626693
https://blog.youkuaiyun.com/stories_untold/article/details/78521925