vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Enabling GPU

Open martin503 opened this issue 3 years ago • 2 comments
trafficstars

Issue Type: Bug

  • VS Code Version: 1.69
  • OS Version: Ubuntu 22

Steps to Reproduce:

  1. Use .devcontainer with nvcr.io image e.g. Dockerfile with only such entry should be enough:
FROM nvcr.io/nvidia/pytorch:22.06-py3
  1. Specify in devconatiner.json in "runArgs" enabling gpu (in any way: ID, whole gpu name) e.g. :
"runArgs": ["--gpus all"],
  1. Use Reopen in container (just build conatiner with extension) and u should see error just at then end that docker run failed

I tried to reproduce bug on many systems and on all of them the bug happens (Ubuntu 18, 22, Mint 20) Extension version: 0.241.3 VS Code version: Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a, 2022-07-18T16:14:10.636Z) OS version: Linux x64 5.4.0-122-generic Restricted Mode: No

martin503 avatar Jul 26 '22 07:07 martin503

Same here. Docker run fails. And the log has an entry that says "unknown flag: --gpus all". Looks like --gpus was introduced in API v1.40: see, --gpus entry at https://docs.docker.com/engine/reference/commandline/run/

I'm running Windows 10 (21H2) with WSL2 (using Ubuntu distro; version 20.04) and docker desktop (docker ver 20.10.17 on Windows and ver 20.10.12 when integrated on WSL). When I use docker run in the Windows command prompt, I can use the --gpus all flag and it creates a container without a problem (and makes the gpu available in that container).

keg247 avatar Aug 08 '22 04:08 keg247

I just used "-gpus=all" (notice use of equals) in the runArgs and it created and attached the container without error. I used it on the kaggle gpu image and have access to the gpu.

keg247 avatar Aug 09 '22 00:08 keg247

We are adding "hostRequirements"."gpu" to the devcontainer.json. That will enable GPU support on the container if a GPU is detected. Keeping this issue to track adding a "gpu" flag to let the user control it without relying on the detection.

chrmarti avatar Dec 07 '22 08:12 chrmarti

@chrmarti is the hostRequirements.gpu option available in GitHub Codespaces? cannot seem to find it in the documentation.

davidblom603 avatar Apr 27 '23 07:04 davidblom603

@craiglpeters Is GPU support for Codespaces still in preview? (See above question.)

chrmarti avatar May 04 '23 09:05 chrmarti