Skip to content

Commit 381fcb8

Browse files
committed
set CUDA_VERSION during build; test torch.version.cuda is correct
1 parent de7707c commit 381fcb8

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

recipe/bld.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ if not "%cuda_compiler_version%" == "None" (
9393
set MAGMA_HOME=%LIBRARY_PREFIX%
9494
set "PATH=%CUDA_BIN_PATH%;%PATH%"
9595
set CUDNN_INCLUDE_DIR=%LIBRARY_PREFIX%\include
96+
set "CUDA_VERSION=%cuda_compiler_version%"
9697
) else (
9798
set USE_CUDA=0
9899
@REM MKLDNN is an Apache-2.0 licensed library for DNNs and is used

recipe/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ elif [[ ${cuda_compiler_version} != "None" ]]; then
219219
export USE_STATIC_CUDNN=0
220220
export MAGMA_HOME="${PREFIX}"
221221
export USE_MAGMA=1
222+
export CUDA_VERSION=$cuda_compiler_version
222223
# turn off noisy nvcc warnings
223224
export CMAKE_CUDA_FLAGS="-w -Xptxas -w"
224225
else

recipe/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ outputs:
403403
- python -c "import torch; assert torch.backends.cuda.is_built()" # [linux64 and (cuda_compiler_version != "None")]
404404
- python -c "import torch; assert torch.backends.cudnn.is_available()" # [linux64 and (cuda_compiler_version != "None")]
405405
- python -c "import torch; assert torch.backends.cudnn.enabled" # [linux64 and (cuda_compiler_version != "None")]
406+
- python -c "import torch; assert torch.version.cuda is not None" # [cuda_compiler_version != "None"]
406407
# At conda-forge, we target versions of OSX that are too old for MPS support
407408
# But if users install a newer version of OSX, they will have MPS support
408409
# https://github.com/conda-forge/pytorch-cpu-feedstock/pull/123#issuecomment-1186355073

0 commit comments

Comments
 (0)