📜  从 docker-compose 授予 gpu 访问权限 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:20.197000             🧑  作者: Mango

代码示例1
services:
  test:
    image: tensorflow/tensorflow:latest-gpu
    command: python -c "import tensorflow as tf;tf.test.gpu_device_name()"
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]