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

**URL:** <https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392>\
**Category:** windows\
**Created:** [March 29, 2021, 7:48pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392 "2021-03-29T19:48:51Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [March 29, 2021, 7:48pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/1 "2021-03-29T19:48:51Z")

</div>

Hello,

I am trying to install pytorch with cuda by following the build from source method.  
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)

I am trying to build pytorch from a conda environment and I installed all the pre-requisites mentioned in the [guide](https://github.com/pytorch/pytorch#from-source).  
Before running _setup.py install --cmake_, I tried to set the following env variables:

> MAGMA\_HOME F:\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\magma  
> LIB F:\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\mkl\lib  
> CMAKE\_GENERATOR Ninja  
> TORCH\_CUDA\_ARCH\_LIST 7.5  
> CMAKE\_INCLUDE\_PATH F:\pytorch-source\pytorch.jenkins\pytorch\win-test-helpers\installation-helpers\mkl\include

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:

> > > > import torch  
> > > > torch.cuda.is\_available()  
> > > > True  
> > > > torch.cuda.current\_device()  
> > > > 0  
> > > > torch.cuda.device(0)  
> > > > \<torch.cuda.device object at 0x000002731D947640\>  
> > > > torch.cuda.device\_count()  
> > > > 1  
> > > > torch.cuda.get\_device\_name(0)  
> > > > ‘GeForce RTX 2070’  
> > > > torch.randn(1, device=“cuda”)  
> > > > Traceback (most recent call last):  
> > > > File “”, line 1, in   
> > > > RuntimeError: CUDA error: no kernel image is available for execution on the device

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.

Below, you can find the beginning of the build log that should show the environment details and config options used for build:

> – Building version 1.9.0a0+git01b1557  
> 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  
> – The CXX compiler identification is MSVC 19.26.28806.0  
> – The C compiler identification is MSVC 19.26.28806.0  
> – Detecting CXX compiler ABI info  
> – Detecting CXX compiler ABI info - done  
> – 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  
> – Detecting CXX compile features  
> – Detecting CXX compile features - done  
> – Detecting C compiler ABI info  
> – Detecting C compiler ABI info - done  
> – 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  
> – Detecting C compile features  
> – Detecting C compile features - done  
> – Not forcing any particular BLAS to be found  
> CMake Warning at CMakeLists.txt:305 (message):  
> TensorPipe cannot be used on Windows. Set it to OFF
> 
> ## – Performing Test COMPILER\_WORKS – Performing Test COMPILER\_WORKS - Success – Performing Test SUPPORT\_GLIBCXX\_USE\_C99 – Performing Test SUPPORT\_GLIBCXX\_USE\_C99 - Success – Performing Test CAFFE2\_EXCEPTION\_PTR\_SUPPORTED – Performing Test CAFFE2\_EXCEPTION\_PTR\_SUPPORTED - Success – std::exception\_ptr is supported. – Performing Test CAFFE2\_NEED\_TO\_TURN\_OFF\_DEPRECATION\_WARNING – Performing Test CAFFE2\_NEED\_TO\_TURN\_OFF\_DEPRECATION\_WARNING - Failed – Performing Test CAFFE2\_COMPILER\_SUPPORTS\_AVX2\_EXTENSIONS – Performing Test CAFFE2\_COMPILER\_SUPPORTS\_AVX2\_EXTENSIONS - Success – Current compiler supports avx2 extension. Will build perfkernels. – Performing Test CAFFE2\_COMPILER\_SUPPORTS\_AVX512\_EXTENSIONS – Performing Test CAFFE2\_COMPILER\_SUPPORTS\_AVX512\_EXTENSIONS - Success – Current compiler supports avx512f extension. Will build fbgemm. – Performing Test COMPILER\_SUPPORTS\_HIDDEN\_VISIBILITY – Performing Test COMPILER\_SUPPORTS\_HIDDEN\_VISIBILITY - Failed – Performing Test COMPILER\_SUPPORTS\_HIDDEN\_INLINE\_VISIBILITY – Performing Test COMPILER\_SUPPORTS\_HIDDEN\_INLINE\_VISIBILITY - Failed – Performing Test COMPILER\_SUPPORTS\_RDYNAMIC – Performing Test COMPILER\_SUPPORTS\_RDYNAMIC - Failed – Building using own protobuf under third\_party per request. – Use custom protobuf build.
> 
> – 3.11.4.0  
> – Looking for pthread.h  
> – Looking for pthread.h - not found  
> – Found Threads: TRUE  
> – Caffe2 protobuf include directory: $\<BUILD\_INTERFACE:F:/TAID-Master/MLAV/pytorch-source/pytorch/third\_party/protobuf/src\>$\<INSTALL\_INTERFACE:include\>  
> – Trying to find preferred BLAS backend of choice: MKL  
> – MKL\_THREADING = OMP  
> – Looking for sys/types.h  
> – Looking for sys/types.h - found  
> – Looking for stdint.h  
> – Looking for stdint.h - found  
> – Looking for stddef.h  
> – Looking for stddef.h - found  
> – Check size of void\*  
> – Check size of void\* - done  
> – Looking for cblas\_sgemm  
> – Looking for cblas\_sgemm - found  
> – 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  
> – MKL include directory: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include  
> – MKL OpenMP type: Intel  
> – MKL OpenMP library: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/libiomp5md.lib  
> – The ASM compiler identification is MSVC  
> – Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe  
> CMake Deprecation Warning at third\_party/googletest/CMakeLists.txt:1 (cmake\_minimum\_required):  
> Compatibility with CMake \< 2.8.12 will be removed from a future version of  
> CMake.
> 
> \*\* AsmJit Summary \*\*  
> ASMJIT\_DIR=F:/TAID-Master/MLAV/pytorch-source/pytorch/third\_party/fbgemm/third\_party/asmjit  
> ASMJIT\_TEST=FALSE  
> ASMJIT\_TARGET\_TYPE=SHARED  
> ASMJIT\_DEPS=  
> ASMJIT\_LIBS=asmjit  
> ASMJIT\_CFLAGS=  
> ASMJIT\_PRIVATE\_CFLAGS=-MP;-GF;-Zc:inline;-Zc:strictStrings;-Zc:threadSafeInit-;-W4  
> ASMJIT\_PRIVATE\_CFLAGS\_DBG=-GS  
> ASMJIT\_PRIVATE\_CFLAGS\_REL=-GS-;-O2;-Oi  
> – Using third party subdirectory Eigen.  
> – Found PythonInterp: C:/ProgramData/Miniconda3/envs/pytorch-source/python.exe (found suitable version “3.8.8”, minimum required is “3.0”)  
> – Found PythonLibs: C:/ProgramData/Miniconda3/envs/pytorch-source/libs/python38.lib (found suitable version “3.8.8”, minimum required is “3.0”)  
> – Could NOT find pybind11 (missing: pybind11\_DIR)  
> – Could NOT find pybind11 (missing: pybind11\_INCLUDE\_DIR)  
> – Using third\_party/pybind11.  
> – pybind11 include dirs: F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/…/third\_party/pybind11/include  
> – Could NOT find MPI\_C (missing: MPI\_C\_LIB\_NAMES MPI\_C\_HEADER\_DIR MPI\_C\_WORKS)  
> – Could NOT find MPI\_CXX (missing: MPI\_CXX\_LIB\_NAMES MPI\_CXX\_HEADER\_DIR MPI\_CXX\_WORKS)  
> – Could NOT find MPI (missing: MPI\_C\_FOUND MPI\_CXX\_FOUND)  
> Reason given by package: MPI component ‘Fortran’ was requested, but language Fortran is not enabled.
> 
> CMake Warning at cmake/Dependencies.cmake:1045 (message):  
> Not compiling with MPI. Suppress this warning with -DUSE\_MPI=OFF  
> Call Stack (most recent call first):  
> CMakeLists.txt:604 (include)
> 
> – Adding OpenMP CXX\_FLAGS: -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include  
> – Will link against OpenMP libraries: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/lib/libiomp5md.lib  
> – Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2 (found version “11.2”)  
> – Caffe2: CUDA detected: 11.2  
> – Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe  
> – Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2  
> – Caffe2: Header version is: 11.2  
> – Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudnn.lib  
> – 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)  
> – C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/nvrtc.lib shorthash is aa1d5a72  
> CMake Warning at cmake/public/utils.cmake:365 (message):  
> In the future we will require one to explicitly pass TORCH\_CUDA\_ARCH\_LIST  
> to cmake instead of implicitly setting it as an env variable. This will  
> become a FATAL\_ERROR in future version of pytorch.  
> Call Stack (most recent call first):  
> cmake/public/cuda.cmake:483 (torch\_cuda\_get\_nvcc\_gencode\_flag)  
> cmake/Dependencies.cmake:1150 (include)  
> CMakeLists.txt:604 (include)
> 
> – Added CUDA NVCC flags for: -gencode;arch=compute\_75,code=sm\_75  
> – Found CUB: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/include  
> CMake Warning (dev) at third\_party/gloo/CMakeLists.txt:21 (option):  
> Policy CMP0077 is not set: option() honors normal variables. Run “cmake  
> –help-policy CMP0077” for policy details. Use the cmake\_policy command to  
> set the policy and suppress this warning.
> 
> For compatibility with older versions of CMake, option is clearing the  
> normal variable ‘BUILD\_BENCHMARK’.  
> This warning is for project developers. Use -Wno-dev to suppress it.
> 
> CMake Warning (dev) at third\_party/gloo/CMakeLists.txt:34 (option):  
> Policy CMP0077 is not set: option() honors normal variables. Run “cmake  
> –help-policy CMP0077” for policy details. Use the cmake\_policy command to  
> set the policy and suppress this warning.  
> – MSVC detected  
> – Set USE\_REDIS OFF  
> – Set USE\_IBVERBS OFF  
> – Set USE\_NCCL OFF  
> – Set USE\_RCCL OFF  
> – Set USE\_LIBUV ON  
> – Only USE\_LIBUV is supported on Windows  
> – Gloo build as SHARED library
> 
> – Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2 (found suitable version “11.2”, minimum required is “7.0”)  
> – CUDA detected: 11.2  
> CMake Warning at cmake/Dependencies.cmake:1394 (message):  
> Metal is only used in ios builds.  
> Call Stack (most recent call first):  
> CMakeLists.txt:604 (include)
> 
> ## Generated: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/third\_party/onnx/onnx/onnx\_onnx\_torch-ml.proto Generated: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/third\_party/onnx/onnx/onnx-operators\_onnx\_torch-ml.proto Generated: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/third\_party/onnx/onnx/onnx-data\_onnx\_torch.proto
> 
> ## – \*\*\*\*\*\*\*\* Summary \*\*\*\*\*\*\*\* – CMake version : 3.19.6 – CMake command : C:/ProgramData/Miniconda3/envs/pytorch-source/Library/bin/cmake.exe – System : Windows – C++ compiler : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe – C++ compiler version : 19.26.28806.0 – 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 – Build type : Release – Compile definitions : WIN32\_LEAN\_AND\_MEAN;TH\_BLAS\_MKL;\_OPENMP\_NOFORCE\_MANIFEST;ONNX\_ML=1;ONNXIFI\_ENABLE\_EXT=1 – 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 – CMAKE\_INSTALL\_PREFIX : F:/TAID-Master/MLAV/pytorch-source/pytorch/torch – CMAKE\_MODULE\_PATH : F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/Modules;F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/public/…/Modules\_CUDA\_fix
> 
> ## – ONNX version : 1.8.0 – ONNX NAMESPACE : onnx\_torch – ONNX\_BUILD\_TESTS : OFF – ONNX\_BUILD\_BENCHMARKS : OFF – ONNX\_USE\_LITE\_PROTO : OFF – ONNXIFI\_DUMMY\_BACKEND : OFF – ONNXIFI\_ENABLE\_EXT : OFF
> 
> ## – Protobuf compiler : – Protobuf includes : – Protobuf libraries : – BUILD\_ONNX\_PYTHON : OFF
> 
> ## – \*\*\*\*\*\*\*\* Summary \*\*\*\*\*\*\*\* – CMake version : 3.19.6 – CMake command : C:/ProgramData/Miniconda3/envs/pytorch-source/Library/bin/cmake.exe – System : Windows – C++ compiler : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe – C++ compiler version : 19.26.28806.0 – 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 – Build type : Release – Compile definitions : WIN32\_LEAN\_AND\_MEAN;TH\_BLAS\_MKL;\_OPENMP\_NOFORCE\_MANIFEST;ONNX\_ML=1;ONNXIFI\_ENABLE\_EXT=1 – 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 – CMAKE\_INSTALL\_PREFIX : F:/TAID-Master/MLAV/pytorch-source/pytorch/torch – CMAKE\_MODULE\_PATH : F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/Modules;F:/TAID-Master/MLAV/pytorch-source/pytorch/cmake/public/…/Modules\_CUDA\_fix
> 
> ## – ONNX version : 1.4.1 – ONNX NAMESPACE : onnx\_torch – ONNX\_BUILD\_TESTS : OFF – ONNX\_BUILD\_BENCHMARKS : OFF – ONNX\_USE\_LITE\_PROTO : OFF – ONNXIFI\_DUMMY\_BACKEND : OFF
> 
> – Protobuf compiler :  
> – Protobuf includes :  
> – Protobuf libraries :  
> – BUILD\_ONNX\_PYTHON : OFF  
> – Found CUDA with FP16 support, compiling with torch.cuda.HalfTensor  
> – Adding -DNDEBUG to compile flags  
> – Checking prototype magma\_get\_sgeqrf\_nb for MAGMA\_V2  
> – Checking prototype magma\_get\_sgeqrf\_nb for MAGMA\_V2 - True  
> – Compiling with MAGMA support  
> – MAGMA INCLUDE DIRECTORIES: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/magma/include  
> – MAGMA LIBRARIES: F:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/magma/lib/magma.lib  
> – MAGMA V2 check: 1  
> – Could not find hardware support for NEON on this machine.  
> – No OMAP3 processor on this machine.  
> – No OMAP4 processor on this machine.  
> – Looking for cpuid.h  
> – Looking for cpuid.h - not found  
> – Performing Test NO\_GCC\_EBX\_FPIC\_BUG  
> – Performing Test NO\_GCC\_EBX\_FPIC\_BUG - Failed  
> – Performing Test C\_HAS\_AVX\_1  
> – Performing Test C\_HAS\_AVX\_1 - Success  
> – Performing Test C\_HAS\_AVX2\_1  
> – Performing Test C\_HAS\_AVX2\_1 - Success  
> – Performing Test CXX\_HAS\_AVX\_1  
> – Performing Test CXX\_HAS\_AVX\_1 - Success  
> – Performing Test CXX\_HAS\_AVX2\_1  
> – Performing Test CXX\_HAS\_AVX2\_1 - Success  
> – AVX compiler support found  
> – AVX2 compiler support found  
> – Performing Test BLAS\_F2C\_DOUBLE\_WORKS  
> – Performing Test BLAS\_F2C\_DOUBLE\_WORKS - Failed  
> – Performing Test BLAS\_F2C\_FLOAT\_WORKS  
> – Performing Test BLAS\_F2C\_FLOAT\_WORKS - Success  
> – Performing Test BLAS\_USE\_CBLAS\_DOT  
> – Performing Test BLAS\_USE\_CBLAS\_DOT - Success  
> – 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)  
> – Found a library with LAPACK API (mkl).  
> disabling ROCM because NOT USE\_ROCM is set  
> – MIOpen not found. Compiling without MIOpen support  
> – MKLDNN\_CPU\_RUNTIME = OMP  
> CMake Deprecation Warning at third\_party/ideep/mkl-dnn/CMakeLists.txt:17 (cmake\_minimum\_required):  
> Compatibility with CMake \< 2.8.12 will be removed from a future version of  
> CMake.
> 
> Update the VERSION argument value or use a … suffix to tell  
> CMake that the project does not need compatibility with older versions.
> 
> – Intel MKL-DNN compat: set DNNL\_ENABLE\_CONCURRENT\_EXEC to MKLDNN\_ENABLE\_CONCURRENT\_EXEC with value `ON`  
> – Intel MKL-DNN compat: set DNNL\_BUILD\_EXAMPLES to MKLDNN\_BUILD\_EXAMPLES with value `FALSE`  
> – Intel MKL-DNN compat: set DNNL\_BUILD\_TESTS to MKLDNN\_BUILD\_TESTS with value `FALSE`  
> – Intel MKL-DNN compat: set DNNL\_LIBRARY\_TYPE to MKLDNN\_LIBRARY\_TYPE with value `STATIC`  
> – Intel MKL-DNN compat: set DNNL\_ARCH\_OPT\_FLAGS to MKLDNN\_ARCH\_OPT\_FLAGS with value ``  
> – Intel MKL-DNN compat: set DNNL\_CPU\_RUNTIME to MKLDNN\_CPU\_RUNTIME with value `OMP`
> 
> – Found OpenMP\_CXX: -openmp:experimental -IF:/TAID-Master/MLAV/pytorch-source/pytorch/.jenkins/pytorch/win-test-helpers/installation-helpers/mkl/include  
> – GPU support is disabled  
> – Primitive cache is enabled  
> – Found MKL-DNN: TRUE  
> – Performing Test C\_HAS\_THREAD  
> – Performing Test C\_HAS\_THREAD - Success  
> – Version: 7.0.3  
> – Build type: Release  
> – CXX\_STANDARD: 14  
> – Performing Test has\_std\_14\_flag  
> – Performing Test has\_std\_14\_flag - Failed  
> – Performing Test has\_std\_1y\_flag  
> – Performing Test has\_std\_1y\_flag - Failed  
> – Performing Test SUPPORTS\_USER\_DEFINED\_LITERALS  
> – Performing Test SUPPORTS\_USER\_DEFINED\_LITERALS - Success  
> – Performing Test FMT\_HAS\_VARIANT  
> – Performing Test FMT\_HAS\_VARIANT - Success  
> – Required features: cxx\_variadic\_templates  
> – Looking for \_strtod\_l  
> – Looking for \_strtod\_l - found  
> – Not using libkineto in a Windows build.  
> – CUDA build detected, configuring Kineto with CUPTI support.  
> – Looking for backtrace  
> – Looking for backtrace - not found  
> – Could NOT find Backtrace (missing: Backtrace\_LIBRARY Backtrace\_INCLUDE\_DIR)  
> – don’t use NUMA  
> – Performing Test COMPILER\_SUPPORTS\_NO\_AVX256\_SPLIT  
> – Performing Test COMPILER\_SUPPORTS\_NO\_AVX256\_SPLIT - Failed  
> – Using ATen parallel backend: OMP  
> AT\_INSTALL\_INCLUDE\_DIR include/ATen/core  
> core header install: F:/TAID-Master/MLAV/pytorch-source/pytorch/build/aten/src/ATen/core/TensorBody.h  
> – NCCL operators skipped due to no CUDA support  
> – Excluding FakeLowP operators  
> – Including IDEEP operators  
> – Excluding image processing operators due to no opencv  
> – Excluding video processing operators due to no opencv  
> – MPI operators skipped due to no MPI support  
> – Include Observer library
> 
> ## – – \*\*\*\*\*\*\*\* Summary \*\*\*\*\*\*\*\* – General: – CMake version : 3.19.6 – CMake command : C:/ProgramData/Miniconda3/envs/pytorch-source/Library/bin/cmake.exe – System : Windows – C++ compiler : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe – C++ compiler id : MSVC – C++ compiler version : 19.26.28806.0 – Using ccache if found : OFF – 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 – Build type : Release – 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 – 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 – CMAKE\_INSTALL\_PREFIX : F:/TAID-Master/MLAV/pytorch-source/pytorch/torch
> 
> – TORCH\_VERSION : 1.9.0  
> – CAFFE2\_VERSION : 1.9.0  
> – BUILD\_CAFFE2 : ON  
> – BUILD\_CAFFE2\_OPS : ON  
> – BUILD\_CAFFE2\_MOBILE : OFF  
> – BUILD\_STATIC\_RUNTIME\_BENCHMARK: OFF  
> – BUILD\_TENSOREXPR\_BENCHMARK: OFF  
> – BUILD\_BINARY : OFF  
> – BUILD\_CUSTOM\_PROTOBUF : ON  
> – Link local protobuf : ON  
> – BUILD\_DOCS : OFF  
> – BUILD\_PYTHON : True  
> – Python version : 3.8.8  
> – Python executable : C:/ProgramData/Miniconda3/envs/pytorch-source/python.exe  
> – Pythonlibs version : 3.8.8  
> – Python library : C:/ProgramData/Miniconda3/envs/pytorch-source/libs/python38.lib  
> – Python includes : C:/ProgramData/Miniconda3/envs/pytorch-source/include  
> – Python site-packages: Lib/site-packages  
> – BUILD\_SHARED\_LIBS : ON  
> – CAFFE2\_USE\_MSVC\_STATIC\_RUNTIME : OFF  
> – BUILD\_TEST : True  
> – BUILD\_JNI : OFF  
> – BUILD\_MOBILE\_AUTOGRAD : OFF  
> – BUILD\_LITE\_INTERPRETER: OFF  
> – INTERN\_BUILD\_MOBILE :  
> – USE\_BLAS : 1  
> – BLAS : mkl  
> – USE\_LAPACK : 1  
> – LAPACK : mkl  
> – USE\_ASAN : OFF  
> – USE\_CPP\_CODE\_COVERAGE : OFF  
> – USE\_CUDA : ON  
> – Split CUDA : OFF  
> – CUDA static link : OFF  
> – USE\_CUDNN : ON  
> – CUDA version : 11.2  
> – cuDNN version : 8.1.1  
> – CUDA root directory : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2  
> – CUDA library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cuda.lib  
> – cudart library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudart\_static.lib  
> – cublas library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cublas.lib  
> – cufft library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cufft.lib  
> – curand library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/curand.lib  
> – cuDNN library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/cudnn.lib  
> – nvrtc : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/lib/x64/nvrtc.lib  
> – CUDA include path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/include  
> – NVCC executable : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2/bin/nvcc.exe  
> – 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$\<$CONFIG:Debug:d\>;–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\_\_  
> – CUDA host compiler : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe  
> – NVCC --device-c : OFF  
> – USE\_TENSORRT : OFF  
> – USE\_ROCM : OFF  
> – USE\_EIGEN\_FOR\_BLAS :  
> – USE\_FBGEMM : ON  
> – USE\_FAKELOWP : OFF  
> – USE\_KINETO : OFF  
> – USE\_FFMPEG : OFF  
> – USE\_GFLAGS : OFF  
> – USE\_GLOG : OFF  
> – USE\_LEVELDB : OFF  
> – USE\_LITE\_PROTO : OFF  
> – USE\_LMDB : OFF  
> – USE\_METAL : OFF  
> – USE\_PYTORCH\_METAL : OFF  
> – USE\_FFTW : OFF  
> – USE\_MKL : ON  
> – USE\_MKLDNN : ON  
> – USE\_MKLDNN\_CBLAS : OFF  
> – USE\_NCCL : OFF  
> – USE\_NNPACK : OFF  
> – USE\_NUMPY : ON  
> – USE\_OBSERVERS : ON  
> – USE\_OPENCL : OFF  
> – USE\_OPENCV : OFF  
> – USE\_OPENMP : ON  
> – USE\_TBB : OFF  
> – USE\_VULKAN : OFF  
> – USE\_PROF : OFF  
> – USE\_QNNPACK : OFF  
> – USE\_PYTORCH\_QNNPACK : OFF  
> – USE\_REDIS : OFF  
> – USE\_ROCKSDB : OFF  
> – USE\_ZMQ : OFF  
> – USE\_DISTRIBUTED : ON  
> – USE\_MPI : OFF  
> – USE\_GLOO : ON  
> – USE\_TENSORPIPE : OFF  
> – USE\_DEPLOY : OFF  
> – Public Dependencies : Threads::Threads;caffe2::mkl;caffe2::mkldnn  
> – Private Dependencies : pthreadpool;cpuinfo;XNNPACK;fbgemm;fp16;gloo;aten\_op\_header\_gen;foxi\_loader;fmt::fmt-header-only  
> – Configuring done  
> – Generating done

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [March 30, 2021, 7:33am UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/2 "2021-03-30T07:33:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [March 30, 2021, 9:08am UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/3 "2021-03-30T09:08:19Z")

</div>

Hello @ptrblck , thanks for replying.  
The command prints the following:

> import torch  
> torch.cuda.get\_arch\_list()  
> [‘sm\_75’]

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…  
Do you know how sm\_75 is passed on linux? Maybe it’s the same mechanism on windows as well  
Anyway, it seems that the command outputs the expected architecture so, how to go from here?

Thank you in advance,

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [March 30, 2021, 8:29pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/4 "2021-03-30T20:29:43Z")

</div>

Yes, this looks correct and `TORCH_CUDA_ARCH_LIST` is also used on Linux.  
Could you add `7.0` to the `7.5` architecture and rebuild it?  
If this is working, it could point towards an issue with the compute capabilities in the compiler.

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [March 31, 2021, 2:57pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/5 "2021-03-31T14:57:32Z")

</div>

Hello @ptrblck, thank you for the suggestion.  
I tried also adding sm\_70 as you suggested, but the behavior is the same ☹ :

> torch.cuda.get\_arch\_list()  
> [‘sm\_70’, ‘sm\_75’]  
> torch.randn(1, device=“cuda”)  
> Traceback (most recent call last):  
> File “”, line 1, in   
> RuntimeError: CUDA error: no kernel image is available for execution on the device

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 1, 2021, 12:09am UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/6 "2021-04-01T00:09:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [April 1, 2021, 9:59am UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/7 "2021-04-01T09:59:08Z")

</div>

I tried different variants and on all of them I ended up with the same results  
1.

> python setup.py install

1. 

> python setup.py build --cmake  
> python setup.py install

1. 

> python setup.py install --cmake

Variant 3) is the last one I used.

Thank you,

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 1, 2021, 9:57pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/8 "2021-04-01T21:57:44Z")

</div>

This seems to be a standard build and I’m unable to reproduce the issue:

```python
>>> import torch
>>> torch.version.cuda
'10.2'
>>> torch.cuda.get_arch_list()
['sm_75']
>>> torch.cuda.get_device_name()
'GeForce RTX 2080 Ti'
>>> x = torch.randn(1024, 1024).cuda()
>>> y = torch.matmul(x, x)
>>> print(y.shape)
torch.Size([1024, 1024])
>>> print(y.device)
cuda:0
>>> exit()

```

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?

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [April 2, 2021, 11:32am UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/9 "2021-04-02T11:32:20Z")

</div>

Yes, I was able to run the matrixMul cuda sample:

> [Matrix Multiply Using CUDA] - Starting…  
> GPU Device 0: “Turing” with compute capability 7.5
> 
> MatrixA(320,320), MatrixB(640,320)  
> Computing result using CUDA Kernel…  
> done  
> Performance= 70.49 GFlop/s, Time= 1.859 msec, Size= 131072000 Ops, WorkgroupSize= 1024 threads/block  
> Checking computed result for correctness: Result = PASS
> 
> NOTE: The CUDA Samples are not meant for performancemeasurements. Results may vary when GPU Boost is enabled.
> 
> C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\0\_Simple\matrixMul../…/bin/win64/Debug/matrixMul.exe (process 14432) exited with code 0.

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.

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.

Appreciate your effort in helping me with this.

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 2, 2021, 6:58pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/10 "2021-04-02T18:58:36Z")

</div>

Thanks for the update. So it seems to be related to [this issue](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).

I asked this in the other thread already, but are you installing the latest PyTorch version (`1.8.1`) or the nightly?

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [April 2, 2021, 7:23pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/11 "2021-04-02T19:23:33Z")

</div>

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.

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.

Anyway, main goal is to get an environment on which I would be able to use cuda with pytorch 😅

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 2, 2021, 7:41pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/12 "2021-04-02T19:41:37Z")

</div>

> [@George\_Guliman](#):
>
> 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.

I think they might be related.  
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.  
Are you using any other GPU in this system or only the Turing one?

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [April 2, 2021, 9:20pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/13 "2021-04-02T21:20:27Z")

</div>

I use only the Turing one. There is also the intel integrated one but it’s disabled.

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.

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [April 6, 2021, 8:47pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/14 "2021-04-06T20:47:03Z")

</div>

Have some updates.

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:

> > > > import torch  
> > > > torch.randn(1, device=“cuda”)  
> > > > Traceback (most recent call last):  
> > > > File “”, line 1, in   
> > > > RuntimeError: CUDA error: no kernel image is available for execution on the device  
> > > > x = torch.randn(1024, 1024).cuda()  
> > > > print(x.device)  
> > > > cuda:0  
> > > > y = torch.matmul(x, x)  
> > > > Traceback (most recent call last):  
> > > > File “”, line 1, in   
> > > > RuntimeError: CUDA error: CUBLAS\_STATUS\_INTERNAL\_ERROR when calling `cublasCreate(handle)`

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.

Does this info point in any direction?

---

<div class="post-metadata">

**Author:** ![xwang233](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/x/ac8455/32.png) [@xwang233](https://discuss.pytorch.org/u/xwang233)\
**Post date:** [April 10, 2021, 6:18pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/15 "2021-04-10T18:18:29Z")

</div>

Hi, have you tried to uninstall pytorch before pip install or build from source?

```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

```

Also, if you build from source, it’s also nice to have `python setup.py clean` a few times before `python setup.py install` as well.

---

<div class="post-metadata">

**Author:** ![George\_Guliman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/george_guliman/32/36428_2.png) [@George\_Guliman](https://discuss.pytorch.org/u/George_Guliman)\
**Post date:** [April 12, 2021, 9:56pm UTC](https://discuss.pytorch.org/t/pytorch-cuda-11-2-build-from-source-runtimeerror-cuda-error-no-kernel-image-is-available-for-execution-on-the-device/116392/16 "2021-04-12T21:56:02Z")

</div>

Hello,

Yes, I created a new conda environment and also ran `python setup.py clean` before doing `install`.  
I give up and will switch to a linux distribution… hope the binaries work there. 🙂
