Skip to content

Improve hostRequirements, Features support for dev containers that use GPUs #82

Closed
@Chuxel

Description

@Chuxel

Dev containers can run on machines with GPUs and access them directly on Linux or through WSL on Windows. However, currently there is no direct support for a GPUs in the spec.

To enable GPU support, I'd propose we enhance the "hostRequirements" property to allow specifying GPU information. If this information is present, we then automatically enable GPU support (e.g., via --gpus all).

I'd propose we support a form that simply adds a requirement for any GPU, with the option to specify more requirements for further validation. Here's a proposed format:

Just enabling/requiring any GPU

"hostRequirements": {
    "gpu": true

Specifying cores and memory:

"hostRequirements": {
    "gpu": {
        "cores": 2
        "memory": "4gb" // Same value format as memory for the machine
    }
}

and with type

"hostRequirements": {
    "gpu": {
        "cores": 2
        "memory": "4gb"
        "type": "nvidia"
    }
}

To allow Dev Container Features (#61) to require a GPU (e.g., in an NVIDIA CUDA feature), I'd propose we also allow hostRequirements to be specified in devcontainer-features.json.

Metadata

Metadata

Assignees

Labels

proposalStill under discussion, collecting feedback

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions