Skip to content

Commit

Permalink
Plausibly provide useful error message if driver is too old
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Jul 26, 2024
1 parent 000ef52 commit 7d3e5de
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions python/cudf_polars/cudf_polars/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import nvtx

from polars.exceptions import PerformanceWarning
from polars.exceptions import ComputeError, PerformanceWarning

import rmm
from rmm._cuda import gpu
Expand Down Expand Up @@ -49,7 +49,21 @@ def default_memory_resource(device: int) -> rmm.mr.DeviceMemoryResource:
The default memory resource that cudf-polars uses. Currently
an async pool resource.
"""
return rmm.mr.CudaAsyncMemoryResource()
try:
return rmm.mr.CudaAsyncMemoryResource()
except RuntimeError as e:
msg, *_ = e.args
if (
msg.startswith("RMM failure")
and msg.find("not supported with this CUDA driver/runtime version") > -1
):
raise ComputeError(
"GPU engine requested, but incorrect cudf-polars package installed. "
"If your system has a CUDA 11 driver, please uninstall `cudf-polars-cu12` "
"and install `cudf-polars-cu11`"
) from None
else:
raise


@contextlib.contextmanager
Expand Down

0 comments on commit 7d3e5de

Please sign in to comment.