cuda
| Repo | box/github.com/opencharly/layer-cuda:v2026.290.2052 |
CUDA toolkit (nvcc, cudart, cuDNN, onnxruntime) stitched into the canonical /usr layout on Fedora and Arch Installs the CUDA compiler driver (nvcc), the CUDA runtime/dev libraries (cudart, nvrtc, cupti, curand, cccl, cufile), cuDNN, and onnxruntime. On Fedora the RPMs land in /usr directly; on Arch the post-install tasks symlink the /opt/cuda binaries, headers, and libs into the same /usr-rooted paths, so every downstream GPU consumer compiles against one layout regardless of distro. Each artifact is a real file or library on disk, so its presence is directly verifiable.
Acceptance plan
Section titled “Acceptance plan”This candy’s plan: — the runnable spec charly check executes against a live deployment. check: steps are idempotent probes; run: steps change state.
| Intent | Step |
|---|---|
run |
command=if [ ! -f /etc/fedora-release ]; then exit 0 fi CUDNN_DIR=$(mktemp -d) cd “$CUDNN_DIR” if dnf5 download –enable-repo=“fedora-multimedia” cuda-cudnn-devel 2>/dev/null; then rpm2cpio cuda-cudnn-devel*.rpm | cpio -idm 2>/dev/null [ -d ./usr/include ] && cp -v ./usr/include/cudnn*.h /usr/include/ while IFS= read -r -d ‘’ link; do name=$(basename “$link”) versioned=“” for v in /usr/lib64/“${name}”.; do if [ -f “$v” ] && ! echo “$v” | grep -q ‘.so$’; then versioned=“$v”; break fi done [ -n “$versioned” ] && [ ! -e /usr/lib64/“$name” ] && ln -sv “$(basename “$versioned”)” /usr/lib64/“$name” done < <(find ./usr/lib64 -maxdepth 1 -name ‘.so’ -type l -print0 2>/dev/null) fi cd / && rm -rf “$CUDNN_DIR” |
run |
command=if [ ! -f /etc/arch-release ]; then exit 0 fi # nvcc + cuobjdump + ptxas + nvprof — every binary in /opt/cuda/bin for bin in /opt/cuda/bin/; do [ -e “$bin” ] && ln -sf “$bin” /usr/bin/$(basename “$bin”) done # Headers — cudnn.h live in /opt/cuda/targets/x86_64-linux/include # on the cudnn package, while CUDA’s own headers live in # /opt/cuda/include. Symlink both into /usr/include. # Headers — link EVERY ENTRY of each toolkit include root, not a guessed subset. # nvcc computes its default include root RELATIVE to its own executable, and # /usr/bin/nvcc is a symlink, so all CUDA headers must be reachable under # /usr/include. Enumerating by pattern is what broke this: a *.h glob linked the # top-level headers but silently dropped (a) the SUBTREES crt/ and cccl/, which # killed every build at CMake’s enable_language(CUDA) with “crt/host_config.h: No # such file or directory”, and then (b) the .hpp half of the _functions family # (vector_functions.hpp and friends), which killed the very next stage – both # reported on opencharly/layer-cuda#9. Linking every entry needs no extension list # to keep in sync and cannot silently miss a file or a subtree again. # nvcc resolves its OWN helpers relative to its own executable path. Through the # /usr/bin/nvcc symlink that means /usr/*.so* glob. nvcc links the STATIC archives by # default (libcudart_static.a, libcudadevrt.a, libculibos.a, …), and a .so* # pattern cannot match a .a — so the linker failed with “cannot find # -lcudart_static: No such file or directory” although the package ships the file # (opencharly/layer-cuda#12). Same defect shape as the *.h header glob that missed # .hpp: pattern-matching a directory instead of enumerating it. mkdir -p /usr/lib64 for libdir in /opt/cuda/targets/x86_64-linux/lib /opt/cuda/lib64; do [ -d “$libdir” ] || continue for entry in “$libdir”/; do [ -e “$entry” ] || continue ln -sfn “$entry” /usr/lib64/“$(basename “$entry”)” done done |
check |
the nvcc CUDA compiler driver is on the canonical /usr path |
check |
nvcc reports its CUDA compilation-tools release |
check |
the cuDNN header is available at /usr/include regardless of distro |
check |
a CUDA translation unit COMPILES AND LINKS against the stitched /usr layout (Arch: the header subtrees are linked, not only the top-level files) |
check |
the CUDA runtime library is linkable from the canonical /usr/lib64 path |
agent-check |
downstream GPU layers (llama-cpp, vllm, comfyui, jupyter-ml) compile against the same /usr-rooted CUDA layout on both Fedora and Arch |
check |
package=cuda-cudart-devel |
check |
command=ls /usr/include/cudnn.h |
check |
package=onnxruntime |

