mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Simplify nvtx3 CMake handling, always use nvtx3 (#153784)
Fall back to third-party NVTX3 if system NVTX3 doesn't exist. We also reuse the `CUDA::nvtx3` target for better interoperability. Pull Request resolved: https://github.com/pytorch/pytorch/pull/153784 Approved by: https://github.com/ezyang
This commit is contained in:
@ -206,20 +206,6 @@ if sys.platform == "win32":
|
||||
if os.path.exists(p)
|
||||
]
|
||||
|
||||
if not builtins.any(
|
||||
os.path.exists(os.path.join(p, "nvToolsExt64_1.dll")) for p in dll_paths
|
||||
):
|
||||
nvtoolsext_dll_path = os.path.join(
|
||||
os.getenv(
|
||||
"NVTOOLSEXT_PATH",
|
||||
os.path.join(pfiles_path, "NVIDIA Corporation", "NvToolsExt"),
|
||||
),
|
||||
"bin",
|
||||
"x64",
|
||||
)
|
||||
else:
|
||||
nvtoolsext_dll_path = ""
|
||||
|
||||
if cuda_version and builtins.all(
|
||||
not glob.glob(os.path.join(p, "cudart64*.dll")) for p in dll_paths
|
||||
):
|
||||
@ -232,9 +218,7 @@ if sys.platform == "win32":
|
||||
else:
|
||||
cuda_path = ""
|
||||
|
||||
dll_paths.extend(
|
||||
p for p in (nvtoolsext_dll_path, cuda_path) if os.path.exists(p)
|
||||
)
|
||||
dll_paths.extend(p for p in (cuda_path,) if os.path.exists(p))
|
||||
|
||||
kernel32 = ctypes.WinDLL("kernel32.dll", use_last_error=True)
|
||||
with_load_library_flags = hasattr(kernel32, "AddDllDirectory")
|
||||
@ -371,7 +355,6 @@ def _load_global_deps() -> None:
|
||||
"cusparselt": "libcusparseLt.so.*[0-9]",
|
||||
"cusolver": "libcusolver.so.*[0-9]",
|
||||
"nccl": "libnccl.so.*[0-9]",
|
||||
"nvtx": "libnvToolsExt.so.*[0-9]",
|
||||
"nvshmem": "libnvshmem_host.so.*[0-9]",
|
||||
}
|
||||
# cufiile is only available on cuda 12+
|
||||
|
Reference in New Issue
Block a user