Pytorch cuda 11.2 build from source: RuntimeError: CUDA error: no kernel image is available for execution on the device

username: George_Guliman
cooked: <p>Hello,</p>
<p>I am trying to install pytorch with cuda by following the build from source method.<br>
I have cuda 11.2, nvtx11.2, cuDNN 8.1.1.33 nvidia cuda visual studio integration 11.2 and visual studio community ediiton 2019 16.6.30204.135. My GPU is compute 7.5 compatible (RTX 2070)</p>
<p>I am trying to build pytorch from a conda environment and I installed all the pre-requisites mentioned in the <a href="https://github.com/pytorch/pytorch#from-source" rel="noopener nofollow ugc">guide</a>.<br>
Before running <em>setup.py install --cmake</em>, I tried to set the following env variables:</p>
<blockquote>
<p>MAGMA_HOME                     F:\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\magma<br>
LIB                            F:\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\mkl\lib<br>
CMAKE_GENERATOR                Ninja<br>
TORCH_CUDA_ARCH_LIST           7.5<br>
CMAKE_INCLUDE_PATH             F:\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\mkl\include</p>
</blockquote>
<p>The build and installation is working and it finishes successfully, however, when I try to actually create a tensor on the gpu, i get the following behavior:</p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>import torch<br>
torch.cuda.is_available()<br>
True<br>
torch.cuda.current_device()<br>
0<br>
torch.cuda.device(0)<br>
&lt;torch.cuda.device object at 0x000002731D947640&gt;<br>
torch.cuda.device_count()<br>
1<br>
torch.cuda.get_device_name(0)<br>
‘GeForce RTX 2070’<br>
torch.randn(1, device=“cuda”)<br>
Traceback (most recent call last):<br>
File “”, line 1, in <br>
RuntimeError: CUDA error: no kernel image is available for execution on the device</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p>Can someone please guide me further on troubleshooting this? It seems to me like maybe I am missing some configuration parameters when building? Also, I am struggling to find where the build logs are getting written in order to check in more detail how the build process is doing.</p>
<p>Below, you can find the beginning of the build log that should show the environment details and config options used for build:</p>
<blockquote>
<p>– Building version 1.9.0a0+git01b1557<br>
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Ninja -DCMAKE_INCLUDE_PATH=F:\TAID-Master\MLAV\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\mkl\include -DCMAKE_INSTALL_PREFIX=F:\TAID-Master\MLAV\pytorch-source\pytorch\torch -DCMAKE_PREFIX_PATH=C:\ProgramData\Miniconda3\envs\pytorch-source\Lib\site-packages -DCUDNN_LIBRARY=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\lib\x64 -DNUMPY_INCLUDE_DIR=C:\ProgramData\Miniconda3\envs\pytorch-source\lib\site-packages\numpy\core\include -DPYTHON_EXECUTABLE=C:\ProgramData\Miniconda3\envs\pytorch-source\python.exe -DPYTHON_INCLUDE_DIR=C:\ProgramData\Miniconda3\envs\pytorch-source\include -DPYTHON_LIBRARY=C:\ProgramData\Miniconda3\envs\pytorch-source/libs/python38.lib -DTORCH_BUILD_VERSION=1.9.0a0+git01b1557 -DUSE_NUMPY=True F:\TAID-Master\MLAV\pytorch-source\pytorch<br>
– The CXX compiler identification is MSVC 19.26.28806.0<br>
– The C compiler identification is MSVC 19.26.28806.0<br>
– Detecting CXX compiler ABI info<br>
– Detecting CXX compiler ABI info - done<br>
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe - skipped<br>
– Detecting CXX compile features<br>
– Detecting CXX compile features - done<br>
– Detecting C compiler ABI info<br>
– Detecting C compiler ABI info - done<br>
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe - skipped<br>
– Detecting C compile features<br>
– Detecting C compile features - done<br>
– Not forcing any particular BLAS to be found<br>
CMake Warning at CMakeLists.txt:305 (message):<br>
TensorPipe cannot be used on Windows.  Set it to OFF</p>
<h2>– Performing Test COMPILER_WORKS<br>
– Performing Test COMPILER_WORKS - Success<br>
– Performing Test SUPPORT_GLIBCXX_USE_C99<br>
– Performing Test SUPPORT_GLIBCXX_USE_C99 - Success<br>
– Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED<br>
– Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED - Success<br>
– std::exception_ptr is supported.<br>
– Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING<br>
– Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING - Failed<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS - Success<br>
– Current compiler supports avx2 extension. Will build perfkernels.<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS<br>
– Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS - Success<br>
– Current compiler supports avx512f extension. Will build fbgemm.<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY - Failed<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY<br>
– Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY - Failed<br>
– Performing Test COMPILER_SUPPORTS_RDYNAMIC<br>
– Performing Test COMPILER_SUPPORTS_RDYNAMIC - Failed<br>
– Building using own protobuf under third_party per request.<br>
– Use custom protobuf build.</h2>
<p>– 3.11.4.0<br>
– Looking for pthread.h<br>
– Looking for pthread.h - not found<br>
– Found Threads: TRUE<br>
– Caffe2 protobuf include directory: $&lt;BUILD_INTERFACE:F:/TAID-Master/MLAV/pytorch-source/pytorch/third_party/protobuf/src&gt;$&lt;INSTALL_INTERFACE:include&gt;<br>
– Trying to find preferred BLAS backend of choice: MKL<br>
– MKL_THREADING = OMP<br>
– Looking for sys/types.h<br>
– Looking for sys/types.h - found<br>
– Looking for stdint.h<br>
– Looking for stdint.h - found<br>
– Looking for stddef.h<br>
– Looking for stddef.h - found<br>
– Check size of void*<br>
– Check size of void* - done<br>
– Looking for cblas_sgemm<br>
– Looking for cblas_sgemm - found<br>
– MKL libraries: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/mkl_intel_lp64.lib;F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/mkl_intel_thread.lib;F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/mkl_core.lib;F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/libiomp5md.lib<br>
– MKL include directory: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include<br>
– MKL OpenMP type: Intel<br>
– MKL OpenMP library: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/libiomp5md.lib<br>
– The ASM compiler identification is MSVC<br>
– Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe<br>
CMake Deprecation Warning at third_party/googletest/CMakeLists.txt:1 (cmake_minimum_required):<br>
Compatibility with CMake &lt; 2.8.12 will be removed from a future version of<br>
CMake.</p>
<p>** AsmJit Summary **<br>
ASMJIT_DIR=F:/TAID-Master/MLAV/pytorch-source/pytorch/third_party/fbgemm/third_party/asmjit<br>
ASMJIT_TEST=FALSE<br>
ASMJIT_TARGET_TYPE=SHARED<br>
ASMJIT_DEPS=<br>
ASMJIT_LIBS=asmjit<br>
ASMJIT_CFLAGS=<br>
ASMJIT_PRIVATE_CFLAGS=-MP;-GF;-Zc:inline;-Zc:strictStrings;-Zc:threadSafeInit-;-W4<br>
ASMJIT_PRIVATE_CFLAGS_DBG=-GS<br>
ASMJIT_PRIVATE_CFLAGS_REL=-GS-;-O2;-Oi<br>
– Using third party subdirectory Eigen.<br>
– Found PythonInterp: C:/ProgramData/Miniconda3/envs/pytorch-source/python.exe (found suitable version “3.8.8”, minimum required is “3.0”)<br>
– Found PythonLibs: C:/ProgramData/Miniconda3/envs/pytorch-source/libs/python38.lib (found suitable version “3.8.8”, minimum required is “3.0”)<br>
– Could NOT find pybind11 (missing: pybind11_DIR)<br>
– Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)<br>
– Using third_party/pybind11.<br>
– pybind11 include dirs: F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/…/third_party/pybind11/include<br>
– Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)<br>
– Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)<br>
– Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)<br>
Reason given by package: MPI component ‘Fortran’ was requested, but language Fortran is not enabled.</p>
<p>CMake Warning at cmake/Dependencies.cmake:1045 (message):<br>
Not compiling with MPI.  Suppress this warning with -DUSE_MPI=OFF<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:604 (include)</p>
<p>– Adding OpenMP CXX_FLAGS: -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include<br>
– Will link against OpenMP libraries: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/libiomp5md.lib<br>
– Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2 (found version “11.2”)<br>
– Caffe2: CUDA detected: 11.2<br>
– Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe<br>
– Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2<br>
– Caffe2: Header version is: 11.2<br>
– Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudnn.lib<br>
– Found cuDNN: v8.1.1  (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudnn.lib)<br>
– C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/nvrtc.lib shorthash is aa1d5a72<br>
CMake Warning at cmake/public/utils.cmake:365 (message):<br>
In the future we will require one to explicitly pass TORCH_CUDA_ARCH_LIST<br>
to cmake instead of implicitly setting it as an env variable.  This will<br>
become a FATAL_ERROR in future version of pytorch.<br>
Call Stack (most recent call first):<br>
cmake/public/cuda.cmake:483 (torch_cuda_get_nvcc_gencode_flag)<br>
cmake/Dependencies.cmake:1150 (include)<br>
CMakeLists.txt:604 (include)</p>
<p>– Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75<br>
– Found CUB: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/include<br>
CMake Warning (dev) at third_party/gloo/CMakeLists.txt:21 (option):<br>
Policy CMP0077 is not set: option() honors normal variables.  Run “cmake<br>
–help-policy CMP0077” for policy details.  Use the cmake_policy command to<br>
set the policy and suppress this warning.</p>
<p>For compatibility with older versions of CMake, option is clearing the<br>
normal variable ‘BUILD_BENCHMARK’.<br>
This warning is for project developers.  Use -Wno-dev to suppress it.</p>
<p>CMake Warning (dev) at third_party/gloo/CMakeLists.txt:34 (option):<br>
Policy CMP0077 is not set: option() honors normal variables.  Run “cmake<br>
–help-policy CMP0077” for policy details.  Use the cmake_policy command to<br>
set the policy and suppress this warning.<br>
– MSVC detected<br>
– Set USE_REDIS OFF<br>
– Set USE_IBVERBS OFF<br>
– Set USE_NCCL OFF<br>
– Set USE_RCCL OFF<br>
– Set USE_LIBUV ON<br>
– Only USE_LIBUV is supported on Windows<br>
– Gloo build as SHARED library</p>
<p>– Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2 (found suitable version “11.2”, minimum required is “7.0”)<br>
– CUDA detected: 11.2<br>
CMake Warning at cmake/Dependencies.cmake:1394 (message):<br>
Metal is only used in ios builds.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:604 (include)</p>
<h2>Generated: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/third_party/onnx/onnx/onnx_onnx_torch-ml.proto<br>
Generated: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/third_party/onnx/onnx/onnx-operators_onnx_torch-ml.proto<br>
Generated: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/third_party/onnx/onnx/onnx-data_onnx_torch.proto</h2>
<h2>– ******** Summary ********<br>
–   CMake version         : 3.19.6<br>
–   CMake command         : C:/ProgramData/Miniconda3/envs/pytorch-source/Library/bin/cmake.exe<br>
–   System                : Windows<br>
–   C++ compiler          : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe<br>
–   C++ compiler version  : 19.26.28806.0<br>
–   CXX flags             : /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include<br>
–   Build type            : Release<br>
–   Compile definitions   : WIN32_LEAN_AND_MEAN;TH_BLAS_MKL;_OPENMP_NOFORCE_MANIFEST;ONNX_ML=1;ONNXIFI_ENABLE_EXT=1<br>
–   CMAKE_PREFIX_PATH     : C:\ProgramData\Miniconda3\envs\pytorch-source\Lib\site-packages;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2<br>
–   CMAKE_INSTALL_PREFIX  : F:/TAID-Master/MLAV/pytorch-source/pytorch/torch<br>
–   CMAKE_MODULE_PATH     : F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/Modules;F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/public/…/Modules_CUDA_fix</h2>
<h2>–   ONNX version          : 1.8.0<br>
–   ONNX NAMESPACE        : onnx_torch<br>
–   ONNX_BUILD_TESTS      : OFF<br>
–   ONNX_BUILD_BENCHMARKS : OFF<br>
–   ONNX_USE_LITE_PROTO   : OFF<br>
–   ONNXIFI_DUMMY_BACKEND : OFF<br>
–   ONNXIFI_ENABLE_EXT    : OFF</h2>
<h2>–   Protobuf compiler     :<br>
–   Protobuf includes     :<br>
–   Protobuf libraries    :<br>
–   BUILD_ONNX_PYTHON     : OFF</h2>
<h2>– ******** Summary ********<br>
–   CMake version         : 3.19.6<br>
–   CMake command         : C:/ProgramData/Miniconda3/envs/pytorch-source/Library/bin/cmake.exe<br>
–   System                : Windows<br>
–   C++ compiler          : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe<br>
–   C++ compiler version  : 19.26.28806.0<br>
–   CXX flags             : /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include<br>
–   Build type            : Release<br>
–   Compile definitions   : WIN32_LEAN_AND_MEAN;TH_BLAS_MKL;_OPENMP_NOFORCE_MANIFEST;ONNX_ML=1;ONNXIFI_ENABLE_EXT=1<br>
–   CMAKE_PREFIX_PATH     : C:\ProgramData\Miniconda3\envs\pytorch-source\Lib\site-packages;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2<br>
–   CMAKE_INSTALL_PREFIX  : F:/TAID-Master/MLAV/pytorch-source/pytorch/torch<br>
–   CMAKE_MODULE_PATH     : F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/Modules;F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/public/…/Modules_CUDA_fix</h2>
<h2>–   ONNX version          : 1.4.1<br>
–   ONNX NAMESPACE        : onnx_torch<br>
–   ONNX_BUILD_TESTS      : OFF<br>
–   ONNX_BUILD_BENCHMARKS : OFF<br>
–   ONNX_USE_LITE_PROTO   : OFF<br>
–   ONNXIFI_DUMMY_BACKEND : OFF</h2>
<p>–   Protobuf compiler     :<br>
–   Protobuf includes     :<br>
–   Protobuf libraries    :<br>
–   BUILD_ONNX_PYTHON     : OFF<br>
– Found CUDA with FP16 support, compiling with torch.cuda.HalfTensor<br>
– Adding -DNDEBUG to compile flags<br>
– Checking prototype magma_get_sgeqrf_nb for MAGMA_V2<br>
– Checking prototype magma_get_sgeqrf_nb for MAGMA_V2 - True<br>
– Compiling with MAGMA support<br>
– MAGMA INCLUDE DIRECTORIES: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/magma/include<br>
– MAGMA LIBRARIES: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/magma/lib/magma.lib<br>
– MAGMA V2 check: 1<br>
– Could not find hardware support for NEON on this machine.<br>
– No OMAP3 processor on this machine.<br>
– No OMAP4 processor on this machine.<br>
– Looking for cpuid.h<br>
– Looking for cpuid.h - not found<br>
– Performing Test NO_GCC_EBX_FPIC_BUG<br>
– Performing Test NO_GCC_EBX_FPIC_BUG - Failed<br>
– Performing Test C_HAS_AVX_1<br>
– Performing Test C_HAS_AVX_1 - Success<br>
– Performing Test C_HAS_AVX2_1<br>
– Performing Test C_HAS_AVX2_1 - Success<br>
– Performing Test CXX_HAS_AVX_1<br>
– Performing Test CXX_HAS_AVX_1 - Success<br>
– Performing Test CXX_HAS_AVX2_1<br>
– Performing Test CXX_HAS_AVX2_1 - Success<br>
– AVX compiler support found<br>
– AVX2 compiler support found<br>
– Performing Test BLAS_F2C_DOUBLE_WORKS<br>
– Performing Test BLAS_F2C_DOUBLE_WORKS - Failed<br>
– Performing Test BLAS_F2C_FLOAT_WORKS<br>
– Performing Test BLAS_F2C_FLOAT_WORKS - Success<br>
– Performing Test BLAS_USE_CBLAS_DOT<br>
– Performing Test BLAS_USE_CBLAS_DOT - Success<br>
– Found a library with BLAS API (mkl). Full path: (F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/mkl_intel_lp64.lib;F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/mkl_intel_thread.lib;F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/mkl_core.lib;F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/libiomp5md.lib)<br>
– Found a library with LAPACK API (mkl).<br>
disabling ROCM because NOT USE_ROCM is set<br>
– MIOpen not found. Compiling without MIOpen support<br>
– MKLDNN_CPU_RUNTIME = OMP<br>
CMake Deprecation Warning at third_party/ideep/mkl-dnn/CMakeLists.txt:17 (cmake_minimum_required):<br>
Compatibility with CMake &lt; 2.8.12 will be removed from a future version of<br>
CMake.</p>
<p>Update the VERSION argument  value or use a … suffix to tell<br>
CMake that the project does not need compatibility with older versions.</p>
<p>– Intel MKL-DNN compat: set DNNL_ENABLE_CONCURRENT_EXEC to MKLDNN_ENABLE_CONCURRENT_EXEC with value <code>ON</code><br>
– Intel MKL-DNN compat: set DNNL_BUILD_EXAMPLES to MKLDNN_BUILD_EXAMPLES with value <code>FALSE</code><br>
– Intel MKL-DNN compat: set DNNL_BUILD_TESTS to MKLDNN_BUILD_TESTS with value <code>FALSE</code><br>
– Intel MKL-DNN compat: set DNNL_LIBRARY_TYPE to MKLDNN_LIBRARY_TYPE with value <code>STATIC</code><br>
– Intel MKL-DNN compat: set DNNL_ARCH_OPT_FLAGS to MKLDNN_ARCH_OPT_FLAGS with value ``<br>
– Intel MKL-DNN compat: set DNNL_CPU_RUNTIME to MKLDNN_CPU_RUNTIME with value <code>OMP</code></p>
<p>– Found OpenMP_CXX: -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include<br>
– GPU support is disabled<br>
– Primitive cache is enabled<br>
– Found MKL-DNN: TRUE<br>
– Performing Test C_HAS_THREAD<br>
– Performing Test C_HAS_THREAD - Success<br>
– Version: 7.0.3<br>
– Build type: Release<br>
– CXX_STANDARD: 14<br>
– Performing Test has_std_14_flag<br>
– Performing Test has_std_14_flag - Failed<br>
– Performing Test has_std_1y_flag<br>
– Performing Test has_std_1y_flag - Failed<br>
– Performing Test SUPPORTS_USER_DEFINED_LITERALS<br>
– Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success<br>
– Performing Test FMT_HAS_VARIANT<br>
– Performing Test FMT_HAS_VARIANT - Success<br>
– Required features: cxx_variadic_templates<br>
– Looking for _strtod_l<br>
– Looking for _strtod_l - found<br>
– Not using libkineto in a Windows build.<br>
– CUDA build detected, configuring Kineto with CUPTI support.<br>
– Looking for backtrace<br>
– Looking for backtrace - not found<br>
– Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)<br>
– don’t use NUMA<br>
– Performing Test COMPILER_SUPPORTS_NO_AVX256_SPLIT<br>
– Performing Test COMPILER_SUPPORTS_NO_AVX256_SPLIT - Failed<br>
– Using ATen parallel backend: OMP<br>
AT_INSTALL_INCLUDE_DIR include/ATen/core<br>
core header install: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/aten/src/ATen/core/TensorBody.h<br>
– NCCL operators skipped due to no CUDA support<br>
– Excluding FakeLowP operators<br>
– Including IDEEP operators<br>
– Excluding image processing operators due to no opencv<br>
– Excluding video processing operators due to no opencv<br>
– MPI operators skipped due to no MPI support<br>
– Include Observer library</p>
<h2>–<br>
– ******** Summary ********<br>
– General:<br>
–   CMake version         : 3.19.6<br>
–   CMake command         : C:/ProgramData/Miniconda3/envs/pytorch-source/Library/bin/cmake.exe<br>
–   System                : Windows<br>
–   C++ compiler          : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe<br>
–   C++ compiler id       : MSVC<br>
–   C++ compiler version  : 19.26.28806.0<br>
–   Using ccache if found : OFF<br>
–   CXX flags             : /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include -DNDEBUG -DUSE_FBGEMM -DUSE_XNNPACK<br>
–   Build type            : Release<br>
–   Compile definitions   : WIN32_LEAN_AND_MEAN;TH_BLAS_MKL;_OPENMP_NOFORCE_MANIFEST;ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;ONNX_NAMESPACE=onnx_torch;_CRT_SECURE_NO_DEPRECATE=1;MAGMA_V2;IDEEP_USE_MKL;USE_EXTERNAL_MZCRC;MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS<br>
–   CMAKE_PREFIX_PATH     : C:\ProgramData\Miniconda3\envs\pytorch-source\Lib\site-packages;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2<br>
–   CMAKE_INSTALL_PREFIX  : F:/TAID-Master/MLAV/pytorch-source/pytorch/torch</h2>
<p>–   TORCH_VERSION         : 1.9.0<br>
–   CAFFE2_VERSION        : 1.9.0<br>
–   BUILD_CAFFE2          : ON<br>
–   BUILD_CAFFE2_OPS      : ON<br>
–   BUILD_CAFFE2_MOBILE   : OFF<br>
–   BUILD_STATIC_RUNTIME_BENCHMARK: OFF<br>
–   BUILD_TENSOREXPR_BENCHMARK: OFF<br>
–   BUILD_BINARY          : OFF<br>
–   BUILD_CUSTOM_PROTOBUF : ON<br>
–     Link local protobuf : ON<br>
–   BUILD_DOCS            : OFF<br>
–   BUILD_PYTHON          : True<br>
–     Python version      : 3.8.8<br>
–     Python executable   : C:/ProgramData/Miniconda3/envs/pytorch-source/python.exe<br>
–     Pythonlibs version  : 3.8.8<br>
–     Python library      : C:/ProgramData/Miniconda3/envs/pytorch-source/libs/python38.lib<br>
–     Python includes     : C:/ProgramData/Miniconda3/envs/pytorch-source/include<br>
–     Python site-packages: Lib/site-packages<br>
–   BUILD_SHARED_LIBS     : ON<br>
–   CAFFE2_USE_MSVC_STATIC_RUNTIME     : OFF<br>
–   BUILD_TEST            : True<br>
–   BUILD_JNI             : OFF<br>
–   BUILD_MOBILE_AUTOGRAD : OFF<br>
–   BUILD_LITE_INTERPRETER: OFF<br>
–   INTERN_BUILD_MOBILE   :<br>
–   USE_BLAS              : 1<br>
–     BLAS                : mkl<br>
–   USE_LAPACK            : 1<br>
–     LAPACK              : mkl<br>
–   USE_ASAN              : OFF<br>
–   USE_CPP_CODE_COVERAGE : OFF<br>
–   USE_CUDA              : ON<br>
–     Split CUDA          : OFF<br>
–     CUDA static link    : OFF<br>
–     USE_CUDNN           : ON<br>
–     CUDA version        : 11.2<br>
–     cuDNN version       : 8.1.1<br>
–     CUDA root directory : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2<br>
–     CUDA library        : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cuda.lib<br>
–     cudart library      : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudart_static.lib<br>
–     cublas library      : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cublas.lib<br>
–     cufft library       : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cufft.lib<br>
–     curand library      : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/curand.lib<br>
–     cuDNN library       : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudnn.lib<br>
–     nvrtc               : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/nvrtc.lib<br>
–     CUDA include path   : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/include<br>
–     NVCC executable     : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe<br>
–     NVCC flags          : -Xcompiler;/w;-w;-Xfatbin;-compress-all;-DONNX_NAMESPACE=onnx_torch;–use-local-env;-gencode;arch=compute_75,code=sm_75;-Xcudafe;–diag_suppress=cc_clobber_ignored,–diag_suppress=integer_sign_change,–diag_suppress=useless_using_declaration,–diag_suppress=set_but_not_used,–diag_suppress=field_without_dll_interface,–diag_suppress=base_class_has_different_dll_interface,–diag_suppress=dll_interface_conflict_none_assumed,–diag_suppress=dll_interface_conflict_dllexport_assumed,–diag_suppress=implicit_return_from_non_void_function,–diag_suppress=unsigned_compare_with_zero,–diag_suppress=declared_but_not_referenced,–diag_suppress=bad_friend_decl;–Werror;cross-execution-space-call;–no-host-device-move-forward;-Xcompiler;-MD$&lt;$<a>CONFIG:Debug</a>:d&gt;;–expt-relaxed-constexpr;–expt-extended-lambda;-Xcompiler=/wd4819,/wd4503,/wd4190,/wd4244,/wd4251,/wd4275,/wd4522;-Wno-deprecated-gpu-targets;–expt-extended-lambda;-DCUDA_HAS_FP16=1;-D__CUDA_NO_HALF_OPERATORS__;-D__CUDA_NO_HALF_CONVERSIONS__;-D__CUDA_NO_BFLOAT16_CONVERSIONS__;-D__CUDA_NO_HALF2_OPERATORS__<br>
–     CUDA host compiler  : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe<br>
–     NVCC --device-c     : OFF<br>
–     USE_TENSORRT        : OFF<br>
–   USE_ROCM              : OFF<br>
–   USE_EIGEN_FOR_BLAS    :<br>
–   USE_FBGEMM            : ON<br>
–     USE_FAKELOWP          : OFF<br>
–   USE_KINETO            : OFF<br>
–   USE_FFMPEG            : OFF<br>
–   USE_GFLAGS            : OFF<br>
–   USE_GLOG              : OFF<br>
–   USE_LEVELDB           : OFF<br>
–   USE_LITE_PROTO        : OFF<br>
–   USE_LMDB              : OFF<br>
–   USE_METAL             : OFF<br>
–   USE_PYTORCH_METAL     : OFF<br>
–   USE_FFTW              : OFF<br>
–   USE_MKL               : ON<br>
–   USE_MKLDNN            : ON<br>
–   USE_MKLDNN_CBLAS      : OFF<br>
–   USE_NCCL              : OFF<br>
–   USE_NNPACK            : OFF<br>
–   USE_NUMPY             : ON<br>
–   USE_OBSERVERS         : ON<br>
–   USE_OPENCL            : OFF<br>
–   USE_OPENCV            : OFF<br>
–   USE_OPENMP            : ON<br>
–   USE_TBB               : OFF<br>
–   USE_VULKAN            : OFF<br>
–   USE_PROF              : OFF<br>
–   USE_QNNPACK           : OFF<br>
–   USE_PYTORCH_QNNPACK   : OFF<br>
–   USE_REDIS             : OFF<br>
–   USE_ROCKSDB           : OFF<br>
–   USE_ZMQ               : OFF<br>
–   USE_DISTRIBUTED       : ON<br>
–     USE_MPI             : OFF<br>
–     USE_GLOO            : ON<br>
–     USE_TENSORPIPE      : OFF<br>
–   USE_DEPLOY           : OFF<br>
–   Public Dependencies  : Threads::Threads;caffe2::mkl;caffe2::mkldnn<br>
–   Private Dependencies : pthreadpool;cpuinfo;XNNPACK;fbgemm;fp16;gloo;aten_op_header_gen;foxi_loader;fmt::fmt-header-only<br>
– Configuring done<br>
– Generating done</p>
</blockquote>

username: ptrblck
cooked: <p>What does <code>torch.cuda.get_arch_list()</code> print?<br>
The error is usually raised, if your current device needs an architecture, which was not used while building PyTorch.<br>
I’m not familiar with Windows builds so don’t know exactly how <code>sm_75</code> is passed to the build.</p>

username: George_Guliman
cooked: <p>Hello <a class="mention" href="/u/ptrblck">@ptrblck</a> , thanks for replying.<br>
The command prints the following:</p>
<blockquote>
<p>import torch<br>
torch.cuda.get_arch_list()<br>
[‘sm_75’]</p>
</blockquote>
<p>Yes, that is my impression as well however, i don’t really know how to pass the needed architecture to the build. I tried using the  “TORCH_CUDA_ARCH_LIST = 7.5” environment variable to fix it but it seems that it’s not enough…<br>
Do you know how sm_75 is passed on linux? Maybe it’s the same mechanism on windows as well<br>
Anyway, it seems that the command outputs the expected architecture so, how to go from here?</p>
<p>Thank you in advance,</p>

username: ptrblck
cooked: <p>Yes, this looks correct and <code>TORCH_CUDA_ARCH_LIST</code> is also used on Linux.<br>
Could you add <code>7.0</code> to the <code>7.5</code> architecture and rebuild it?<br>
If this is working, it could point towards an issue with the compute capabilities in the compiler.</p>

username: George_Guliman
cooked: <p>Hello <a class="mention" href="/u/ptrblck">@ptrblck</a>, thank you for the suggestion.<br>
I tried also adding sm_70 as you suggested, but the behavior is the same <img src="https://discuss.pytorch.org/images/emoji/apple/frowning.png?v=12" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"> :</p>
<blockquote>
<p>torch.cuda.get_arch_list()<br>
[‘sm_70’, ‘sm_75’]<br>
torch.randn(1, device=“cuda”)<br>
Traceback (most recent call last):<br>
File “”, line 1, in <br>
RuntimeError: CUDA error: no kernel image is available for execution on the device</p>
</blockquote>

username: ptrblck
cooked: <p>That doesn’t seem right. Could you share the exact build command you’ve been using so that I could try to reproduce it locally on a Turing GPU?</p>

username: George_Guliman
cooked: <p>I tried different variants and on all of them I ended up with the same results<br>
1.</p>
<blockquote>
<p>python setup.py install</p>
</blockquote>
<ol start="2">
<li></li>
</ol>
<blockquote>
<p>python setup.py build --cmake<br>
python setup.py install</p>
</blockquote>
<ol start="3">
<li></li>
</ol>
<blockquote>
<p>python setup.py install --cmake</p>
</blockquote>
<p>Variant 3) is the last one I used.</p>
<p>Thank you,</p>

username: ptrblck
cooked: <p>This seems to be a standard build and I’m unable to reproduce the issue:</p>
<pre><code class="lang-python">&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.version.cuda
'10.2'
&gt;&gt;&gt; torch.cuda.get_arch_list()
['sm_75']
&gt;&gt;&gt; torch.cuda.get_device_name()
'GeForce RTX 2080 Ti'
&gt;&gt;&gt; x = torch.randn(1024, 1024).cuda()
&gt;&gt;&gt; y = torch.matmul(x, x)
&gt;&gt;&gt; print(y.shape)
torch.Size([1024, 1024])
&gt;&gt;&gt; print(y.device)
cuda:0
&gt;&gt;&gt; exit()
</code></pre>
<p>Are you able to run any other workload on this GPU? E.g. the CUDA samples or PyTorch via a docker container or the pip wheels / conda binaries?</p>

username: George_Guliman
cooked: <p>Yes, I was able to run the matrixMul cuda sample:</p>
<blockquote>
<p>[Matrix Multiply Using CUDA] - Starting…<br>
GPU Device 0: “Turing” with compute capability 7.5</p>
<p>MatrixA(320,320), MatrixB(640,320)<br>
Computing result using CUDA Kernel…<br>
done<br>
Performance= 70.49 GFlop/s, Time= 1.859 msec, Size= 131072000 Ops, WorkgroupSize= 1024 threads/block<br>
Checking computed result for correctness: Result = PASS</p>
<p>NOTE: The CUDA Samples are not meant for performancemeasurements. Results may vary when GPU Boost is enabled.</p>
<p>C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\0_Simple\matrixMul../…/bin/win64/Debug/matrixMul.exe (process 14432) exited with code 0.</p>
</blockquote>
<p>Unfortunately I can’t test pytorch from a container because this would imply setting up cuda on WSL and for this I need to use the windows preview builds, which I don’t want to do because this is my main machine.</p>
<p>Related to the conda or pip binaries, yes, I have tried them and it’s working but there is a problem there also. Using the prebuild binaries, every time I execute the first instruction on GPU, it takes around 15 minutes to execute it. After that, every succeeding instructions on the same python kernel are execute instantly. This is one of the reasons for which I want to try installing from source.</p>
<p>Appreciate your effort in helping me with this.</p>

username: ptrblck
cooked: <p>Thanks for the update. So it seems to be related to <a href="https://discuss.pytorch.org/t/cublas-status-execution-failed-when-calling-cublassgemm-handle-opa-opb-m-n-k-alpha-a-lda-b-ldb-beta-c-ldc/116740">this issue</a>.</p>
<p>I asked this in the other thread already, but are you installing the latest PyTorch version (<code>1.8.1</code>) or the nightly?</p>

username: George_Guliman
cooked: <p>As the pre-build conda packages, yes. I currently have pytorch 1.8.1 but in the past I also tried the nightly version and had the same issue.</p>
<p>But, it  seems that the issue I am encountering while trying to install from source is different from the problem I have with the conda binaries.</p>
<p>Anyway, main goal is to get an environment on which I would be able to use cuda with pytorch <img src="https://discuss.pytorch.org/images/emoji/apple/sweat_smile.png?v=9" title=":sweat_smile:" class="emoji" alt=":sweat_smile:"></p>

username: ptrblck
cooked: <aside class="quote no-group" data-username="George_Guliman" data-post="11" data-topic="116392">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/48/36428_2.png" class="avatar"> George_Guliman:</div>
<blockquote>
<p>But, it seems that the issue I am encountering while trying to install from source is different from the problem I have with the conda binaries.</p>
</blockquote>
</aside>
<p>I think they might be related.<br>
The slow startup time using the binaries points towards the CUDA JIT, which would be used, if a compute capability is missing, while the error you are seeing in the source build is also claiming that the expected compute capability is missing for your device.<br>
Are you using any other GPU in this system or only the Turing one?</p>

username: George_Guliman
cooked: <p>I use only the Turing one. There is also the intel integrated one but it’s disabled.</p>
<p>I don’t know if this should matter but I also used cuda 10.2 in the past on this same machine but before trying to install pytorch from source I uninstalled it and installed 11.2.</p>

username: George_Guliman
cooked: <p>Have some updates.</p>
<p>I tried uninstalling all my cuda stuff and installed cuda 10.2 from scratch. I managed to build pytorch with cuda 10.2. This is where I discovered the following behavior:</p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>import torch<br>
torch.randn(1, device=“cuda”)<br>
Traceback (most recent call last):<br>
File “”, line 1, in <br>
RuntimeError: CUDA error: no kernel image is available for execution on the device<br>
x = torch.randn(1024, 1024).cuda()<br>
print(x.device)<br>
cuda:0<br>
y = torch.matmul(x, x)<br>
Traceback (most recent call last):<br>
File “”, line 1, in <br>
RuntimeError: CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling <code>cublasCreate(handle)</code></p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p>So I think the fact I am now using cuda 10.2 has nothing to do with this behaviour. I think it also behaved this way before, when I was on cuda 11.2.</p>
<p>Does this info point in any direction?</p>

username: xwang233
cooked: <p>Hi, have you tried to uninstall pytorch before pip install or build from source?</p>
<pre><code class="lang-auto">pip uninstall torch -y
pip uninstall torch -y
pip uninstall torch -y
pip uninstall torch -y
pip uninstall torch -y
conda uninstall pytorch -y
conda uninstall pytorch -y
conda uninstall pytorch -y
conda uninstall pytorch -y
conda uninstall pytorch -y
</code></pre>
<p>Also, if you build from source, it’s also nice to have <code>python setup.py clean</code> a few times before <code>python setup.py install</code> as well.</p>

username: George_Guliman
cooked: <p>Hello,</p>
<p>Yes, I created a new conda environment and also ran <code>python setup.py clean</code> before doing <code>install</code>.<br>
I give up and will switch to a linux distribution… hope the binaries work there. <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>