Return True if any available GPU has RT cores (required for Vulkan ray tracing). Checks ``nvidia-smi`` GPU names against known RT-capable product lines. Returns False if nvidia-smi is unavailable or no matching GPU is found.
()
| 485 | |
| 486 | |
| 487 | def has_rt_core_gpu() -> bool: |
| 488 | """Return True if any available GPU has RT cores (required for Vulkan ray tracing). |
| 489 | |
| 490 | Checks ``nvidia-smi`` GPU names against known RT-capable product lines. |
| 491 | Returns False if nvidia-smi is unavailable or no matching GPU is found. |
| 492 | """ |
| 493 | try: |
| 494 | result = subprocess.run( |
| 495 | ["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], |
| 496 | capture_output=True, |
| 497 | text=True, |
| 498 | timeout=10, |
| 499 | ) |
| 500 | if result.returncode != 0: |
| 501 | return False |
| 502 | for name in result.stdout.strip().splitlines(): |
| 503 | if any(re.search(pat, name.strip().lower()) for pat in _RT_CORE_GPU_PATTERNS): |
| 504 | return True |
| 505 | except Exception: |
| 506 | pass |
| 507 | return False |
| 508 | |
| 509 | |
| 510 | def find_nvidia_egl_vendor_file() -> pathlib.Path: |