美文网首页
Ubuntu下Docker/nvidia-docker安装

Ubuntu下Docker/nvidia-docker安装

作者: greathope | 来源:发表于2019-04-17 16:13 被阅读0次

    Docker

    • 官网指南

      sudo apt-get update
      sudo apt-get install \
          apt-transport-https \
          ca-certificates \
          curl \
          software-properties-common
      curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      sudo apt-key fingerprint 0EBFCD88
      sudo add-apt-repository \
         "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
         $(lsb_release -cs) \
         stable"
      sudo apt-get update
      sudo apt-get install docker-ce
      
    • 最后一步可能有问题

      • docker-ce下载不下来
        • 直接浏览器下载
      • Error docker-ce : Depends: libseccomp2 (>= 2.3.0) but 2.2.3-3ubuntu3 is to be installed
        • System settings -> Software & updates -> Updates: Recomended updates
        • sudo apt update

    Nvidia-docker

    # 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 nvidia-smi
    

    相关文章

      网友评论

          本文标题:Ubuntu下Docker/nvidia-docker安装

          本文链接:https://www.haomeiwen.com/subject/pfmnwqtx.html