Skip to content

nvidia

Recipe card from the charly-distros plugin (Images — the deployable catalog).

The NVIDIA GPU driver-runtime layer — the distro package arms for the driver user-space (nvidia-utils / nvidia-driver), the CDI generation wiring (nvidia-ctk, the Vulkan ICD) and the nvidia-smi a host needs.

A pod never composes this layer. A pod takes the driver from the host through CDI: the pod base is podcdi.pod-cdi, which composes layer-cdi (the contract) and, today, the CUDA toolkit. This layer is for a HOST image (nvidia-cdi-host) and a passthrough VM, where the guest bakes the driver because no CDI injection exists there. The Fedora GPU boxes were dropped (opencharly/opencharly#1287); the GPU workload images are CachyOS-only.

Property Value
Package arms Fedora rpm (nvidia-driver* repo) + Arch pac (nvidia-utils)
Consumers nvidia-cdi-host (host image), a passthrough VM box
Never composed by a pod — it uses podcdi.pod-cdi and CDI injection
  1. nvidia — GPU runtime: the driver user-space packages, nvidia-container-toolkit (CDI), the Vulkan ICD, VA-API
  2. cuda — CUDA toolkit, cuDNN, onnxruntime, ffmpeg-libs (composed beside it, not required by it)
  • nvidia-cdi-host (opencharly/layer-nvidia) — a HOST image: the containerd handler, the durable nvidia-cdi-refresh units and the rootless spec link (see CDI host layer below).
  • a passthrough VM box — bakes the driver because the guest has no CDI injection.

nvidia-cdi-host extends nvidia for a host (not a workload image). It composes the nvidia candy and then:

  • runs nvidia-ctk runtime configure --runtime=containerd with an explicit, layer-owned --drop-in-config /etc/containerd/conf.d/99-nvidia.toml, without --enable-cdi (CDI is always on in containerd 2.x and the key is ignored with a warning) and without --set-as-default (the handler is selected per pod or container). The command also records the drop-in directory in config.toml’s imports, and the layer fails closed if the drop-in or the import does not land;
  • restarts containerd after writing the drop-in. containerd reads its config and drop-ins at startup, so a written drop-in is not a live handler; measured on the GPU host, a drop-in naming nvidia sat beside a running daemon that listed only crun;
  • enables and starts the toolkit’s nvidia-cdi-refresh.path and .service, so /var/run/cdi/nvidia.yaml is regenerated at boot, on nvidia module load and when the toolkit changes, and exists on a fresh host before the checks run. A one-shot nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml is a snapshot: the driver version appears ~115x in the generated spec and goes stale on the first driver upgrade;
  • links the refreshed spec into the rootless client’s config dir. The rootless spec dirs are $XDG_CONFIG_HOME/cdi and $XDG_RUNTIME_DIR/cdi, never /etc/cdi; the link helper resolves the user’s XDG_CONFIG_HOME from their login environment (default ~/.config) and targets nvidia.yaml -> /var/run/cdi/nvidia.yaml. For a user that does not exist at build time, a user-tmpfiles.d rule creates the client-default %h/.config/cdi/nvidia.yaml at first login — systemd-tmpfiles has no XDG_CONFIG_HOME specifier, which is the rule’s documented limitation.

Verify the device, never an exit code: nvidia-ctk cdi list exits 0 on an invalid spec (Found 0 CDI devices), and two same-priority specs leave the device dropped. The layer’s checks require crictl info to serve the nvidia handler, nvidia-ctk cdi list to report nvidia.com/gpu=all, and --device nvidia.com/gpu=all to run nvidia-smi -L. The check-nvidia-cdi-host bed carries the same sequence rootful and rootless, and skips visibly with prereq-gpu-skipped on a host without the GPU. Its data-producing steps were executed individually against scratch daemons on an RTX 4080 SUPER host; a full charly check run on a disposable GPU host is the remaining gate and is not yet recorded.

Arch/omarchy only: a Fedora arm is additive and is not claimed until its own disposable bed exists.

After charly box build:

  • charly shell nvidia -c "nvidia-smi" — GPU info
  • charly shell nvidia -c "nvidia-ctk --version" — CDI toolkit
  • charly shell nvidia -c "nvcc --version" — CUDA compiler

MUST be invoked when the task involves the nvidia box, GPU base images, CUDA in containers, or CDI device configuration. Invoke this skill BEFORE reading source code or launching Explore agents.

  • /charly-image:image — image family umbrella (candy: image entries — those carrying base:/from: — in charly.yml, build/validate/inspect/list)
  • /charly-build:build — the embedded build vocabulary (distros, builders, init-systems)