Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostRequirements: gpu: missing driver option #10124

Open
lpasselin opened this issue Jul 31, 2024 · 5 comments
Open

hostRequirements: gpu: missing driver option #10124

lpasselin opened this issue Jul 31, 2024 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers

Comments

@lpasselin
Copy link

  • VSCode Version: 1.91.1
  • Local OS Version: ubuntu
  • Remote Extension/Connection Type: Containers

Same as this issue which is for windows: #9385

docker info -f '{{.Runtimes.nvidia}}' --> returns nvidia-container-runtime

Temporary fix is to add this to our docker-compose.yml but it breaks for users without gpu

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

When reverting to using a dockerfile instead of docker-compose, "runArgs": [ "--gpus", "all" ] does work

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Jul 31, 2024
@RaphaelMelanconAtBentley

Having the same issue, and it's a pain for my team, as we have multiple people working with Macbooks... Really hoping for this to be fixed.

@RaphaelMelanconAtBentley

For docker compose, I have a hacky fix:

I simply use this script I created and extend my docker-compose.yml's devcontainer service with the file created:

#!/bin/bash

target_file="environments/devcontainer/gpu_optional.docker-compose.yml"
snippets_path="environments/devcontainer/build_utils/snippets"
if ! nvidia-smi >/dev/null; then
    cp "${snippets_path}/without_gpu.docker-compose.yml" "${target_file}"
else
    cp "${snippets_path}/with_gpu.docker-compose.yml" "${target_file}"
fi

where ${snippets_path}/without_gpu.docker-compose.yml contains:

services:
  devcontainer:
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

and ${snippets_path}/with_gpu.docker-compose.yml contains:

services:
  devcontainer:

Hope this helps!

@chrmarti
Copy link
Contributor

docker info -f '{{.Runtimes.nvidia}}' --> returns nvidia-container-runtime

@lpasselin This case should work. Please append the Dev Containers log from when you rebuild the container. (F1 > Dev Containers: Show Container Log)

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Aug 23, 2024
@PanTheDev
Copy link

@chrmarti in my case, what I found what that although the runtime is nvidia-container-runtime, the docker compose config used has a deploy section that looks like this:

services:
  devcontainer-service:
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]
              count: all

The driver: nvidia part is missing...

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Sep 10, 2024
@chrmarti chrmarti changed the title hostRequirements: gpu: optional is broken on linux hostRequirements: gpu: missing driver option Sep 10, 2024
@chrmarti
Copy link
Contributor

Could you share the output from docker info --format '{{json .}}'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

4 participants