[GH-ISSUE #120] Docker compose syntax change required #41

Closed
opened 2026-10-15 12:48:18 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @MetalGooseSolid on GitHub (Jan 17, 2023).
Original GitHub issue: https://github.com/games-on-whales/gow/issues/120

At some recent version of Nvidia Container Toolkit (I think that's what's causing the breakage?), there's a compatibility change with docker compose yaml. The line runtime: ${DOCKER_RUNTIME} is broken and needs to be replaced with something like:

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
Originally created by @MetalGooseSolid on GitHub (Jan 17, 2023). Original GitHub issue: https://github.com/games-on-whales/gow/issues/120 At some recent version of Nvidia Container Toolkit (I think that's what's causing the breakage?), there's a compatibility change with docker compose yaml. The line `runtime: ${DOCKER_RUNTIME}` is broken and needs to be replaced with something like: ``` deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] ```
Author
Owner

@zb140 commented on GitHub (Feb 5, 2023):

My understanding is there's a difference between the "NVIDIA Container Toolkit" and the "NVIDIA Container Runtime"; the Runtime is what we're currently configured to use, while the Toolkit uses this new syntax. The Toolkit is the preferred method for using GPUs in Docker going forward, so we're definitely going to need to support this. There's a couple of things we'll need to figure out:

  • Is there a minimum version of docker-compose to be able to use the new syntax? If so, we'll need to make sure run-gow is requiring the correct version.
  • This new syntax is a little more complicated than just conditionally setting a couple of environment variables. We can definitely make it work, but we'll need to figure out a clean way of modifying the existing support to emit the new syntax
  • How does this interact with GPUs of other manufacturers? Is it possible to request a GPU without having to care about who made it? If not, what's the cleanest way to make it configurable through run-gow?
<!-- gh-comment-id:1416914110 --> @zb140 commented on GitHub (Feb 5, 2023): My understanding is there's a difference between the "NVIDIA Container Toolkit" and the "NVIDIA Container Runtime"; the Runtime is what we're currently configured to use, while the Toolkit uses this new syntax. The Toolkit is the preferred method for using GPUs in Docker going forward, so we're definitely going to need to support this. There's a couple of things we'll need to figure out: * Is there a minimum version of `docker-compose` to be able to use the new syntax? If so, we'll need to make sure `run-gow` is requiring the correct version. * This new syntax is a little more complicated than just conditionally setting a couple of environment variables. We can definitely make it work, but we'll need to figure out a clean way of modifying the existing support to emit the new syntax * How does this interact with GPUs of other manufacturers? Is it possible to request a GPU without having to care about who made it? If not, what's the cleanest way to make it configurable through `run-gow`?
Author
Owner

@dennispg commented on GitHub (Jun 22, 2023):

I was able to have both in my compose file, like this:

    runtime: ${DOCKER_RUNTIME}
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]

Didn't need to specify the driver with this. This is with docker compose version 2.18.1 and nvidia-container-toolkit 1.13.2-1.

The deploy option was added in compose spec v3, which has been available since docker-compose version 1.13. The min required right now is 2.6, so I think there should be no harm in adding this.

<!-- gh-comment-id:1603283357 --> @dennispg commented on GitHub (Jun 22, 2023): I was able to have both in my compose file, like this: ```yaml runtime: ${DOCKER_RUNTIME} deploy: resources: reservations: devices: - capabilities: [gpu] ``` Didn't need to specify the driver with this. This is with docker compose version 2.18.1 and nvidia-container-toolkit 1.13.2-1. The deploy option was added in compose spec v3, which has been available since docker-compose version 1.13. The min required right now is 2.6, so I think there should be no harm in adding this.
Author
Owner

@ABeltramo commented on GitHub (Jun 14, 2024):

The run-gow script has been deprecated in favour of Wolf

<!-- gh-comment-id:2168662052 --> @ABeltramo commented on GitHub (Jun 14, 2024): The `run-gow` script has been deprecated in favour of [Wolf](https://github.com/games-on-whales/wolf)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/gow#41
No description provided.