Zhen Ye commited on
Commit
970cc85
·
1 Parent(s): 0e0cc26

chore: add detailed GPU diagnostics logs

Browse files
Files changed (1) hide show
  1. inference.py +11 -0
inference.py CHANGED
@@ -431,6 +431,17 @@ def run_inference(
431
  detectors = None
432
  depth_estimators = None
433
 
 
 
 
 
 
 
 
 
 
 
 
434
  if num_gpus > 1:
435
  logging.info("Detected %d GPUs. Enabling Multi-GPU inference.", num_gpus)
436
  # Initialize one detector per GPU
 
431
  detectors = None
432
  depth_estimators = None
433
 
434
+ # DIAGNOSTICS
435
+ logging.info("--- GPU DIAGNOSTICS ---")
436
+ logging.info("Torch version: %s", torch.__version__)
437
+ logging.info("CUDA available: %s", torch.cuda.is_available())
438
+ logging.info("Device count: %d", torch.cuda.device_count())
439
+ logging.info("Current device: %s", torch.cuda.current_device() if torch.cuda.is_available() else "N/A")
440
+ for k, v in os.environ.items():
441
+ if "CUDA" in k or "NVIDIA" in k:
442
+ logging.info("Env %s=%s", k, v)
443
+ logging.info("-----------------------")
444
+
445
  if num_gpus > 1:
446
  logging.info("Detected %d GPUs. Enabling Multi-GPU inference.", num_gpus)
447
  # Initialize one detector per GPU