Skip to content

Runtime CUDA library discovery ignores CUDA_TOOLKIT_PATH #93

@yagna-1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions