赞
踩
参考自:https://blog.csdn.net/chekongfu/article/details/90758638
# 编辑文件blacklist.conf
sudo vim /etc/modprobe.d/blacklist.conf
# 进入编辑模式在最后插入以下内容:
blacklist nouveau
options nouveau modeset=0
sudo update-initramfs -u
重启系统。
验证nouveau是否被禁用,若没有任何信息显示,则说明nouveau已被禁用:
lsmod | grep nouveau
在Nvidia官网上查找GPU型号并下载对应的驱动,http://www.nvidia.cn/page/home.html,把下载好的run文件放到/home路径下。
关闭图形界面:
su root
service lightdm stop # 关闭图形界面
# 如果关不掉就ctrl + Alt + F2
apt-get remove nvidia-*
chmod a+x NVIDIA-Linux-x86_64-418.43.run
./NVIDIA-Linux-x86_64-418.43.run -no-x-check -no-nouveau-check -no-opengl-files
# 只有禁用opengl这样安装才不会出现循环登陆的问题
安装过程中的选项:
(这是copy别人的,自己的没记住,我也是尝试选择了好多遍才安装好)
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 继续
挂载Nvidia驱动:
modprobe nvidia
nvidia-smi
若出现以下提示,则说明安装成功!
14. 返回图形界面:
init 5
如果返回不了,一直黑屏,跳至文末踩坑日记(卸载Nvidia驱动,自动安装)
在Ubuntu下直接使用官方自动安装脚本安装Docker:
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
也是直接按照官方教程走就行了:
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f sudo apt-get purge -y nvidia-docker # Add the package repositories curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update # Install nvidia-docker2 and reload the Docker daemon configuration sudo apt-get install -y nvidia-docker2 sudo pkill -SIGHUP dockerd # Test nvidia-smi with the latest official CUDA image docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
vi /etc/docker/daemon.json # 在daemon中添加 "registry-mirrors": ["镜像地址"] { "runtimes": { "nvidia": { "path": "nvidia-container-runtime", "runtimeArgs": [] } }, "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] } # 然后重启 Docker systemctl restart docker.service
Docker中国区官方镜像:
https://registry.docker-cn.com
网易:
http://hub-mirror.c.163.com
中国科学技术大学(我用的是这个):
https://docker.mirrors.ustc.edu.cn
阿里云:
https://cr.console.aliyun.com/
如果遇到了安装完成驱动但无法进入图形界面,只有一个小光标在左上角闪,重装驱动。
Ctrl + Alt + F2 进入tty2,找到Nvidia卸载命令:
sudo /usr/bin/nvidia-uninstall
然后卸载完驱动后重启,reboot;
开机后即可以进入图形界面了,但是分辨率很低,在终端查找本机显卡的适配驱动型号:
ubuntu-drivers devices
安装推荐的型号(recommended):
apt-get install nvidia-driver-450-server
然后就等驱动自己安装好了,安装好了后reboot重启即可。
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。