-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device requests are not respected via API #22645
Comments
Any chance you can get us the JSON being sent by the container create request (the first |
Sure. the python code client.containers.run('registry.access.redhat.com/ubi9:9.4-947.1714667021', ['nvidia-smi', '-L'], device_requests=[ docker.types.DeviceRequest(count=1, capabilities=[['gpu']]) ]) sends this JSON to the socket: {
"Hostname": null,
"Domainname": null,
"ExposedPorts": null,
"User": null,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Env": null,
"Cmd": [
"nvidia-smi",
"-L"
],
"Image": "registry.access.redhat.com/ubi9:9.4-947.1714667021",
"Volumes": null,
"NetworkDisabled": false,
"Entrypoint": null,
"WorkingDir": null,
"HostConfig": {
"NetworkMode": "default",
"DeviceRequests": [
{
"Driver": "",
"Count": 1,
"DeviceIDs": [],
"Capabilities": [
[
"gpu"
]
],
"Options": {}
}
]
},
"NetworkingConfig": null,
"MacAddress": null,
"Labels": null,
"StopSignal": null,
"Healthcheck": null,
"StopTimeout": null,
"Runtime": null
} |
@jennydaman does the following help ? https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-podman , basically using nvidia-container-toolkit |
@rrbanda that is unrelated to this issue. Podman implements the Docker API in an attempt to be compatible with Docker. This issue is about the |
Issue Description
"Device requests" are how GPUs are invoked from the Docker API. However, device requests are not being respected by Podman when creating a container over the Podman socket.
Steps to reproduce the issue
Here is a Python script which tests the Docker and Podman socket APIs.
Setup: install Python version 3.10+ and run
pip install docker==7.0.0
Run these tests:
Describe the results you received
.HostConfig.DeviceRequests
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional information
No response
The text was updated successfully, but these errors were encountered: