Ubuntu环境下Nvidia-Driver 卸载/安装 指南

1、停X Server

sudo service lightdm stop

2、卸载之前的Driver

sudo /usr/bin/nvidia-uninstall

3、给驱动run文件赋予执行权限

sudo chmod  a+x NVIDIA-Linux-x86_64-396.18.run

4、安装Driver

# 一字不差的输入后面配置项,这样才不会出现循环登陆问题
sudo ./NVIDIA-Linux-x86_64-396.18.run -no-x-check -no-nouveau-check -no-opengl-files 

# 含义介绍:
# -no-x-check:安装驱动时关闭X服务
# -no-nouveau-check:安装驱动时禁用nouveau
# -no-opengl-files:只安装驱动文件,不安装OpenGL文件,这样才不会出现循环登陆的问题

5、安装时选项

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 继续
# 选项是:install without signing
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.  
# 选择 Yes  继续

6、挂载驱动

modprobe nvidia
检查是否安装成功
nvidia-smi

7、启动界面服务

sudo service lightdm start

若分辨率只有一个,则:

打开:/etc/default/grub
搜索:#GRUB_GFXMODE=640x480
编辑:640x480改成你想要的分辨率,并取消前面的#
例如:GRUB_GFXMODE=1920x1080 
更新:sudo update-grub

 

你可能感兴趣的:(环境搭建,Ubuntu,环境搭建,Nvidia-Driver)