Skip to content

Instantly share code, notes, and snippets.

@Keiku
Created March 28, 2022 07:42
Show Gist options
  • Save Keiku/1bb5dcfbdb91794e716e6c7cbdd95425 to your computer and use it in GitHub Desktop.
Save Keiku/1bb5dcfbdb91794e716e6c7cbdd95425 to your computer and use it in GitHub Desktop.
Use CUDA 11.3 in Ubuntu 16.04 and CUDA 10.2 environment
> ~/c/docker-compose cat docker-compose.yaml                                                                                                                      16:33:48
services:
  test:
    image: nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
    command: nvidia-smi
    environment:
     - NVIDIA_DISABLE_REQUIRE=1
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
⋊> ~/c/docker-compose docker-compose up                                                                                                                            16:34:14
Starting docker-compose_test_1 ... done
Attaching to docker-compose_test_1
test_1  | Mon Mar 28 07:34:17 2022
test_1  | +-----------------------------------------------------------------------------+
test_1  | | NVIDIA-SMI 440.118.02   Driver Version: 440.118.02   CUDA Version: 11.3     |
test_1  | |-------------------------------+----------------------+----------------------+
test_1  | | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
test_1  | | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
test_1  | |===============================+======================+======================|
test_1  | |   0  TITAN X (Pascal)    Off  | 00000000:01:00.0 Off |                  N/A |
test_1  | | 23%   32C    P8     8W / 250W |     62MiB / 12194MiB |      0%      Default |
test_1  | +-------------------------------+----------------------+----------------------+
test_1  |
test_1  | +-----------------------------------------------------------------------------+
test_1  | | Processes:                                                       GPU Memory |
test_1  | |  GPU       PID   Type   Process name                             Usage      |
test_1  | |=============================================================================|
test_1  | +-----------------------------------------------------------------------------+
docker-compose_test_1 exited with code 0
⋊> ~/c/docker-compose 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment