Skip to content

Commit 6cd2a4f

Browse files
Handle NVMLError_NotSupported in cudf-polars (#20179)
Fixes a regression in #19895, which changed the logic for when we catch this exception and fall back to the default device memory size. Authors: - Tom Augspurger (https://github.com/TomAugspurger) Approvers: - Matthew Murray (https://github.com/Matt711) URL: #20179
1 parent e0fe5f7 commit 6cd2a4f

File tree

1 file changed

+5
-1
lines changed
  • python/cudf_polars/cudf_polars/utils

1 file changed

+5
-1
lines changed

python/cudf_polars/cudf_polars/utils/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ def get_total_device_memory() -> int | None:
8989
maybe_handle = get_device_handle()
9090

9191
if maybe_handle is not None:
92-
return pynvml.nvmlDeviceGetMemoryInfo(maybe_handle).total
92+
try:
93+
return pynvml.nvmlDeviceGetMemoryInfo(maybe_handle).total
94+
except pynvml.NVMLError_NotSupported: # pragma: no cover
95+
# System doesn't have proper "GPU memory".
96+
return None
9397
else: # pragma: no cover
9498
return None
9599

0 commit comments

Comments
 (0)