diff --git a/tokenspeed-kernel/python/setup.py b/tokenspeed-kernel/python/setup.py index 66c533134..a3ef9f967 100644 --- a/tokenspeed-kernel/python/setup.py +++ b/tokenspeed-kernel/python/setup.py @@ -453,6 +453,30 @@ def _detect_cuda_archs(self): archs.add(self._normalize_cuda_arch(direct)) return archs + # Try detecting from the NVIDIA driver. + if not archs: + try: + caps = ( + subprocess.check_output( + [ + "nvidia-smi", + "--query-gpu=compute_cap", + "--format=csv,noheader", + ], + text=True, + stderr=subprocess.DEVNULL, + ) + .strip() + .splitlines() + ) + for cap in caps: + cap = cap.strip() + if cap: + archs.add(self._normalize_cuda_arch(cap)) + except (OSError, subprocess.CalledProcessError): + pass + + # Fallback: Blackwell if not archs: archs.add("100a") return archs