Add cupti path for python gpu packaging pipeline (#7200)

* add cupti dll path for py3.8

* correct path

* add prints

* replace path join

* add all path

* restore pipeline

* format

* expand path only for python 38&39

* add all cupti path

Co-authored-by: Randy Shuai <rashuai@microsoft.com>
This commit is contained in:
RandySheriffH 2021-04-02 12:12:46 -07:00 committed by GitHub
parent 2d352056cf
commit ebde320950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,6 +40,11 @@ if platform.system() == "Windows":
# Python 3.8 (and later) doesn't search system PATH when loading DLLs, so the CUDA location needs to be
# specified explicitly using the new API introduced in Python 3.8.
os.add_dll_directory(cuda_bin_dir)
cuda_root = os.path.join(cuda_bin_dir, "..", "..")
for root, _, files in os.walk(cuda_root):
for f in files:
if f == "cupti.lib":
os.add_dll_directory(root)
else:
# Python 3.7 (and earlier) searches directories listed in PATH variable.
# Make sure that the target CUDA version is at the beginning (important if multiple CUDA versions are