Skip to content

Switch cudarc to dynamic-loading, expose CPU k-means path - #5

Merged
raphaelsty merged 1 commit into
masterfrom
fix/cuda-dynamic-loading
Mar 18, 2026
Merged

raphaelsty merged 1 commit into
masterfrom
fix/cuda-dynamic-loading

Conversation

@raphaelsty

Copy link
Copy Markdown
Contributor

Summary

  • Switch cudarc from dynamic-linking to dynamic-loading so CUDA libraries are loaded at runtime via dlopen instead of being required at link time. This prevents panics on systems with stub/incomplete CUDA installations.
  • Make the algorithm module public and re-export kmeans_double_chunked so downstream crates can call the CPU k-means path directly when they need to bypass CUDA after detecting a broken environment.

Test plan

  • Verify compilation with cargo check --features cuda
  • Verify CUDA k-means still works on a system with proper CUDA drivers
  • Verify graceful behavior on systems with stub CUDA libraries (no link-time failure)

🤖 Generated with Claude Code

…rithm module

Use dynamic-loading instead of dynamic-linking so cudarc loads CUDA
libraries at runtime via dlopen rather than requiring them at link time.
This prevents panics on systems with stub/incomplete CUDA libraries and
allows graceful fallback to CPU.

Also expose the `algorithm` module and `kmeans_double_chunked` so
downstream crates can call the CPU k-means path directly when they need
to bypass CUDA (e.g., after detecting a broken CUDA environment).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@raphaelsty
raphaelsty merged commit 6a11a9e into master Mar 18, 2026
10 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