这篇已经Out了,以[笔记] Ubuntu 18.04安装Docker CE及NVIDIA Container Toolkit流程为准。

Docker的好处之一,就是在Container里面可以随意瞎搞,不用担心弄崩Host的环境。
nvidia-docker2的好处是NVidia帮你配好了Host和Container之间的CUDA相关的链接,让你可以直接在Container里面使用GPU。

安装环境

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

任务:安装Docker CEnvidia-docker2,以便后期开展深度学习

配置Docker源

# 更新源
$ sudo apt update# 启用HTTPS
$ sudo apt install -y \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 update# 安装Docker CE
$ sudo apt install -y docker-ce

如果这种方式安装失败,也有解决方案。
报错时屏幕上会显示下载失败的deb文件,想办法下载下来,然后挨个手动安装就好。

此时我需要下载的是下面三个文件:

  • containerd.io_1.2.6-3_amd64.deb
  • docker-ce-cli_19.03.0~3-0~ubuntu-bionic_amd64.deb
  • docker-ce_19.03.0~3-0~ubuntu-bionic_amd64.deb

手动依次安装:

$ sudo dpkg -i containerd.io_1.2.6-3_amd64.deb
$ sudo dpkg -i docker-ce-cli_19.03.0~3-0~ubuntu-bionic_amd64.deb
$ sudo dpkg -i docker-ce_19.03.0~3-0~ubuntu-bionic_amd64.deb

验证Docker CE

如果出现下面的内容,说明安装成功。

$ sudo docker run hello-worldUnable 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:latestHello 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 theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare 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# 更新源
$ sudo apt update

安装nvidia-docker2

# 安装nvidia-docker2
$ sudo apt 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的。

转载于:https://www.cnblogs.com/journeyonmyway/p/10318624.html

[笔记] Ubuntu 18.04安装Docker CE及nvidia-docker2流程相关推荐

  1. Ubuntu 18.04安装Docker Dashboard

    Ubuntu 18.04安装Docker Dashboard Set up the repository 更新apt包 sudo apt-get updatesudo apt-get install ...

  2. Ubuntu 18.04 安装Wine 微信

    Ubuntu 18.04 安装Wine 微信 前言 Ubuntu 18.04与Ubuntu 16.04安装Wine和微信总体流程相似但也有小区别 操作步骤 安装Wine 最新版 # 0. 卸载旧版Wi ...

  3. ubuntu 18.04安装wine-微信和QQ

    ubuntu 18.04安装wine-微信和QQ 安装deepin-wine环境 安装微信 安装QQ 安装deepin-wine环境 微信和QQ已经成为日常生活中不可或缺的工具,刚刚入坑Ubuntu感 ...

  4. Ubuntu 18.04 安装 redis入门使用

    Ubuntu 18.04 安装 redis入门使用 1.安装 sudo apt-get install redis-server 2.查看redis运行状态 ps -ef | grep redis 3 ...

  5. Ubuntu 18.04安装CUDA(版本10.2)和cuDNN

    1.系统要求 2.安装前的要求 3.runfile安装(不支持跨平台) 4.后续安装操作 5.安装cuDNN 6.汇总问题 本文基于Ubuntu 18.04.3 LTS 64位安装CUDA 10.2和 ...

  6. Ubuntu 18.04 安装OpenCV C++

    Ubuntu 18.04 安装OpenCV C++ 构建并安装 仅构建核心模块 # 更新并安装依赖 sudo apt update && sudo apt install -y cma ...

  7. Ubuntu 18.04安装NVIDIA(英伟达) RTX2080Ti显卡

    Ubuntu 18.04安装NVIDIA(英伟达) RTX2080Ti显卡 在安装显卡之前请先把ubuntu 18.04系统提前安装好. 需要准备的资料: NVIDIA 驱动 下载驱动 驱动的下载地址 ...

  8. linux 模拟运行 微信,Ubuntu 18.04 安装微信(Linux通用)

    Ubuntu 18.04 安装微信(Linux通用) 发布时间:2018-06-02 10:52, 浏览次数:1468 , 标签: Ubuntu Linux Linux相关的知识:https://ww ...

  9. ubuntu 18.04 安装 中文 拼音 输入法

    ubuntu 18.04 安装 中文输入法 拼音 在安装ubuntu时,如果选择英文安装默认会不启用中文输入法的.可以通过下述方法开启: 1,安装 pingyin 输入法 打开终端输入命令: sudo ...

最新文章

  1. 小P寻宝记——好基友一起走 背包
  2. 找到那些氪金大佬,然后榨干他们丨AIの特殊技能
  3. Linux 下安装 Oracle9i
  4. android 数据存储路径
  5. flink sql planner到底是干嘛用的
  6. 清除dns缓存命令行_怎么防止移动dns劫持,防止移动dns劫持要先了解什么是dns劫持...
  7. android对话框字体大小,Android Dialog 设置字体大小的具体方法
  8. oracle磁盘组故障组的概念,ASM中理解的问题大家帮忙!!(asm的外部冗余,为什么也有故障组呢?)...
  9. 电子设计比赛的STM32知识准备
  10. 高通9008驱动_安卓手机高通9008模式下如何救砖
  11. matplotlib之pyplot模块——阶梯图(step():基本功能、参数)
  12. 微信开发笔记:生成带参数的公众号二维码
  13. Warning: [antdv: LocaleProvider] `LocaleProvider` is deprecated. Please use `local
  14. nvm 管理 node 版本
  15. Rocky——CentOS的延续(原版开发人员)安装与安装后必要操作(个人版)
  16. 改变el-input框的样式(去掉边框),及scoped实现原理
  17. C语言中的字符串与字符串函数
  18. WebSocket的JavaScript例子
  19. 如何在ABBYY FineReader 12中添加图像
  20. 基于随机森林算法的糖尿病数据集回归

热门文章

  1. java内存映射缓存,java – 用于数据库实现的内存映射的MappedByteBuffer或直接ByteBuffer?...
  2. python合并表格_python合并表格sheets
  3. 大数据要学javaweb吗_大数据是私有财产吗?
  4. python︱ collections模块(namedtuple/defaultdict/OrderedDict等)
  5. LDA︱基于LDA的Topic Model变形+一些NLP开源项目
  6. scikit-learn和tensorflow的区别
  7. 笔记(4)——Analyzing Communities and Their Evolutions in Dynamic Social Networks
  8. OpenCV之分离和合并颜色通道
  9. python main函数
  10. MVC页面重定向'页面跳转