Skip to content

fix: add Podman support with NVIDIA CDI GPU passthrough#10

Open
mariojcr wants to merge 2 commits intoachetronic:masterfrom
mariojcr:fix/podman-nvidia-support
Open

fix: add Podman support with NVIDIA CDI GPU passthrough#10
mariojcr wants to merge 2 commits intoachetronic:masterfrom
mariojcr:fix/podman-nvidia-support

Conversation

@mariojcr
Copy link
Contributor

Problem

The project assumes Docker as the only container engine. Podman users hit two issues:

  1. GPU passthrough fails — The deploy.resources.reservations.devices syntax is Docker-specific. Podman uses CDI (Container Device Interface) instead.
  2. Image pulls hang or fail — Short image names like redis:alpine or ollama/ollama trigger Podman's interactive registry prompt (or fail in non-interactive mode), since Podman doesn't default to docker.io.

Changes

docker-compose.yaml

  • Document both GPU options: Docker (deploy block) and Podman (devices: nvidia.com/gpu=all)
  • Fully qualify all Docker Hub images with docker.io/ prefix

scripts/install.sh

  • Auto-detect Podman or Docker at install time
  • Handle podman compose and podman-compose as compose backends
  • Validate NVIDIA GPU via CDI specs when running under Podman
  • Generate the correct GPU syntax in the compose file based on the detected engine
  • Fully qualify all Docker Hub image references

Makefile

  • Add CONTAINER_ENGINE variable (auto-detects podman, falls back to docker)
  • Fully qualify image references

Notes

  • No behavioral change for Docker users — all defaults remain the same
  • Podman GPU requires the NVIDIA Container Toolkit with CDI specs generated:
    sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
    

- docker-compose.yaml: document both Docker (deploy block) and Podman
  (CDI devices) GPU options; use fully-qualified docker.io/ registry
  for all Docker Hub images to avoid Podman registry ambiguity

- install.sh: detect Podman or Docker automatically; handle
  podman compose / podman-compose; check CDI specs for Podman GPU
  detection; generate correct compose GPU syntax per engine;
  qualify all image references with docker.io/

- Makefile: add CONTAINER_ENGINE variable that auto-detects podman
  or falls back to docker; qualify image references with docker.io/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant