Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for including nvtx dll and cudart #1156

Merged
merged 3 commits into from
Oct 4, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions conda/pytorch-nightly/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%desired_cuda%
set CUDA_BIN_PATH=%CUDA_PATH%\bin
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
set TORCH_CUDA_ARCH_LIST=3.7+PTX;5.0
if "%desired_cuda%" == "10.2" set TORCH_CUDA_ARCH_LIST=%TORCH_CUDA_ARCH_LIST%;6.0;6.1;7.0;7.5
if "%desired_cuda%" == "11.3" (
set TORCH_CUDA_ARCH_LIST=%TORCH_CUDA_ARCH_LIST%;6.0;6.1;7.0;7.5;8.0;8.6
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
)
if "%desired_cuda%" == "11.5" (
set TORCH_CUDA_ARCH_LIST=%TORCH_CUDA_ARCH_LIST%;6.0;6.1;7.0;7.5;8.0;8.6
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all --threads 2
Expand Down Expand Up @@ -112,6 +107,8 @@ IF "%USE_SCCACHE%" == "1" (

if NOT "%build_with_cuda%" == "" (
copy "%CUDA_BIN_PATH%\cudnn*64_*.dll*" %SP_DIR%\torch\lib
copy "%CUDA_BIN_PATH%\cudart*64_*.dll*" %SP_DIR%\torch\lib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cudart is needed?

Copy link
Contributor

@izaitsevfb izaitsevfb Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cudart is needed?

To clarify a bit. There are be two different dll-related issues.

  1. First is the missing nvtx, causing import torch to fail (all conda windows builds) with:
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\ivanzaitsev\Anaconda3\envs\tmp_conda1\lib\site-packages\torch\lib\shm.dll" or one of its dependencies.
  1. The second one described here (Nightly torchaudio load_lib failure (windows, python 3.8, cuda 11.6 and 11.7) audio#2726), only on conda windows, python 3.8 appears to be caused by missing cudart64_110.dll:
FileNotFoundError: Could not find module 'C:\Miniconda\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

copy "%NVTOOLSEXT_PATH%\bin\x64\nvToolsExt64_*.dll*" %SP_DIR%\torch\lib
:: cupti library file name changes aggressively, bundle it to avoid
:: potential file name mismatch.
copy "%CUDA_PATH%\extras\CUPTI\lib64\cupti64_*.dll*" %SP_DIR%\torch\lib
Expand All @@ -120,6 +117,8 @@ if NOT "%build_with_cuda%" == "" (
if exist "C:\Windows\System32\zlibwapi.dll" (
copy "C:\Windows\System32\zlibwapi.dll" %SP_DIR%\torch\lib
)

atalman marked this conversation as resolved.
Show resolved Hide resolved

)

exit /b 0