Docker.DotNet icon indicating copy to clipboard operation
Docker.DotNet copied to clipboard

Nvidia runtime (--runtime=nvidia)

Open gosha20777 opened this issue 6 years ago • 6 comments

I want to run docker with this parametr runtime=nvidia

E.g. cli command is: docker run --rm --runtime=nvidia nvidia/cuda:9.0-devel nvcc --version

Now I sucsessfully running my service via dotnet Its equvalent this command: docker run -p 5000:5000 gosha20777/my-service:1.2

But I want to run also it with nvidia docker (nvidia runtime) docker run --runtime=nvidia -p 5000:5000 gosha20777/my-gpu-service:1.2

How I can do it?

gosha20777 avatar Sep 03 '19 15:09 gosha20777

Is there any way to specify runtime?

mocsharp avatar Sep 07 '22 17:09 mocsharp

I think you’re looking for:

https://github.com/dotnet/Docker.DotNet/blob/13ad3a144d24af0451d5a1c5f749a92e1252888f/src/Docker.DotNet/Models/HostConfig.Generated.cs#L148

HofmeisterAn avatar Sep 07 '22 17:09 HofmeisterAn

I think you’re looking for:

https://github.com/dotnet/Docker.DotNet/blob/13ad3a144d24af0451d5a1c5f749a92e1252888f/src/Docker.DotNet/Models/HostConfig.Generated.cs#L148

Yes! Thank you @HofmeisterAn, I was about to post an update with the finding 😂. However, I couldn't find options for --gpus. Any idea where to find it? 🙏

mocsharp avatar Sep 07 '22 17:09 mocsharp

I think you need:

https://github.com/dotnet/Docker.DotNet/blob/f58748616cc5b679b25496926c5688294c94d850/src/Docker.DotNet/Models/HostConfig.Generated.cs#L205

Similar to the Docker Compose configuration.

HofmeisterAn avatar Sep 07 '22 18:09 HofmeisterAn

@HofmeisterAn Big thanks!!

mocsharp avatar Sep 07 '22 18:09 mocsharp

I think what @HofmeisterAn actually mean is https://github.com/dotnet/Docker.DotNet/blob/f58748616cc5b679b25496926c5688294c94d850/src/Docker.DotNet/Models/HostConfig.Generated.cs#L211

hillin avatar May 13 '24 09:05 hillin