Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
28 lines
771 B
Bash
28 lines
771 B
Bash
# shellcheck shell=bash
|
|
# Patch all dynamically linked, ELF files with the CUDA driver (libcuda.so)
|
|
# coming from the cuda_compat package by adding it to the RUNPATH.
|
|
echo "Sourcing auto-add-cuda-compat-runpath-hook"
|
|
|
|
addCudaCompatRunpath() {
|
|
local libPath
|
|
local origRpath
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
echo "addCudaCompatRunpath: no library path provided" >&2
|
|
exit 1
|
|
elif [[ $# -gt 1 ]]; then
|
|
echo "addCudaCompatRunpath: too many arguments" >&2
|
|
exit 1
|
|
elif [[ "$1" == "" ]]; then
|
|
echo "addCudaCompatRunpath: empty library path" >&2
|
|
exit 1
|
|
else
|
|
libPath="$1"
|
|
fi
|
|
|
|
origRpath="$(patchelf --print-rpath "$libPath")"
|
|
patchelf --set-rpath "@libcudaPath@:$origRpath" "$libPath"
|
|
}
|
|
|
|
postFixupHooks+=("autoFixElfFiles addCudaCompatRunpath")
|