Skip to content

[FEA]: Enhance load_nvidia_dynamic_lib error message if a library cannot be found #851

Open

Description

@ZzEeKkAa

Is this a duplicate?

Area

cuda.pathfinder

Is your feature request related to a problem? Please describe.

load_nvidia_dynamic_lib does great job in looking for packages, runtime error could be confusing for an end user. It would be nice to have user friendly error if library was not found. For example that is how it is done at nvmath-python: https://github.com/NVIDIA/nvmath-python/blob/main/nvmath/_utils.py#L256-L262

Also some helper function (like runtime_nvidia_library_load_error(library_name:str) ) would be nice so user can add custom wrapper around load_nvidia_dynamic_lib.

Describe the solution you'd like

n/a

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. added
    cuda.pathfinderEverything related to the cuda.pathfinder module
    on Aug 18, 2025
  2. changed the title [-][FEA]: Add force_load_nvidia_dynamic_lib[/-] [+][FEA]: Enhance `load_nvidia_dynamic_lib` error message if a library cannot be found[/+] on Aug 18, 2025
  3. rwgk commented on Aug 18, 2025

    @rwgk
    Contributor

    Discussed offline:

    • We want to create a troubleshooting page in the a cuda-pathfinder documentation (that still needs to be added: Add Sphinx docs for cuda.pathfinder #760)
    • Then add a URL pointing to the troubleshooting page from the RuntimeError reporting that the requested library could not be found.

    Mock-up (non-existing URL):

    cuda.pathfinder._dynamic_libs.load_dl_common.DynamicLibNotFoundError: Failure finding "libnotalib.so"
    
    Please see https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/troubleshooting.html for help.
    
    No such file: libnotalib.so*, No such file: /usr/local/cuda-12.9/lib64/libnotalib.so
    ...
    
  4. removed this from the cuda.pathfinder backlog milestone on Apr 2, 2026
  5. aryanputta commented on Jul 4, 2026

    @aryanputta
    Contributor

    I would like to work on this, following the plan in the comment above: a troubleshooting page in the cuda-pathfinder docs, plus the URL appended to the not-found error messages.

    I have this implemented and validated locally (ruff, mypy-pathfinder, and the pathfinder unit tests pass; the new page follows the existing docs layout, so #760 being done unblocks this):

    • New docs/source/troubleshooting.rst: how to read the "Failure finding" message, the search order (wheels, conda, OS loader, CUDA_PATH/CUDA_HOME), common causes and fixes, and how to report an issue. Content is derived from the load_nvidia_dynamic_lib docstring.
    • A small _utils/troubleshooting.py with the URL constant and an append_troubleshooting_url() helper, applied to the raise_not_found sites (dynamic, bitcode, static) and the driver-library message, matching the mock-up format.

    Happy to open the PR if assigned, and to trim the scope to the dynamic-lib error only if that is preferred.

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

    cuda.pathfinderEverything related to the cuda.pathfinder modulefeatureNew feature or request

    Type

    No type

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions