Skip to content

Commit b7173d8

Browse files
committed
runai-model-streamer: provide cuda.h for the 0.17.0 @cuda repository
cpp/WORKSPACE points @cuda at /usr/local/cuda, which the manylinux riscv64 image lacks; stage the driver-API header from the nvidia-cuda-runtime-cu12 wheel (compile-time only, libcuda is dlopen()ed).
1 parent a42b252 commit b7173d8

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎.github/workflows/build-runai-model-streamer.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,22 @@ jobs:
189189
[ -n "$native" ] && ln -sf "$native" "/usr/bin/riscv64-linux-gnu-$tool"
190190
done
191191
192+
# cpp/WORKSPACE (0.17.0+) points the @cuda repository at /usr/local/cuda and
193+
# device/cuda compiles against include/cuda.h (headers only: libcuda.so is
194+
# dlopen()ed at run time and nothing links it). The image has no CUDA toolkit
195+
# and NVIDIA ships none for riscv64, so take the arch-independent driver-API
196+
# header from the nvidia-cuda-runtime-cu12 wheel. Nothing from it is packaged.
197+
/opt/python/cp312-cp312/bin/pip download -q --no-deps --only-binary=:all: \
198+
--platform manylinux2014_x86_64 --python-version 3.12 \
199+
-d /tmp/cudart nvidia-cuda-runtime-cu12==12.9.79
200+
mkdir -p /usr/local/cuda/include
201+
/opt/python/cp312-cp312/bin/python - /tmp/cudart/*.whl <<'PY'
202+
import sys, zipfile
203+
with zipfile.ZipFile(sys.argv[1]) as zf:
204+
with open("/usr/local/cuda/include/cuda.h", "wb") as out:
205+
out.write(zf.read("nvidia/cuda_runtime/include/cuda.h"))
206+
PY
207+
192208
cd cpp
193209
bazel build streamer:libstreamer.so --config=riscv64
194210

0 commit comments

Comments
 (0)