Skip to content

Runtime CUDA library discovery ignores CUDA_TOOLKIT_PATH #93

Closed

Description

@yagna-1

Summary

libnvvm-sys and nvjitlink-sys ignore CUDA_TOOLKIT_PATH when discovering CUDA runtime libraries, even though the project build path and CI use CUDA_TOOLKIT_PATH.

Problem

A user can build CUDA bindings against CUDA_TOOLKIT_PATH, but runtime discovery for libNVVM and nvJitLink still searches only:

  • CUDA_HOME
  • CUDA_PATH
  • /usr/local/cuda
  • /opt/cuda

This makes cargo oxide doctor and LTOIR/libdevice-related workflows fail even when the CUDA Toolkit root is correctly supplied via the project-supported environment variable.

Expected

Runtime discovery should include CUDA_TOOLKIT_PATH, preferably before CUDA_HOME and CUDA_PATH, matching the build script and CI behavior.

Proposed fix

Update both sys crates to search CUDA roots in this order:

  1. CUDA_TOOLKIT_PATH
  2. CUDA_HOME
  3. CUDA_PATH
  4. /usr/local/cuda
  5. /opt/cuda

Activity

  1. added
    bug
    build-related
    on Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbuild-related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions