Docker安裝和使用學(xué)習(xí)

安裝Docker

查看系統(tǒng)版本

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

官網(wǎng)的安裝方法 https://docs.docker.com/engine/install/ubuntu/

sudo apt-get update

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent gnupg lsb-release software-properties-common

添加 docker 官方 GPG 密鑰

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

使用下面的命令來設(shè)置穩(wěn)定版本庫唁奢。要添加nightly 版本庫或測試版本庫佩厚,請在下面的命令中的 stable 后面加上 nightly 或 test (或兩者)。了解nightly和test通道移袍。

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

echo  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo add-apt-repository  "deb [arch=amd64] https://download.docker.com/linux/ubuntu    $(lsb_release -cs)   stable"

安裝Docker Engine

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

sudo apt-get update
 
sudo apt-get install docker-ce docker-ce-cli containerd.io

驗證Docker是否安裝成功

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:10d7d58d5ebd2a652f4d93fdd86da8f265f5318c6a73cc5b6a9798ff6d2b2e67
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/

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ docker

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/home/liuhz/.docker")
  -c, --context string     Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and
                           default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/home/liuhz/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/home/liuhz/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/home/liuhz/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  app*        Docker App (Docker Inc., v0.9.1-beta3)
  builder     Manage builds
  buildx*     Docker Buildx (Docker Inc., v0.8.1-docker)
  compose*    Docker Compose (Docker Inc., v2.3.3)
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  manifest    Manage Docker image manifests and manifest lists
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  scan*       Docker Scan (Docker Inc., v0.17.0)
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/

查看Docker 版本

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ docker -v
Docker version 20.10.14, build a224086

安裝nvidia-docker

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker

運行 NVIDIA Container Toolkit 的先決條件列表如下所述:

  1. 內(nèi)核版本 > 3.10 的 GNU/Linux x86_64
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ cat /proc/version
Linux version 5.13.0-39-generic (buildd@lcy02-amd64-080) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ uname -r
5.13.0-39-generic
  1. Docker >= 19.03(推薦耿眉,但某些發(fā)行版可能包含舊版本的 Docker豺撑。支持的最低版本為 1.12)
    查看Docker 版本
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ docker -v
Docker version 20.10.14, build a224086
  1. 架構(gòu) >= Kepler(或計算能力 3.0)的 NVIDIA GPU

  2. NVIDIA Linux 驅(qū)動程序>= 418.81.07(請注意鹿驼,不支持較舊的驅(qū)動程序版本或分支紊婉。)

設(shè)置 Docker?

Ubuntu 上的 Docker-CE 可以使用 Docker 的官方便利腳本進行設(shè)置:

curl https://get.docker.com | sh && sudo systemctl --now enable docker
設(shè)置 NVIDIA 容器工具包?

設(shè)置包存儲庫和 GPG 密鑰:

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

要訪問experimental功能和訪問候選版本,您可能需要將experimental分支添加到存儲庫列表中:

curl -s -L https://nvidia.github.io/libnvidia-container/experimental/$distribution/libnvidia-container.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

更新包列表后安裝nvidia-docker2包(和依賴項):

sudo apt-get update

sudo apt-get install -y nvidia-docker2

設(shè)置默認運行時后重啟 Docker 守護進程完成安裝:

sudo systemctl restart docker

此時德召,可以通過運行基本 CUDA 容器來測試工作設(shè)置:

sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
Unable to find image 'nvidia/cuda:11.0-base' locally
11.0-base: Pulling from nvidia/cuda
54ee1f796a1e: Pull complete 
f7bfea53ad12: Pull complete 
46d371e02073: Pull complete 
b66c17bbf772: Pull complete 
3642f1a6dfb3: Pull complete 
e5ce55b8b4b9: Pull complete 
155bc0332b0a: Pull complete 
Digest: sha256:774ca3d612de15213102c2dbbba55df44dc5cf9870ca2be6c6e9c627fa63d67a
Status: Downloaded newer image for nvidia/cuda:11.0-base
Wed Apr 27 12:49:08 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:18:00.0 Off |                  N/A |
| 81%   73C    P2   334W / 350W |  23868MiB / 24268MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:3B:00.0 Off |                  N/A |
| 73%   70C    P2   232W / 350W |  23631MiB / 24268MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce ...  Off  | 00000000:5E:00.0 Off |                  N/A |
| 59%   63C    P2   262W / 350W |  22753MiB / 24268MiB |     99%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce ...  Off  | 00000000:86:00.0 Off |                  N/A |
| 59%   62C    P2   198W / 350W |  15465MiB / 24268MiB |     48%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

下載自定義的Docker

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker pull pytorch/pytorch:1.7.0-cuda11.0-cudnn8-devel
[sudo] liuhz 的密碼: 
1.7.0-cuda11.0-cudnn8-devel: Pulling from pytorch/pytorch
171857c49d0f: Already exists 
419640447d26: Already exists 
61e52f862619: Already exists 
2a93278deddf: Already exists 
c9f080049843: Already exists 
8189556b2329: Already exists c306a0c97a55: Pull complete 
4a9478bd0b24: Pull complete 
19a76c31766d: Pull complete 
1d18e0f6b7f6: Pull complete 
d8015a90b67c: Pull complete 
211a7eed3486: Pull complete 
Digest: sha256:837e6964e5db6e5b35f4d5e98e9cac073ab757766039b9503f39c14beafb0e98
Status: Downloaded newer image for pytorch/pytorch:1.7.0-cuda11.0-cudnn8-devel
docker.io/pytorch/pytorch:1.7.0-cuda11.0-cudnn8-devel

修改Docker路徑

創(chuàng)建或修改 /etc/docker/daemon.json

{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },
    "registry-mirrors": [
        "https://1nj0zren.mirror.aliyuncs.com",
        "https://docker.mirrors.ustc.edu.cn",
        "http://f1361db2.m.daocloud.io",
        "https://registry.docker-cn.com"],
    "data-root": "/home/liuhz/Docker/docker"
}
sudo systemctl daemon-reload
sudo systemctl restart docker

權(quán)限問題加入docker用戶組

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ docker images
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/images/json": dial unix /var/run/docker.sock: connect: permission denied
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker images
[sudo] liuhz 的密碼: 
REPOSITORY    TAG         IMAGE ID       CREATED         SIZE
hello-world   latest      feb5d9fea6a5   7 months ago    13.3kB
nvidia/cuda   11.0-base   2ec708416bb8   20 months ago   122MB
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo groupadd docker
groupadd:“docker”組已存在
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo gpasswd -a liuhz docker
正在將用戶“l(fā)iuhz”加入到“docker”組中
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ newgrp docker
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ docker images
REPOSITORY    TAG         IMAGE ID       CREATED         SIZE
hello-world   latest      feb5d9fea6a5   7 months ago    13.3kB
nvidia/cuda   11.0-base   2ec708416bb8   20 months ago   122MB
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ 

在Docker中運行nnUNet

在dockerhub上查詢nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04 白魂,版本號對應(yīng)項目運行環(huán)境的需求

將其拉下來,sudo docker pull nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04 上岗,成功后會有一個容器ID

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker pull nvidia/cuda:11.4.0-cudnn8-devel-ubuntu20.04

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker pull pytorch/pytorch:1.7.0-cuda11.0-cudnn8-devel

在dockerhub上pytorch
https://hub.docker.com/r/pytorch/pytorch/tags?page=1&ordering=last_updated

在dockerhub上ubuntu
https://hub.docker.com/r/nvidia/cuda/
https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md

查看鏡像和運行鏡像

查看本地庫中的鏡像

sudo docker images -a

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~/Docker$ sudo docker images -a
REPOSITORY    TAG                             IMAGE ID       CREATED       SIZE
nvidia/cuda   10.2-cudnn8-devel-ubuntu18.04   0dd9ea953585   3 weeks ago   4.46GB

查看 正在運行的 容器

sudo docker ps -a

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~/Docker$ sudo docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

為庫中鏡像改名

sudo docker tag {imageID} {repository}:{tag}

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~/Docker$ sudo docker tag 0dd9ea953585 ubuntu:cuda10-ubuntu18
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~/Docker$ sudo docker images -a
REPOSITORY    TAG                             IMAGE ID       CREATED       SIZE
ubuntu        cuda10-ubuntu18                 0dd9ea953585   3 weeks ago   4.46GB
nvidia/cuda   10.2-cudnn8-devel-ubuntu18.04   0dd9ea953585   3 weeks ago   4.46GB

刪除多余的鏡像

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker images 
REPOSITORY        TAG                             IMAGE ID       CREATED         SIZE
newubuntu         cuda10-ubuntu18                 0dd9ea953585   3 weeks ago     4.46GB
ubuntu            cuda10-ubuntu18                 0dd9ea953585   3 weeks ago     4.46GB
nvidia/cuda       10.2-cudnn8-devel-ubuntu18.04   0dd9ea953585   3 weeks ago     4.46GB
pytorch/pytorch   1.6.0-cuda10.1-cudnn7-devel     bb833e4d631f   21 months ago   7.04GB
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker rmi ubuntu:cuda10-ubuntu18
Untagged: ubuntu:cuda10-ubuntu18
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker rmi ubuntu:cuda10-ubuntu18
Error: No such image: ubuntu:cuda10-ubuntu18
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker images
REPOSITORY        TAG                             IMAGE ID       CREATED         SIZE
nvidia/cuda       10.2-cudnn8-devel-ubuntu18.04   0dd9ea953585   3 weeks ago     4.46GB
newubuntu         cuda10-ubuntu18                 0dd9ea953585   3 weeks ago     4.46GB
pytorch/pytorch   1.6.0-cuda10.1-cudnn7-devel     bb833e4d631f   21 months ago   7.04GB

pytorch鏡像測試

liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker images -a
[sudo] liuhz 的密碼: 
REPOSITORY        TAG                               IMAGE ID       CREATED         SIZE
newubuntu         cuda10-ubuntu18                   0dd9ea953585   3 weeks ago     4.46GB
nvidia/cuda       10.2-cudnn8-devel-ubuntu18.04     0dd9ea953585   3 weeks ago     4.46GB
nvidia/cuda       11.4.0-cudnn8-devel-ubuntu20.04   1885dcefbe89   7 months ago    9.01GB
pytorch/pytorch   1.6.0-cuda10.1-cudnn7-devel       bb833e4d631f   21 months ago   7.04GB
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ sudo docker run -it --rm --name test --gpus all pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel
root@1f8ac7edb753:/workspace# import torch
bash: import: command not found
root@1f8ac7edb753:/workspace# nvidia-smi
Wed Apr 27 16:42:45 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:18:00.0 Off |                  N/A |
| 81%   74C    P2   332W / 350W |  23868MiB / 24268MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:3B:00.0 Off |                  N/A |
| 73%   70C    P2   250W / 350W |  23631MiB / 24268MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce ...  Off  | 00000000:5E:00.0 Off |                  N/A |
| 58%   63C    P2   268W / 350W |  22753MiB / 24268MiB |    100%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce ...  Off  | 00000000:86:00.0 Off |                  N/A |
| 58%   62C    P2   209W / 350W |  15465MiB / 24268MiB |     85%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

root@1f8ac7edb753:/# conda list 

conda-package-handling    1.6.1            py37h7b6447c_0  
cryptography              2.9.2            py37h1ba5d50_0  
cudatoolkit               10.1.243             h6bb024c_0  
decorator                 4.4.2                      py_0  
filelock                  3.0.12                     py_0  
freetype                  2.10.2               h5ab3b9f_0  
glob2                     0.7                        py_0  
icu                       58.2                 he6710b0_3  
idna                      2.9                        py_1  
intel-openmp              2020.1                      217  
ipython                   7.16.1           py37h5ca1d4c_0  
ipython_genutils          0.2.0                    py37_0  
jedi                      0.17.1                   py37_0  
jinja2                    2.11.2                     py_0  
jpeg                      9b                   h024ee3a_2  
lcms2                     2.11                 h396b838_0  
ld_impl_linux-64          2.33.1               h53a641e_7  
libarchive                3.4.2                h62408e4_0  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.3                  he6710b0_1  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
liblief                   0.10.1               he6710b0_0  
libpng                    1.6.37               hbc83047_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtiff                   4.1.0                h2733197_1  
libxml2                   2.9.10               he19cac6_1  
lz4-c                     1.9.2                he6710b0_0  
markupsafe                1.1.1            py37h14c3975_1  
mkl                       2020.1                      217  
mkl-service               2.3.0            py37he904b0f_0  
mkl_fft                   1.1.0            py37h23d657b_0  
mkl_random                1.1.1            py37h0573a6f_0  
ncurses                   6.2                  he6710b0_1  
ninja                     1.9.0            py37hfd86e86_0  
numpy                     1.18.5           py37ha1c710e_0  
numpy-base                1.18.5           py37hde5b4d6_0  
olefile                   0.46                     py37_0  
openssl                   1.1.1g               h7b6447c_0  
parso                     0.7.0                      py_0  
patchelf                  0.11                 he6710b0_0  
pexpect                   4.8.0                    py37_1  
pickleshare               0.7.5                 py37_1001  
pillow                    7.2.0            py37hb39fc2d_0  
pip                       20.0.2                   py37_3  
pkginfo                   1.5.0.1                  py37_0  
prompt-toolkit            3.0.5                      py_0  
psutil                    5.7.0            py37h7b6447c_0  
ptyprocess                0.6.0                    py37_0  
py-lief                   0.10.1           py37h403a769_0  
pycosat                   0.6.3            py37h7b6447c_0  
pycparser                 2.20                       py_0  
pygments                  2.6.1                      py_0  
pyopenssl                 19.1.0                   py37_0  
pysocks                   1.7.1                    py37_0  
python                    3.7.7                hcff3b4d_5  
python-libarchive-c       2.9                        py_0  
pytorch                   1.6.0           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch
pytz                      2020.1                     py_0  
pyyaml                    5.3.1            py37h7b6447c_0  
readline                  8.0                  h7b6447c_0  
requests                  2.23.0                   py37_0  
ripgrep                   11.0.2               he32d670_0  
ruamel_yaml               0.15.87          py37h7b6447c_0  
setuptools                46.4.0                   py37_0  
six                       1.14.0                   py37_0  
soupsieve                 2.0.1                      py_0  
sqlite                    3.31.1               h62c20be_1  
tk                        8.6.10               hbc83047_0  
torchvision               0.7.0                py37_cu101    pytorch
tqdm                      4.46.0                     py_0  
traitlets                 4.3.3                    py37_0  
urllib3                   1.25.8                   py37_0  
wcwidth                   0.2.5                      py_0  
wheel                     0.34.2                   py37_0  
xz                        5.2.5                h7b6447c_0  
yaml                      0.1.7                had09818_2  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.4.5                h0b5b093_0  
root@1f8ac7edb753:/# python
Python 3.7.7 (default, May  7 2020, 21:25:33) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
root@1f8ac7edb753:/# ls
bin   dev  home  lib64  mnt  proc  run   srv  tmp  var
boot  etc  lib   media  opt  root  sbin  sys  usr  workspace
root@1f8ac7edb753:/# python
Python 3.7.7 (default, May  7 2020, 21:25:33) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>> 

root@1f8ac7edb753:/# exit
liuhz@ubuntu-SYS-7049GP-TRTC-RI017:~$ 

退出時ctrl+D或者exit

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末福荸,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子肴掷,更是在濱河造成了極大的恐慌敬锐,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,682評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件呆瞻,死亡現(xiàn)場離奇詭異台夺,居然都是意外死亡,警方通過查閱死者的電腦和手機痴脾,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,277評論 3 395
  • 文/潘曉璐 我一進店門颤介,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人赞赖,你說我怎么就攤上這事滚朵。” “怎么了前域?”我有些...
    開封第一講書人閱讀 165,083評論 0 355
  • 文/不壞的土叔 我叫張陵辕近,是天一觀的道長。 經(jīng)常有香客問我匿垄,道長亏推,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,763評論 1 295
  • 正文 為了忘掉前任年堆,我火速辦了婚禮吞杭,結(jié)果婚禮上变丧,老公的妹妹穿的比我還像新娘芽狗。我一直安慰自己,他們只是感情好痒蓬,可當我...
    茶點故事閱讀 67,785評論 6 392
  • 文/花漫 我一把揭開白布童擎。 她就那樣靜靜地躺著,像睡著了一般攻晒。 火紅的嫁衣襯著肌膚如雪顾复。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,624評論 1 305
  • 那天鲁捏,我揣著相機與錄音芯砸,去河邊找鬼。 笑死,一個胖子當著我的面吹牛假丧,可吹牛的內(nèi)容都是我干的双揪。 我是一名探鬼主播,決...
    沈念sama閱讀 40,358評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼包帚,長吁一口氣:“原來是場噩夢啊……” “哼渔期!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起渴邦,我...
    開封第一講書人閱讀 39,261評論 0 276
  • 序言:老撾萬榮一對情侶失蹤疯趟,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后谋梭,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體迅办,經(jīng)...
    沈念sama閱讀 45,722評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,900評論 3 336
  • 正文 我和宋清朗相戀三年章蚣,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片姨夹。...
    茶點故事閱讀 40,030評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡纤垂,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出磷账,到底是詐尸還是另有隱情峭沦,我是刑警寧澤,帶...
    沈念sama閱讀 35,737評論 5 346
  • 正文 年R本政府宣布逃糟,位于F島的核電站吼鱼,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏绰咽。R本人自食惡果不足惜菇肃,卻給世界環(huán)境...
    茶點故事閱讀 41,360評論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望取募。 院中可真熱鬧琐谤,春花似錦、人聲如沸玩敏。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,941評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽旺聚。三九已至织阳,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間砰粹,已是汗流浹背唧躲。 一陣腳步聲響...
    開封第一講書人閱讀 33,057評論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人惊窖。 一個月前我還...
    沈念sama閱讀 48,237評論 3 371
  • 正文 我出身青樓刽宪,卻偏偏與公主長得像,于是被迫代替她去往敵國和親界酒。 傳聞我的和親對象是個殘疾皇子圣拄,可洞房花燭夜當晚...
    茶點故事閱讀 44,976評論 2 355

推薦閱讀更多精彩內(nèi)容