Open raldone01 opened 1 year ago
Is this expected to work when using podman-compose? None of the three containers in the above docker-compose.yml seem to work for me, however I can get nVidia support in a container via a plain podman commandline:
$ podman run --rm --device nvidia.com/gpu=all ubuntu nvidia-smi -L
GPU 0: NVIDIA GeForce RTX 2070 (UUID: GPU-336c5a8a-839f-69a8-08cf-e3fdcd01e019)
Interesting. for me the runtime_test is working.
Thing is I had the understanding that podman-docker
should be a fully compatible emulation so I consider this an issue.
Since nvidia.com/gpu
cdi driver is supported the docker gpu api should be mapped to the podman cdi api in podman-docker
.
Got it working with this:
version: '3.8'
services:
nvidia_test:
image: ubuntu
devices:
- nvidia.com/gpu=all
command:
- bash
- -c
- |
nvidia-smi -L
For me, none of these docker-compose.yml
approaches works, however I can get nVidia support in a container via a plain podman commandline.
nvidia_test: image: ubuntu devices:
- nvidia.com/gpu=all command:
- bash
- -c
- | nvidia-smi -L
When I try this I get the following: Error response from daemon: container create: stat nvidia.com/gpu=all: no such file or directory
What version of podman are you running? Do you have any special configuration active?
A friendly reminder that this issue had no activity for 30 days.
@raldone01 if you could point me at the code for podman-compose
, I could try to see what additions are required to add CDI support there. I would assume that this would need similar extensions to those made to the --device
command line argument. Your error message indicates that the entries in devices:
are being interpreted as device nodes.
Note that Docker does not yet support CDI devices and these will only be available in Docker 25. In addition, the mechanism to request these device in the compose YAML do not match your expectations.
if you could point me at the code for
podman-compose
, I could try to see what additions are required to add CDI support there.
What do you want me to point you at? The code for the podman-compose
implementation and its argument parser? I myself am not familiar with the code base. I could clone the repo and do some searches for you but I am not sure what code you are referring to. Please clarify.
Note that Docker does not yet support CDI devices and these will only be available in Docker 25. In addition, the mechanism to request these device in the compose YAML do not match your expectations.
Can you show me the correct yaml format? If possible please link me to documentation outlining the correct planned yaml format. I tried to search for it and found lots of conflicting information.
Note that Docker does not yet support CDI devices and these will only be available in Docker 25.
I know and mentioned it in the issue description.
Can confirm too that none of the services presented in the OP work for me @raldone01 did you configure the container runtime using the docker instructions? The NVIDIA CTK guide says that CDI is recommended for podman
I configured the runtime using sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml --device-name-strategy=uuid
. Afterwards podman containers with sudo podman run -ti --rm --device=nvidia.com/gpu=all ubuntu:18.04 nvidia-smi -L
worked. I am pretty sure this uses cdi.
I will look into the link you sent on Friday.
@raldone01 okay but that is using podman only, right? normal podman commands seem to work fine with CDI, but how did you manage to make docker-compose work using CDI?
Yes this is using podman commands directly. This issue is exactly about cdi not working with podman-compose. Maybe this wasn't clear. I was not able to get cdi to work with podman-compose.
Cdi works fine with podman directly. Nvidia Runtime (legacy) works with podman-compose but will be or is deprecated.
If anyone has a working podman/docker-compose yml with cdi please share it. As far as I know it is not supported.
@raldone01 sorry I got confused by my own post. I am curious how you got the runtime_test
part working. I do have the runtime installed and configured (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuring-docker) but I just get nvidia-smi command not found
Aight, just to follow up on this issue, I added the nvidia runtime to the podman (containers) configuration and set it as the default:
$cat /usr/share/containers/containers.conf
runtime = "nvidia"
...
[engine.runtimes]
...
nvidia = [
"/usr/bin/nvidia-container-runtime",
]
So this works:
$ podman --log-level DEBUG system service -t0
...
Using OCI runtime "/usr/bin/nvidia-container-runtime"
...
This works, too:
$ podman run --rm --security-opt=label=disable nvidia/cuda:12.2.0-runtime-ubuntu22.04 nvidia-smi -L
...
GPU 0: NVIDIA RTX A5000 (UUID: GPU-82e4260a-3604-4c94-4abf-3ecccd9b28f8)
But tried running the runtime_test
service from the OP and still get:
$ docker-compose up runtime_test
...
/opt/nvidia/nvidia_entrypoint.sh: line 67: exec: nvidia-smi: not found
podman info
reports using the nvidia runtime:
...
ociRuntime:
name: nvidia
package: nvidia-container-toolkit-base-1.14.2-1.x86_64
path: /usr/bin/nvidia-container-runtime
version: |-
NVIDIA Container Runtime version 1.14.2
commit: 807c87e057e13fbd559369b8fd722cc7a6f4e5bb
spec: 1.1.0-rc.2
runc version 1.1.8
commit: v1.1.8-0-g82f18fe
spec: 1.0.2-dev
go: go1.19.11
libseccomp: 2.5.3
...
As far as I can tell all options in /usr/share/containers/containers.conf
are commented out and I can't remember changing it.
I will try to get a reproduce script working using distrobox or something like that.
My default ociRuntime
in podman info
is crun
.
I just verified docker is not even installed on the machine.
I am using Docker Compose version 2.20.3
.
Does sudo docker run --rm -e NVIDIA_VISIBLE_DEVICES=all ubuntu nvidia-smi -L
work for you?
❯ sudo docker run --rm -e NVIDIA_VISIBLE_DEVICES=all ubuntu nvidia-smi -L
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
GPU 0: NVIDIA T600 (UUID: GPU-STUFF)
GPU 1: NVIDIA GeForce GTX 1080 (UUID: GPU-STUFF)
Without env:
❯ sudo docker run --rm ubuntu nvidia-smi -L
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: crun: executable file `nvidia-smi` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
The command you provided does not work on my machine as I use crun
as the default runtime for podman.
❯ sudo podman run --rm --security-opt=label=disable ubuntu nvidia-smi -L
Error: crun: executable file `nvidia-smi` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
Try to do the following (pulled from my command history):
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml --device-name-strategy=uuid
sudo nvidia-ctk runtime configure --runtime=podman
sudo nano /etc/nvidia-container-runtime/config.toml
no-cgroups = false
runtimes = [
"docker-runc",
"runc",
"crun"
]
I think the culprit might be that I'm not using compose v2. I was able to get this working, however, by using podman-compose
and passing run args to the call:
podman-compose --podman-run-args '--device nvidia.com/gpu=all --security-opt=label=disable' run --rm runtime_test
And this works too:
podman-compose --podman-run-args '--device nvidia.com/gpu=all --security-opt=label=disable' up runtime_test
This works like a charm:
$ podman-compose run --rm runtime_test
version: "3.8"
services:
runtime_test: # this is working
image: nvidia/cuda:12.2.0-runtime-ubuntu22.04
devices:
- nvidia.com/gpu=all
security_opt:
- "label=disable"
command: nvidia-smi -L
Can we close this issue now, since there is a workaround, or is there still something Podman needs to fix?
@rhatdan I think the original issue remains: device reservations is broken using podman-docker and it works using normal docker
Does it work with rootful podman? Is this more a case of rootless versus rootful?
I got a bit of new information. I'm currently reworking the issue. I will provide a reproducible Distrobox script to better test the issue. I have not tried it with rootless yet. The issue still exists. Should I update the issue itself or add a new comment.
Edit: You can track my progress here: https://github.com/raldone01/podman-docker-gpu-issue.git Distrobox was not the right tool for the job. The reproduce script will be using lxd and qemu.
Add a new comment.
I am experiencing the same issue here, using the standalone docker-compose
2.23.0. I can do sudo podman run -ti --rm --device=nvidia.com/gpu=all ubuntu:18.04 nvidia-smi -L
successfully, but none of the above flavors of compose file work.
Hi, is the some option for enable gpu using podman-compose.yml? regards
I am still experiencing this issue.
Hello,
Here is the current behavior I am experiencing:
❯ podman version
Client: Podman Engine
Version: 4.9.3
API Version: 4.9.3
Go Version: go1.21.7
Built: Tue Jan 1 01:00:00 1980
OS/Arch: linux/amd64
❯ podman compose version
>>>> Executing external compose provider "/home/del/.nix-profile/bin/docker-compose". Please refer to the documentation for details. <<<<
Docker Compose version 2.24.6
❯ podman run --rm --device nvidia.com/gpu=all -it docker.io/library/ubuntu nvidia-smi
Fri Mar 8 15:28:56 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.14 Driver Version: 550.54.14 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA RTX A500 Laptop GPU Off | 00000000:01:00.0 Off | N/A |
| N/A 37C P8 4W / 30W | 232MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
+-----------------------------------------------------------------------------------------+
❯ podman compose run testgpu
>>>> Executing external compose provider "/home/del/.nix-profile/bin/docker-compose". Please refer to the documentation for details. <<<<
unable to upgrade to tcp, received 409
Error: executing /home/del/.nix-profile/bin/docker-compose run testgpu: exit status 1
❯ podman run --rm -it docker.io/library/ubuntu nvidia-smi
Error: crun: executable file `nvidia-smi` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
Here is the compose file used:
services:
testgpu:
image: docker.io/library/ubuntu
command: nvidia-smi
deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia.com/gpu=all
Is this related to this issue or is it another issue ?
@gautaz what docker compose does is map the devices
section in the compose file to HostConfig modifications (specifically DeviceRequest
entries) that are interpreted by the Docker daemon. I am not sure how this interacts with Podman.
If someone could point me at the execution path from running podman-compose
-- and how Podman is invoked -- we can identify where support for the cdi
driver needs to be added.
Maybe related to my problem: I am trying to use the Docker API to create a container on a remote podman server with GPU support. With docker this can be done with device requests, but this comment https://github.com/containers/podman/pull/21180#issuecomment-1927171385 suggests that podman is not handling data via device_requests.. How would I use the docker api to enable gpu support in podman?
Have you tried with podman 5.0, some fixes whent in to handle GPUs from remote API.
@elezar @laurensV The way docker-compose/podman-compose are supposed to communicate with podman is in fact also unclear to me. As @elezar pointed out, docker-compose communicates with docker through the daemon API but, in my particular case, I am using podman in its original rootless design, which means, AFAIU, no daemon, no API access through a socket.
@rhatdan I guess your question was for @laurensV. In the meantime, I have also tried podman 5 but I am hitting other difficulties that I need to fully understand. These difficulties are related to the fact that since version 5, podman uses pasta for its network layer and not slirp4netns anymore. The fact that the Linux distribution I am using (NixOS) does not support pasta adds another layer of difficulties (this seems to be a work in progress though).
Any news on this? Podman 5.x.x on Ubuntu is for now unusable / too-unstable as @gautaz mentioned.
So back to using Podman 4.9.3, I did a few experiments using a docker-compose.yml
, all with the common body:
services:
issue-19338:
image: ubuntu
entrypoint: /bin/bash -c "ls /dev/ | grep nvidia"
where ls /dev/ | grep nvidia
shows nvidia devices if the passthrough is successful.
CDI definitions are generated using sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
.
The tries and results are in the following table:
Compose program | YML setting | NVIDIA devices passthrough? |
---|---|---|
podman-compose |
devices block |
Success |
podman-compose |
deploy block with nvidia driver |
Fail |
podman-compose |
deploy block with cdi driver |
Fail |
compose |
devices block |
Fail: container won't start Error response from daemon: container create: stat nvidia.com/gpu=0: no such file or directory |
compose |
devices block + privileged: true |
Fail |
compose |
deploy block with nvidia driver |
Fail |
compose |
deploy block with cdi driver |
Fail |
For more details:
the deploy
block is:
deploy:
resources:
reservations:
devices:
- driver: nvidia # nvidia or cdi
device_ids: ['nvidia.com/gpu=0']
capabilities: [gpu]
the devices
block is:
devices:
- nvidia.com/gpu=0
Conclusions:
devices
block from the podman run API, but not through the Podman socket.deploy
block does not work at all, maybe it's just fully missing from Podman.Hello,
A little follow-up since podman 5 has reached unstable:
❯ podman version
Client: Podman Engine
Version: 5.0.2
API Version: 5.0.2
Go Version: go1.22.2
Built: Tue Jan 1 01:00:00 1980
OS/Arch: linux/amd64
❯ docker compose version
>>>> Executing external compose provider "/home/del/.nix-profile/bin/docker-compose". Please refer to the documentation for details. <<<<
Docker Compose version 2.26.1
❯ ls /dev | grep nvidia
nvidia0
nvidia-caps
nvidiactl
nvidia-modeset
nvidia-uvm
nvidia-uvm-tools
❯ podman run --rm --device nvidia.com/gpu=all ubuntu ls /dev | grep nvidia
nvidia-modeset
nvidia-uvm
nvidia-uvm-tools
nvidia0
nvidiactl
❯ cat compose.yaml
services:
testgpu:
image: ubuntu
command: sh -c "ls /dev | grep nvidia"
deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia.com/gpu=all
❯ docker compose up
>>>> Executing external compose provider "/home/del/.nix-profile/bin/docker-compose". Please refer to the documentation for details. <<<<
[+] Running 1/0
✔ Container test-testgpu-1 Created 0.0s
Attaching to testgpu-1
testgpu-1 exited with code 1
So still no access to the GPU with compose/podman through CDI.
This test was run inside a Slurm cluster with podman support. There will be differences from an on-premises server, but hopefully this will help.
hyunseoki@Master:~/projects/calc-pi$ srun --pty --gpus 2 bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
hyunseoki@gpu2:~/projects/calc-pi$ docker version
Client: Podman Engine
Version: 4.6.2
API Version: 4.6.2
Go Version: go1.18.1
Built: Thu Jan 1 09:00:00 1970
OS/Arch: linux/amd64
hyunseoki@gpu2:~/projects/calc-pi$ docker-compose version
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.6.2
podman-compose version 1.0.6
podman --version
podman version 4.6.2
exit code: 0
hyunseoki@gpu2:~/projects/calc-pi$ nvidia-smi -L
GPU 0: NVIDIA GeForce GTX 1080 Ti (UUID: GPU-55585a22-a409-88ad-4376-c3b613036a7d)
GPU 1: NVIDIA GeForce GTX 1080 Ti (UUID: GPU-b18e6aa7-83f0-0ae4-2bb1-0f3050e0e160)
hyunseoki@gpu2:~/projects/calc-pi$ docker run -it --rm --device nvidia.com/gpu=all python nvidia-smi -L
GPU 0: NVIDIA GeForce GTX 1080 Ti (UUID: GPU-55585a22-a409-88ad-4376-c3b613036a7d)
GPU 1: NVIDIA GeForce GTX 1080 Ti (UUID: GPU-b18e6aa7-83f0-0ae4-2bb1-0f3050e0e160)
hyunseoki@gpu2:~/projects/calc-pi$ cat /etc/containers/pre-exec-hooks/000_nvidia_cdi.sh
#!/bin/bash
if [ -e /usr/bin/nvidia-ctk ]; then
if [ -e /var/run/cdi/nvidia.yaml ]; then
sleep $(( (RANDOM % 6) + 2 ))
nvidia-ctk cdi generate --output=/var/run/cdi/nvidia.yaml > /dev/null 2>&1
else
nvidia-ctk cdi generate --output=/var/run/cdi/nvidia.yaml > /dev/null 2>&1
fi
fi
exit 0
hyunseoki@gpu2:~/projects/calc-pi$ cat docker-compose.yml
services:
vscode:
image: docker.io/python
# build:
# dockerfile: vscode.Dockerfile
tty: true
stdin_open: true
shm_size: 1TB
ports:
- $FORWARD_PORT:8888
devices:
- nvidia.com/gpu=all
volumes:
- $PWD:/workspace
environment:
- SLURMD_NODENAME=$SLURMD_NODENAME
- PASSWORD=1
- SUBDOMAIN=$USER
- FORWARD_PORT=$FORWARD_PORT
command: nvidia-smi -L
hyunseoki@gpu2:~/projects/calc-pi$ docker-compose up
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.6.2
** excluding: set()
['podman', 'ps', '--filter', 'label=io.podman.compose.project=calc-pi', '-a', '--format', '{{ index .Labels "io.podman.compose.config-hash"}}']
recreating: ...
** excluding: set()
podman stop -t 10 calc-pi_vscode_1
calc-pi_vscode_1
exit code: 0
podman rm calc-pi_vscode_1
calc-pi_vscode_1
exit code: 0
recreating: done
['podman', 'network', 'exists', 'calc-pi_default']
podman create --name=calc-pi_vscode_1 --label io.podman.compose.config-hash=a7dda14fa6087ec8f2e0557b2bae6ed958ed5468c68034ee6c61d734c7b3e456 --label io.podman.compose.project=calc-pi --label io.podman.compose.version=1.0.6 --label PODMAN_SYSTEMD_UNIT=podman-compose@calc-pi.service --label com.docker.compose.project=calc-pi --label com.docker.compose.project.working_dir=/home/hyunseoki/projects/calc-pi --label com.docker.compose.project.config_files=docker-compose.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=vscode --device nvidia.com/gpu=all -e SLURMD_NODENAME=gpu2 -e PASSWORD=1 -e SUBDOMAIN=hyunseoki -e FORWARD_PORT=20580 -v /home/hyunseoki/projects/calc-pi:/workspace --net calc-pi_default --network-alias vscode -p 20580:8888 --shm-size 1TB -i --tty docker.io/python nvidia-smi -L
7ab542be0eb79b26afd526a70955c7ae34b08d74c878b816ac73813d6bdf35d0
exit code: 0
podman start -a calc-pi_vscode_1
[vscode] | GPU 0: NVIDIA GeForce GTX 1080 Ti (UUID: GPU-55585a22-a409-88ad-4376-c3b613036a7d)
[vscode] | GPU 1: NVIDIA GeForce GTX 1080 Ti (UUID: GPU-b18e6aa7-83f0-0ae4-2bb1-0f3050e0e160)
exit code: 0
What is the TL;DR ?
is it that we cannot use docker-compose
as the external compose provider for podman? (given that we need gpu support)
is there a chance that this will be fixed in the near future?
Podman does not implement the client side of compose on the server side, so it requires either docker-compose or podman-compose (a separate repository) to process the compose syntax and generate podman containers.
Podman does not implement the client side of compose on the server side, so it requires either docker-compose or podman-compose (a separate repository) to process the compose syntax and generate podman containers.
Snooping on the socket connection /run/user/3938/podman/podman.sock
using socat
, I find that docker-compose
makes the following API calls to the podman system service
API server, and I think it might be possible to handle this correctly at the podman API server.
docker-compose
+ deploy block makes the following API call:
POST /v1.41/containers/create?name=bec3219e5b3c_test-issue-19338-1 HTTP/1.1\r
Host: api.moby.localhost\r
User-Agent: compose/v2.29.1\r
Content-Length: 2561\r
Content-Type: application/json\r
Traceparent: 00-c8dbdddd2c5213fa9dd03ea2aab22239-187626433197f294-01\r
\r
{
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": null,
"Cmd": [
"nvidia-smi"
],
"Image": "ubuntu",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "13075ac5dc2afadcb2de1ca22e075f593c12b185d6d3b45537d101aa4b1f704d",
"com.docker.compose.container-number": "1",
"com.docker.compose.depends_on": "",
"com.docker.compose.image": "sha256:35a88802559dd2077e584394471ddaa1a2c5bfd16893b829ea57619301eb3908",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "test",
"com.docker.compose.project.config_files": "/home/groberts/dev/docker/test/docker-compose.yml",
"com.docker.compose.project.working_dir": "/home/groberts/dev/docker/test",
"com.docker.compose.replace": "bec3219e5b3c9b30f4481133bea1cc66e3d3708673b96c0bb0314d78b4eda300",
"com.docker.compose.service": "issue-19338",
"com.docker.compose.version": "2.29.1"
},
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "",
"Config": null
},
"NetworkMode": "test_default",
"PortBindings": {},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": [],
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 0,
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DeviceRequests": [
{
"Driver": "",
"Count": 1,
"DeviceIDs": null,
"Capabilities": [
[
"gpu"
]
],
"Options": null
}
],
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": null,
"ReadonlyPaths": null
},
"NetworkingConfig": {
"EndpointsConfig": {
"test_default": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"test-issue-19338-1",
"issue-19338"
],
"MacAddress": "",
"DriverOpts": null,
"NetworkID": "",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DNSNames": null
}
}
}
}
docker-compose
+ device block API call:
POST /v1.41/containers/create?name=bec3219e5b3c_test-issue-19338-1 HTTP/1.1\r
Host: api.moby.localhost\r
User-Agent: compose/v2.29.1\r
Content-Length: 2577\r
Content-Type: application/json\r
Traceparent: 00-120dd633fb2e5a2bb1db95db85751ec3-18aadb2ff5c0b9ec-01\r
\r
{
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": null,
"Cmd": [
"nvidia-smi"
],
"Image": "ubuntu",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "4a70b70543a273e8ee7f45bf50783bcd3aece1f5ae5bbfba74f61d41f5bcc59b",
"com.docker.compose.container-number": "1",
"com.docker.compose.depends_on": "",
"com.docker.compose.image": "sha256:35a88802559dd2077e584394471ddaa1a2c5bfd16893b829ea57619301eb3908",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "test",
"com.docker.compose.project.config_files": "/home/groberts/dev/docker/test/docker-compose.yml",
"com.docker.compose.project.working_dir": "/home/groberts/dev/docker/test",
"com.docker.compose.replace": "bec3219e5b3c9b30f4481133bea1cc66e3d3708673b96c0bb0314d78b4eda300",
"com.docker.compose.service": "issue-19338",
"com.docker.compose.version": "2.29.1"
},
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "",
"Config": null
},
"NetworkMode": "test_default",
"PortBindings": {},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": [],
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 0,
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [
{
"PathOnHost": "nvidia.com/gpu=0",
"PathInContainer": "nvidia.com/gpu=0",
"CgroupPermissions": "rwm"
}
],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": null,
"ReadonlyPaths": null
},
"NetworkingConfig": {
"EndpointsConfig": {
"test_default": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"test-issue-19338-1",
"issue-19338"
],
"MacAddress": "",
"DriverOpts": null,
"NetworkID": "",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DNSNames": null
}
}
}
}
Full request/response trace captures:
Issue Description
May be related to https://github.com/containers/podman/issues/19330. See also https://github.com/NVIDIA/nvidia-container-toolkit/issues/126.
CC @elezar
CDI Support in Docker will be an experimental feature in the Docker 25 release.
It will support the following
docker-compose.yml
file:Steps to reproduce the issue
Steps to reproduce:
Prerequisites:
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml --device-name-strategy=uuid
podman-docker-emulation-daemon
Observe the following
docker-compose.yml
:Launch via
docker-compose up
.Describe the results you received
Only the runtime container works.
Describe the results you expected
All three containers should show the same output.
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response