File size: 576 Bytes
c9ea516
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
version: '3.5'
services:
  ros2_dev_env:
    image: ros2_devel:${IMAGE_TAG}
    network_mode: host
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
      - DISPLAY
      # force libGL to use the NVIDIA GPU
      - __NV_PRIME_RENDER_OFFLOAD=1
      - __GLX_VENDOR_LIBRARY_NAME=nvidia
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix:rw
      - ./ws:/home/user/ws
    tty: true
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]