[笔记] Ubuntu 18.04安装Docker CE及nvidia-docker2流程
这篇已经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 CE
及nvidia-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.03-0ubuntu-bionic_amd64.deb
- docker-ce_19.03.03-0ubuntu-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-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
# 更新源
$ 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的。
[笔记] Ubuntu 18.04安装Docker CE及nvidia-docker2流程的更多相关文章
- [笔记] Ubuntu 18.04安装Docker CE及NVIDIA Container Toolkit流程
之前写的[笔记] Ubuntu 18.04安装Docker CE及nvidia-docker2流程已经out了,以这篇为准. Docker的好处之一,就是在Container里面可以随意瞎搞,不用担心 ...
- [笔记] Ubuntu 18.04安装cuda 10及cudnn 7流程
安装环境 OS:Ubuntu 18.04 64 bit 显卡:NVidia GTX 1080 任务:安装 CUDA 10及cuDNN 7 工具下载 NVidia官网下载下列文件: CUDA 10:cu ...
- 记录Ubuntu 16.04 安装Docker CE
一.Docker的两个版本 Docker有两个版本: 社区版(CE) 企业版(EE) Docker Community Edition(CE)非常适合希望开始使用Docker并尝试使用基于容器的应用程 ...
- Ubuntu 18.04 安装 docker, 设置阿里云加速
1.卸载旧的 docker 环境 sudo apt-get remove docker docker-engine docker.io containerd runc 2.设置仓库 更新索引 sudo ...
- ubuntu 18.04安装docker以及docker内配置neo4j
如题 切换到root用户下 apt install docker.io 等啊等,很快,就好了.. 如图 即可使用 如果出现Cannot connect to the Docker daemon at ...
- Ubuntu 18.04 安装Docker
第一种方法从Ubuntu的仓库直接下载安装: 安装比较简单,这种安装的Docker不是最新版本,不过对于学习够用了,依次执行下面命令进行安装. $ sudo apt install docker.io ...
- Ubuntu 18.04安装docker 以及Nginx服务设置
1.安装需要的包sudo apt install apt-transport-https ca-certificates software-properties-common curl 2.添加 GP ...
- [笔记] Ubuntu 18.04源码安装caffe流程
虽然Ubuntu 18.04可以通过apt安装caffe,但是为了使用最新的代码,还是值得从源码安装一遍的. 安装环境 OS: Ubuntu 18.04 64 bit 显卡: NVidia GTX 1 ...
- 笔记:在 Windows 10 WSL Ubuntu 18.04 安装 Odoo12 (2019-06-09)
笔记:在 Windows 10 WSL Ubuntu 18.04 安装 Odoo12 原因 为了和服务器一样的运行环境. 使用 Ubuntu 运行 Odoo 运行更快. 方便使用 Windows 10 ...
随机推荐
- Laravel5.1 搭建博客 --上传文件及文件管理
教程源自:Laravel学院 这一节 咱来说说上传文件的功能实现,我们会把上传的文件保存到项目本地,不仅上传 还有删除和预览功能. 1 配置 我们先从配置开始做起,先修改我们自己创建的 blog.ph ...
- WinFrom 第三方控件 TeleRik控件
1.首先从工具-拓展与应用中下载安装 TeleRik WinFroms VsExtensions TeleRik dll文件 2.工具箱控件 将Telerik控件更新过来 3.新建一个 ...
- 深入了解Java之虚拟机内存
在讨论JVM内存区域分析之前,先来看一下Java程序详细运行的过程: -我们今天就来分析一下Java程序运行过程的-Runtime-Data-Area(运行时数据)-这一块" class=& ...
- STL map 的 key 元素
在做 compiler 语义分析时, 需要用到 map<?,?> 在别人的代码上做扩展, 所以有些代码是不能动的 这时, 需要一个 map<symbol,int> 的数据结构, ...
- log4j2设置日志文件读写权限(filePermissions)
spring-boot使用log4j2作为日志插件的时候需要设置日志文件的读写权限,可以File 上增加filePermissions,如: <File name="File" ...
- Android之MessageQueue、Looper、Handler与消息循环
在android的activity中有各种各样的事件,而这些事件最终是转换为消息来处理的.android中的消息系统涉及到: * 消息发送 * 消息队列 * 消息循环 * 消息分发 * 消息 ...
- ios 更改UITableview中Section的字体颜色
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UILabel *c ...
- SaltStack之编译安装LNMP环境
使用saltstack编译安装LNMP环境 一,系统版本查看 二,安装salt-master和salt-minion 安装配置过程参考SaltStack概述及安装 三,修改配置文件 /etc/salt ...
- 解决CMD编译中文乱码
chcp 是MD DOS中的命令,用了显示或设置活动的代码编号的,用法查看当前编码格式(系统默认为:936 #936表示的是gb2312) chcp 修改当前编码格式(修改为utf-8) chcp ...
- Servlet------>jsp自定义标签(JSPTAG接口)
TagSupport实现类里不只实现了tag接口,还有tag接口的子接口,也就是IterationTag子接口中增加了doAfterBody()方法和EVAL_BODY_AGAIN常量,为了实现标签体 ...