站長資訊網
最全最豐富的資訊網站

Ubuntu 18.04安裝Docker CE及nvidia-docker2流程

Docker的好處之一,就是在Container里面可以隨意瞎搞,不用擔心弄崩Host的環境。
nvidia-docker2的好處是NVidia幫你配好了Host和Container之間的CUDA相關的鏈接,讓你可以直接在Container里面使用GPU。

Ubuntu 18.04安裝Docker CE及nvidia-docker2流程

安裝環境

  • OS:Ubuntu 18.04 64 bit
  • 顯卡:NVidia GTX 1080
  • CUDA:10.0
  • cnDNN:7.4

任務:安裝Docker CEnvidia-docker2,以便后期開展深度學習

配置Docker源

# 更新源  $ sudo apt-get update    # 啟用HTTPS  $ sudo apt-get install       apt-transport-https       ca-certificates       curl       gnupg-agent       software-properties-common    # 添加GPG key  $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -    # 添加穩定版的源  $ sudo add-apt-repository      "deb [arch=amd64] https://download.docker.com/linux/ubuntu      $(lsb_release -cs)      stable"

安裝Docker CE

# 更新源  $ sudo apt-get update    # 安裝Docker CE  $ sudo apt-get install docker-ce

如果這種方式安裝失敗,也有解決方案。
報錯時屏幕上會顯示下載失敗的deb文件,想辦法下載下來,然后挨個手動安裝就好。

此時我需要下載的是下面三個文件:

  • containerd.io_1.2.2-1_amd64.deb
  • docker-ce-cli_18.09.1~3-0~ubuntu-bionic_amd64.deb
  • docker-ce_18.09.1~3-0~ubuntu-bionic_amd64.deb

手動依次安裝:

$ sudo dpkg -i containerd.io_1.2.2-1_amd64.deb  $ sudo dpkg -i docker-ce-cli_18.09.1~3-0~ubuntu-bionic_amd64.deb  $ sudo dpkg -i docker-ce_18.09.1~3-0~ubuntu-bionic_amd64.deb

驗證Docker CE

如果出現下面的內容,說明安裝成功。

$ sudo docker run hello-world    Unable to find image 'hello-world:latest' locally  latest: Pulling from library/hello-world  1b930d010525: Pull complete   Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535  Status: Downloaded newer image for hello-world:latest    Hello from Docker!  This message shows that your installation appears to be working correctly.    To generate this message, Docker took the following steps:   1. The Docker client contacted the Docker daemon.   2. The Docker daemon pulled the "hello-world" image from the Docker Hub.      (amd64)   3. The Docker daemon created a new container from that image which runs the      executable that produces the output you are currently reading.   4. The Docker daemon streamed that output to the Docker client, which sent it      to your terminal.    To try something more ambitious, you can run an Ubuntu container with:   $ docker run -it ubuntu bash    Share images, automate workflows, and more with a free Docker ID:   https://hub.docker.com/    For more examples and ideas, visit:   https://docs.docker.com/get-started/

配置nvidia-docker2

# 添加源  $ 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

安裝nvidia-docker2

# 安裝nvidia-docker2  $ sudo apt-get install -y nvidia-docker2    # 重啟Docker daemon  $ sudo pkill -SIGHUP dockerd

驗證nvidia-docker2

$ sudo nvidia-docker run --rm nvidia/cuda nvidia-smi

能看到顯卡信息就說明OK了,當前image是基于Ubuntu 18.04的。

贊(0)
分享到: 更多 (0)
網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
精品人妻系列无码一区二区三区| 国产精品亲子乱子伦xxxx裸| 国产精品社区在线观看| 国产精品免费观看| 91在线精品中文字幕| 久久99久久99精品免观看| 精品免费tv久久久久久久| 手机在线观看精品国产片| 国产叼嘿久久精品久久| 无码AV动漫精品一区二区免费| 日韩精品无码免费一区二区三区| 国产精品久久久久久网站 | 加勒比精品久久一区二区三区| 久久久一本精品99久久精品36 | 99精品久久久中文字幕| 国99精品无码一区二区三区| 自拍偷自拍亚洲精品被多人伦好爽 | 99久久久精品免费观看国产| 91久久亚洲国产成人精品性色| 人妻少妇精品视频一区二区三区 | 国产办公室秘书无码精品99| 伊人久久综合精品无码AV专区| 91精品在线播放| 9久久这里只有精品国产| 久久99精品久久久久久9蜜桃| 国产精品va在线观看无码| 亚洲精品岛国片在线观看| 亚洲精品成人在线| 久久精品无码免费不卡| 久久久久亚洲精品天堂久久久久久| 精品人体无码一区二区三区| 东京热TOKYO综合久久精品| 中国大陆精品视频XXXX| 亚洲精品成人片在线播放 | 久久青草精品38国产| 久久精品亚洲日本佐佐木明希| 久久久久亚洲精品美女| 99久热只有精品视频免费看| 亚洲国产美女精品久久| 国产成人精品日本亚洲直接 | 亚洲一级Av无码毛片久久精品|