Title: Library bindings are not importable if the underlying library is not installed · Issue #951 · NVIDIA/cuda-python · GitHub
Open Graph Title: Library bindings are not importable if the underlying library is not installed · Issue #951 · NVIDIA/cuda-python
X Title: Library bindings are not importable if the underlying library is not installed · Issue #951 · NVIDIA/cuda-python
Description: During the investigation of #920 I noticed that if I remove nvJitLink from my current environment, cuda.core cannot fall back to use the cuLink* driver APIs because the pathfinder error is not caught: Traceback (most recent call last): F...
Open Graph Description: During the investigation of #920 I noticed that if I remove nvJitLink from my current environment, cuda.core cannot fall back to use the cuLink* driver APIs because the pathfinder error is not caug...
X Description: During the investigation of #920 I noticed that if I remove nvJitLink from my current environment, cuda.core cannot fall back to use the cuLink* driver APIs because the pathfinder error is not caug...
Opengraph URL: https://github.com/NVIDIA/cuda-python/issues/951
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Library bindings are not importable if the underlying library is not installed","articleBody":"During the investigation of #920 I noticed that if I remove nvJitLink from my current environment, `cuda.core` cannot fall back to use the `cuLink*` driver APIs because the pathfinder error is not caught:\n```python\nTraceback (most recent call last):\n File \"/local/home/leof/dev/debug_920.py\", line 94, in \u003cmodule>\n program = Program(code, code_type=\"ptx\", options=options)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/local/home/leof/dev/cuda-python/cuda_core/cuda/core/experimental/_program.py\", line 411, in __init__\n ObjectCode._init(code.encode(), code_type), options=self._translate_program_options(options)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/local/home/leof/dev/cuda-python/cuda_core/cuda/core/experimental/_program.py\", line 420, in _translate_program_options\n return LinkerOptions(\n ^^^^^^^^^^^^^^\n File \"\u003cstring>\", line 24, in __init__\n File \"/local/home/leof/dev/cuda-python/cuda_core/cuda/core/experimental/_linker.py\", line 189, in __post_init__\n _lazy_init()\n File \"/local/home/leof/dev/cuda-python/cuda_core/cuda/core/experimental/_linker.py\", line 69, in _lazy_init\n _decide_nvjitlink_or_driver()\n File \"/local/home/leof/dev/cuda-python/cuda_core/cuda/core/experimental/_linker.py\", line 47, in _decide_nvjitlink_or_driver\n if inner_nvjitlink._inspect_function_pointer(\"__nvJitLinkVersion\") == 0:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"cuda/bindings/_internal/nvjitlink.pyx\", line 247, in cuda.bindings._internal.nvjitlink._inspect_function_pointer\n File \"cuda/bindings/_internal/nvjitlink.pyx\", line 250, in cuda.bindings._internal.nvjitlink._inspect_function_pointer\n File \"cuda/bindings/_internal/nvjitlink.pyx\", line 198, in cuda.bindings._internal.nvjitlink._inspect_function_pointers\n File \"cuda/bindings/_internal/nvjitlink.pyx\", line 70, in cuda.bindings._internal.nvjitlink._check_or_init_nvjitlink\n File \"cuda/bindings/_internal/nvjitlink.pyx\", line 92, in cuda.bindings._internal.nvjitlink._check_or_init_nvjitlink\n File \"cuda/bindings/_internal/nvjitlink.pyx\", line 58, in cuda.bindings._internal.nvjitlink.load_library\n File \"/local/home/leof/miniforge3/envs/py312_cu129/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py\", line 120, in load_nvidia_dynamic_lib\n return _load_lib_no_cache(libname)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/local/home/leof/miniforge3/envs/py312_cu129/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py\", line 48, in _load_lib_no_cache\n found.raise_if_abs_path_is_None()\n File \"/local/home/leof/miniforge3/envs/py312_cu129/lib/python3.12/site-packages/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py\", line 199, in raise_if_abs_path_is_None\n raise DynamicLibNotFoundError(f'Failure finding \"{self.lib_searched_for}\": {err}\\n{att}')\ncuda.pathfinder._dynamic_libs.load_dl_common.DynamicLibNotFoundError: Failure finding \"libnvJitLink.so\": No such file: libnvJitLink.so*, No such file: libnvJitLink.so*\n\n```\nThis echos @kkraus14's concern earlier (#728). We want to be able to catch errors at run time when the underlying library (including the driver) does not provide the needed symbol, which implies that the exception raising should be deferred to as late as when it's actually needed.","author":{"url":"https://github.com/leofang","@type":"Person","name":"leofang"},"datePublished":"2025-09-08T13:51:43Z","url":"https://github.com/NVIDIA/cuda-python/issues/951"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:708ac903-1af3-939d-2552-66fe8a9417dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABC2:3AABB4:1337333:19540FA:6AF88940 |
| html-safe-nonce | 069a28013198f9ee9d12de2080c01a01466d03071c411d454867a83bbed978e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkMyOjNBQUJCNDoxMzM3MzMzOjE5NTQwRkE6NkFGODg5NDAiLCJ2aXNpdG9yX2lkIjoiMzc2NjE3MTI2MzYxMzU2OTM0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c03cfc0bc24ce197ccbeab1674229257864413caf5c9c383b1b160e461d9a941 |
| hovercard-subject-tag | issue:3394329010 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/cuda-python/951/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ea9f163f78dcf30d15aefe90a62cf686bed18bfe370a878c7abcb3df504e175/NVIDIA/cuda-python/issues/951 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ea9f163f78dcf30d15aefe90a62cf686bed18bfe370a878c7abcb3df504e175/NVIDIA/cuda-python/issues/951 |
| og:image:alt | During the investigation of #920 I noticed that if I remove nvJitLink from my current environment, cuda.core cannot fall back to use the cuLink* driver APIs because the pathfinder error is not caug... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leofang |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db |
| turbo-cache-control | no-preview |
| go-import | github.com/NVIDIA/cuda-python git https://github.com/NVIDIA/cuda-python.git |
| octolytics-dimension-user_id | 1728152 |
| octolytics-dimension-user_login | NVIDIA |
| octolytics-dimension-repository_id | 381173759 |
| octolytics-dimension-repository_nwo | NVIDIA/cuda-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 381173759 |
| octolytics-dimension-repository_network_root_nwo | NVIDIA/cuda-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653be32ff5c755082a4db662491bfbbcfc9112c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width