Skip to content

build: link CUDA plugins against the libcuda stub when no driver is installed - #249

Merged
xji3 merged 1 commit into
beagle-dev:masterfrom
ji-group:fix-cuda-stub-link
Oct 30, 2026
Merged

xji3 merged 1 commit into
beagle-dev:masterfrom
ji-group:fix-cuda-stub-link

Conversation

@xji3

@xji3 xji3 commented Oct 30, 2026

Copy link
Copy Markdown
Member

Problem

The CI BIT workflow has failed on master since 2026-09-16. It last passed on 2026-08-22. Linking hmsbeagle-cuda fails with:

/usr/bin/ld: cannot find -lcuda: No such file or directory

Up to CUDA 13.3, apt-get install cuda also installed the NVIDIA driver (nvidia-driver-open and libnvidia-compute), which provides libcuda.so. The CUDA 13.4 cuda package no longer pulls in the driver, so the GitHub runner, which has no GPU, has no libcuda.so to link against.

Fix

Add ${CUDA_TOOLKIT_ROOT_DIR}/lib64/stubs to link_directories in GPU/CMake_CUDA and GPU/CMake_TensorCores. The cuda-driver-dev package, which the toolkit still installs, ships a stub libcuda.so there. This is NVIDIA's documented way to build without a driver. The stub's SONAME is libcuda.so.1, so the real driver is still the one loaded at runtime.

Testing

On the ji-group fork, the same commit on master passes both CI and CI BIT, and the CUDA plugin links: https://github.com/ji-group/beagle-lib/actions/runs/40994635657

🤖 Generated with Claude Code

…nstalled

Since CUDA 13.4 the `cuda` apt metapackage no longer pulls in the NVIDIA
driver, so the CI BIT runner has no libcuda.so and linking hmsbeagle-cuda
fails with "cannot find -lcuda". Add the toolkit's lib64/stubs directory
(shipped by cuda-driver-dev) to the link path. The stub's SONAME is
libcuda.so.1, so the real driver is still loaded at runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xji3
xji3 merged commit 056f565 into beagle-dev:master Oct 30, 2026
3 checks passed
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