damccorm commented on code in PR #38088:
URL: https://github.com/apache/beam/pull/38088#discussion_r3047579424
##########
sdks/python/apache_beam/ml/inference/pytorch_inference.py:
##########
@@ -56,6 +56,20 @@
Iterable[PredictionResult]]
+def _cuda_device_is_usable() -> bool:
+ """Returns True only when CUDA can actually allocate tensors."""
+ if not torch.cuda.is_available():
+ return False
+ try:
+ # Some environments report CUDA available but fail at first real use
+ # because a driver is missing or inaccessible.
+ torch.empty(1, device='cuda')
+ return True
+ except Exception: # pylint: disable=broad-except
+ logging.debug("CUDA probe failed", exc_info=True)
Review Comment:
Lets make this a warning
--
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]