当前位置:   article > 正文

Docker 安装与配置使用GPU教程_docker 分配gpu

docker 分配gpu

使用官方安装脚本自动安装

安装命令如下:

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
  • 1

也可以使用国内 daocloud 一键安装命令:

curl -sSL https://get.daocloud.io/docker | sh
  • 1

安装完成后解决Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json”: dial unix /var/run/docker.sock: connect: permission denied问题

方法一:重启docker服务

使用命令

sudo systemctl restart docker
  • 1

方法二:修改docker文件权限

使用命令

sudo chmod 666 /var/run/docker.sock
  • 1

参考

How to fix docker: Got permission denied while trying to connect to the Docker daemon socket | DigitalOcean

解决使用GPU报错docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].

查找资料后发现需要安装nvidia-container-toolkit即可,使用如下命令

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
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 && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

参考:

Docker 使用GPU 错误之Error could not select device driver “” with capabilities: [[gpu]]

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/707930
推荐阅读
相关标签
  

闽ICP备14008679号