Skip to content

Support NVIDIA GPUs (nerdctl run --gpus) #248

@ktock

Description

@ktock

Docker has an option to use nvidia GPUs (docker run --gpus). It's great if we can use it in nerdctl run as well.

I believe we can make it in the same way as ctr run --gpus option (containerd/containerd#2330), using github.com/containerd/containerd/contrib/nvidia:

https://github.com/crosbymichael/containerd/blob/834f58bd0cbeb1e3371f583b745ef0ad2fca238e/cmd/ctr/commands/run/run_unix.go#L189-L191

		if context.IsSet("gpus") {
        			opts = append(opts, nvidia.WithGPUs(nvidia.WithDevices(context.Int("gpus")), nvidia.WithAllCapabilities))
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions