Skip to content

Commit 018c139

Browse files
authored
Allow windows cuda files to be used in setup.py (#5015)
Example: ```python # On Windows >>> sysconfig.get_config_var("EXE") '.exe' # On Linux >>> sysconfig.get_config_var("EXE") '' ``` --------- Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 61eb94e commit 018c139

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ def get_platform_dependent_src_path(subdir):
497497
if int(version_major) >= 12 and int(version_minor1) >= 5 else subdir)(*version.split('.')))
498498

499499

500+
exe_extension = sysconfig.get_config_var("EXE")
500501
download_and_copy(
501-
name="ptxas", src_path="bin/ptxas", dst_path="bin/ptxas", variable="TRITON_PTXAS_PATH",
502+
name="ptxas", src_path=f"bin/ptxas{exe_extension}", dst_path="bin/ptxas", variable="TRITON_PTXAS_PATH",
502503
version=NVIDIA_TOOLCHAIN_VERSION["ptxas"], url_func=lambda system, arch, version:
503504
((lambda version_major, version_minor1, version_minor2:
504505
f"https://anaconda.org/nvidia/cuda-nvcc-tools/{version}/download/{system}-{arch}/cuda-nvcc-tools-{version}-0.tar.bz2"
@@ -507,7 +508,7 @@ def get_platform_dependent_src_path(subdir):
507508
(*version.split('.'))))
508509
download_and_copy(
509510
name="cuobjdump",
510-
src_path="bin/cuobjdump",
511+
src_path=f"bin/cuobjdump{exe_extension}",
511512
dst_path="bin/cuobjdump",
512513
variable="TRITON_CUOBJDUMP_PATH",
513514
version=NVIDIA_TOOLCHAIN_VERSION["cuobjdump"],
@@ -516,7 +517,7 @@ def get_platform_dependent_src_path(subdir):
516517
)
517518
download_and_copy(
518519
name="nvdisasm",
519-
src_path="bin/nvdisasm",
520+
src_path=f"bin/nvdisasm{exe_extension}",
520521
dst_path="bin/nvdisasm",
521522
variable="TRITON_NVDISASM_PATH",
522523
version=NVIDIA_TOOLCHAIN_VERSION["nvdisasm"],

0 commit comments

Comments
 (0)