jorisvandenbossche commented on code in PR #40385:
URL: https://github.com/apache/arrow/pull/40385#discussion_r1557106992


##########
python/pyarrow/lib.pyx:
##########
@@ -143,6 +144,18 @@ def _pac():
     return __pac
 
 
+def _ensure_cuda_loaded():
+    # Try importing the cuda module to ensure libarrow_cuda gets loaded
+    # to register the CUDA device for the C Data Interface import
+    global __cuda_loaded
+    if not __cuda_loaded:
+        try:
+            import pyarrow.cuda  # no-cython-lint
+        except ImportError:
+            pass

Review Comment:
   Good point. Pushed a change to capture the error message, and to actually 
raise a more informative error message here about pyarrow not being built with 
CUDA support (embedding the original import error message), instead of using 
the message from the C++ registry.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to