Skip to content

add warning to the nvjitlink ctor when falling back to cuLink #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cuda_core/cuda/core/experimental/_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import ctypes
import warnings
import weakref
from contextlib import contextmanager
from dataclasses import dataclass
Expand Down Expand Up @@ -42,6 +43,12 @@ def _decide_nvjitlink_or_driver():
_nvjitlink = None

if _nvjitlink is None:
warnings.warn(
"nvJitLink is not installed or too old (<12.3). Therefore it is not usable "
"and the culink APIs will be used instead.",
stacklevel=3,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Is stacklevel=2 not enough? I always forget which level is the right choice, but I'd prefer to not print out the cuda.core internal as part of the traceback.

category=RuntimeWarning,
)
_driver = cuda
return True
else:
Expand Down Expand Up @@ -80,7 +87,8 @@ class LinkerOptions:
"""Customizable :obj:`Linker` options.

Since the linker would choose to use nvJitLink or the driver APIs as the linking backed,
not all options are applicable.
not all options are applicable. When the system's installed nvJitLink is too old (<12.3),
or not installed, the driver APIs (cuLink) will be used instead.

Attributes
----------
Expand Down
Loading