diff --git a/third_party/nvidia/backend/compiler.py b/third_party/nvidia/backend/compiler.py index 337b5b0408eb..50d145664485 100644 --- a/third_party/nvidia/backend/compiler.py +++ b/third_party/nvidia/backend/compiler.py @@ -21,14 +21,13 @@ def _path_to_binary(binary: str): os.path.join(os.path.dirname(__file__), "bin", binary), ] - for p in paths: - bin = p.split(" ")[0] + for bin in paths: if os.path.exists(bin) and os.path.isfile(bin): result = subprocess.check_output([bin, "--version"], stderr=subprocess.STDOUT) if result is not None: version = re.search(r".*release (\d+\.\d+).*", result.decode("utf-8"), flags=re.MULTILINE) if version is not None: - return p, version.group(1) + return bin, version.group(1) raise RuntimeError(f"Cannot find {binary}")