安装Linux18.04显卡驱动以及docker gui连接

先下载对应显卡版本驱动-nvidia官网官方驱动 | NVIDIA

确认该系统未装任何驱动, 如果不确定,按照以下操作:

删除旧的驱动

sudo apt-get purge nvidia*

禁用

sudo gedit /etc/modprobe.d/blacklist.conf

编辑文件,在最后一行添加

blacklist nouveau

执行

lsmod | grep nouveau # 没输出代表禁用生效

接下来定位到下载的驱动那个盘

执行

$ sudo chmod a+x NVIDIA-Linux-x86_64-440.44.run

$ sudo ./NVIDIA-Linux-x86_64-440.44.run

对应的版本自己换(根据自己的驱动版本)

安装选项

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

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

安装完成

 doker gui 连接报错

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

解决办法

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

以上4条命令一次运行

接下来执行安装nvidia-container-toolkit

sudo apt-get install -y nvidia-container-toolkit

最后重启docker

sudo systemctl restart docker

技术支持:感谢

docker: Error response from daemon: could not select device driver ““ with capabilities: [[gpu]]问题解决_一个菜鸟的奋斗的博客-CSDN博客

ubuntu18.04 安装NVIDIA驱动 FOR CUDA_时间就好好的博客-CSDN博客

新装操作系统Ubuntu18.04上安装NVIDIA驱动、CUDA、CUDNN_MOLWH的博客-CSDN博客

posted @ 2022-04-15 12:50  Dennis-Chen  阅读(43)  评论(0)    收藏  举报  来源