You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using CreateContainer function to run a docker container. I need to pass the --gpu argument in order to enable GPU support: docker run --gpus all ...
How can I pass the --gpus option programmatically? Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hmm to be honest I'm not totally sure. I think gpus are represented as device requests in the Docker API? Meaning you'd need to set DeviceRequests in your HostConfig. Something like (untested):
hostConfig:=HostConfig{
// other attributesDeviceRequests: []DeviceRequest{
{
Count: 1,
Capabilities: [][]string{{"gpu"}},
},
},
// other attributes
}
// use hostConfig to create/start the container
(you can also set Count to -1 to make all gpus available)
We're using CreateContainer function to run a docker container. I need to pass the --gpu argument in order to enable GPU support:
docker run --gpus all ...
How can I pass the --gpus option programmatically? Thanks in advance!
The text was updated successfully, but these errors were encountered: