Skip to content

Commit 224eef4

Browse files
committed
raise when cuobjdump is not installed
1 parent 302259c commit 224eef4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

numba_cuda/numba/cuda/cudadrv/driver.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,8 +3448,16 @@ def inspect_obj_content(objpath: str):
34483448
"""
34493449
code_types :set[str] = set()
34503450

3451-
out = subprocess.run(["cuobjdump", objpath], capture_output=True)
3452-
objtable = out.stdout.decode()
3451+
try:
3452+
out = subprocess.run(["cuobjdump", objpath], check=True,
3453+
capture_output=True)
3454+
except FileNotFoundError as e:
3455+
msg = ("cuobjdump has not been found. You may need "
3456+
"to install the CUDA toolkit and ensure that "
3457+
"it is available on your PATH.\n")
3458+
raise RuntimeError(msg) from e
3459+
3460+
objtable = out.stdout.decode('utf-8')
34533461
entry_pattern = r"Fatbin (.*) code"
34543462
for line in objtable.split("\n"):
34553463
if match := re.match(entry_pattern, line):

0 commit comments

Comments
 (0)