RuntimeError: CUDA error: no kernel image is available for execution on the device , when I use cuda in Nvidia Geforce 730 GT

ElectrikVocal_95: <p>I installed Cuda Toolkit 11.1, cnDNN the latest version, and pytorch for CUDA 11.1 from pip.</p>
<p>pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f <a href="https://download.pytorch.org/whl/torch_stable.html" rel="noopener nofollow ugc">https://download.pytorch.org/whl/torch_stable.html</a></p>
<p>I use the Anaconda3 last version with Python 3.8.5</p>
<p>And I use a Nvidia Geforce 730 GT 2Gb DDR3 ver. 128bit</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC&gt;python
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.current_device()
0
&gt;&gt;&gt; torch.cuda.device(0)
&lt;torch.cuda.device object at 0x0000019765D4E310&gt;
&gt;&gt;&gt; torch.cuda.device_count()
1
&gt;&gt;&gt; torch.cuda.get_device_name(0)
'NVIDIA GeForce GT 730'
&gt;&gt;&gt; torch.cuda.is_available()
True
&gt;&gt;&gt; t = torch.tensor(1, dtype = torch.int32, device = "cuda")
&gt;&gt;&gt; t = torch.tensor([1.1, 2.2, 3.3], dtype = torch.double64, device = "cuda")
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: module 'torch' has no attribute 'double64'
&gt;&gt;&gt; t = torch.tensor([
...     [1,1,1,1],
...     [2,2,2,2],
...     [3,3,3,3]
... ], dtype=torch.float32, device = "cuda")
&gt;&gt;&gt; exit()
</code></pre>
<p>apparently it works, right?</p>
<p>And then check that</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC\Desktop\MATI\Vtuber_HP\VtuberProject\Assets\TrackingBackend&gt;nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_22:08:44_Pacific_Standard_Time_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0
</code></pre>
<p>And check the architecture, but I don’t understand what is this?</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC\Desktop\MATI\Vtuber_HP\VtuberProject\Assets\TrackingBackend&gt;python
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.get_arch_list()
['sm_37', 'sm_50', 'sm_60', 'sm_61', 'sm_70', 'sm_75', 'sm_80', 'sm_86', 'compute_37']
&gt;&gt;&gt;   
</code></pre>
<p>It’s extrange, because I did not find errors in the installation</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC&gt;python
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; exit()

(base) C:\Users\MIPC&gt;pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.8.1+cu111
  Using cached https://download.pytorch.org/whl/cu111/torch-1.8.1%2Bcu111-cp38-cp38-win_amd64.whl (3055.7 MB)
Collecting torchvision==0.9.1+cu111
  Using cached https://download.pytorch.org/whl/cu111/torchvision-0.9.1%2Bcu111-cp38-cp38-win_amd64.whl (1.9 MB)
Collecting torchaudio===0.8.1
  Using cached torchaudio-0.8.1-cp38-none-win_amd64.whl (109 kB)
Requirement already satisfied: typing-extensions in c:\users\mipc\anaconda3\lib\site-packages (from torch==1.8.1+cu111) (3.7.4.3)
Requirement already satisfied: numpy in c:\users\mipc\anaconda3\lib\site-packages (from torch==1.8.1+cu111) (1.19.2)
Requirement already satisfied: pillow&gt;=4.1.1 in c:\users\mipc\anaconda3\lib\site-packages (from torchvision==0.9.1+cu111) (8.0.1)
Installing collected packages: torch, torchvision, torchaudio
Successfully installed torch-1.8.1+cu111 torchaudio-0.8.1 torchvision-0.9.1+
</code></pre>
<p>But when i run my code…</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "main.py", line 41, in &lt;module&gt;
    pose_data = pose_estimator.get_pose_data(img.copy())
  File "C:\Users\MIPC\Desktop\MATI\Vtuber_HP\VtuberProject\Assets\TrackingBackend\utils\pose_estimator.py", line 74, in get_pose_data
    heatmaps, pafs, scale, pad = self.infer_fast(img)
  File "C:\Users\MIPC\Desktop\MATI\Vtuber_HP\VtuberProject\Assets\TrackingBackend\utils\pose_estimator.py", line 49, in infer_fast
    stages_output = self.net(tensor_img)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "C:\Users\MIPC\Desktop\MATI\Vtuber_HP\VtuberProject\Assets\TrackingBackend\emotion_models\with_mobilenet.py", line 134, in forward
    backbone_features = self.model(x)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\container.py", line 119, in forward
    input = module(input)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\container.py", line 119, in forward
    input = module(input)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 399, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "C:\Users\MIPC\anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 395, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
RuntimeError: CUDA error: no kernel image is available for execution on the device
</code></pre>
<p>what should I do?</p>

ptrblck: <p>The GT 730 has a compute capability 3.5, which isn’t shipped in the prebuilt binaries anymore, so you could build PyTorch from source as described <a href="https://github.com/pytorch/pytorch#from-source">here</a>.</p>

ElectrikVocal_95: <p>I’m sorry but I really don’t understand what should I do with what they say on that page? <img src="https://discuss.pytorch.org/images/emoji/apple/thinking.png?v=9" title=":thinking:" class="emoji" alt=":thinking:"></p>
<p>I use CUDA Toolkit 11.1 and the cuDNN of that version. But should I download them or leave them as I have them?</p>
<ul>
<li>
<a href="https://developer.nvidia.com/cuda-downloads" rel="noopener nofollow ugc">NVIDIA CUDA</a> 9.2 or above</li>
<li>
<a href="https://developer.nvidia.com/cudnn" rel="noopener nofollow ugc">NVIDIA cuDNN</a> v7 or above</li>
</ul>
<p>And with the compiler what i need do? What do I need to download? (As it says that “or above” version I guess it would be fine, right? )</p>
<ul>
<li>
<a href="https://gist.github.com/ax3l/9489132" rel="noopener nofollow ugc">Compiler</a> compatible with CUDA Note: You could refer to the <a href="https://docs.nvidia.com/deeplearning/cudnn/pdf/cuDNN-Support-Matrix.pdf" rel="noopener nofollow ugc">cuDNN Support Matrix</a> for cuDNN versions with the various supported CUDA, CUDA driver and NVIDIA hardwares</li>
</ul>
<p>And regarding this …</p>
<p>Would I need to disable CUDA Support?</p>
<ul>
<li>If you want to disable CUDA support, export environment variable <code>USE_CUDA=0</code>. Other potentially useful environment variables may be found in <code>setup.py</code>.</li>
</ul>
<p>From Jetson Nano I guess I don’t need anything…</p>
<ul>
<li>If you are building for NVIDIA’s Jetson platforms (Jetson Nano, TX1, TX2, AGX Xavier), Instructions to install PyTorch for Jetson Nano are <a href="https://devtalk.nvidia.com/default/topic/1049071/jetson-nano/pytorch-for-jetson-nano/" rel="noopener nofollow ugc">available here</a>
</li>
</ul>
<p>From the ROCm compiler do I need something? or I not need disable nothing?</p>
<ul>
<li>
<p>If you want to compile with ROCm support, install</p>
</li>
<li>
<p><a href="https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html" rel="noopener nofollow ugc">AMD ROCm</a> 4.0 and above installation</p>
</li>
<li>
<p>ROCm is currently supported only for Linux system.</p>
</li>
</ul>
<p>If you want to disable ROCm support, export environment variable <code>USE_ROCM=0</code>. Other potentially useful environment variables may be found in <code>setup.py</code>.</p>
<p>If I understood correctly, I should only install this with conda, right?</p>
<pre><code class="lang-auto">conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses
</code></pre>
<p>or…</p>
<pre><code class="lang-auto">conda install -c conda-forge libuv=1.39
</code></pre>
<p>is it possible to do this without git? Just downloading the project and running from my terminal?</p>
<pre><code class="lang-auto">git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
# if you are updating an existing checkout
git submodule sync
git submodule update --init --recursive
</code></pre>

ptrblck: <aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>I use CUDA Toolkit 11.1 and the cuDNN of that version. But should I download them or leave them as I have them?</p>
</blockquote>
</aside>
<p>If you’ve already installed a local CUDA toolkit (with cudnn), you can just use it and don’t need to reinstall it.</p>
<aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>And with the compiler what i need do? What do I need to download? (As it says that “or above” version I guess it would be fine, right? )</p>
</blockquote>
</aside>
<p>The CUDA toolkit installs the CUDA compiler (<code>nvcc</code>) and you could check, if it’s working by either compiling the CUDA Samples or checking if it can be found and used via <code>nvcc --version</code>.</p>
<aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>Would I need to disable CUDA Support?</p>
</blockquote>
</aside>
<p>If you want to use the GPU (I assume you want to), you should not disable CUDA support.<br>
Otherwise, you could also install the CPU-only binaries and wouldn’t need to build PyTorch from source.</p>
<aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>From Jetson Nano I guess I don’t need anything…</p>
</blockquote>
</aside>
<p>No, you don’t need to build for Jetson.</p>
<aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>From the ROCm compiler do I need something? or I not need disable nothing?</p>
</blockquote>
</aside>
<p>No, ROCm is used for AMD GPUs.</p>
<aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>If I understood correctly, I should only install this with conda, right?</p>
</blockquote>
</aside>
<p>Yes, you would need some dependencies to build PyTorch from source. If you miss to install a dependency, the installation will yield an error pointing to the missing package.</p>
<aside class="quote no-group" data-username="ElectrikVocal_95" data-post="3" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>is it possible to do this without git? Just downloading the project and running from my terminal?</p>
</blockquote>
</aside>
<p>You might be able to download the repository from GitHub directly, but I’m not sure if this would also download all third-party modules, so I would recommend to use <code>git</code>.</p>

ElectrikVocal_95: <p>In case I uninstalled pytorch, torchvision and torchaudio before doing the process, I don’t know if it was ok.</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC&gt;pip uninstall torch
Found existing installation: torch 1.8.1+cu111
Uninstalling torch-1.8.1+cu111:
  Would remove:
    c:\users\mipc\anaconda3\lib\site-packages\caffe2\*
    c:\users\mipc\anaconda3\lib\site-packages\torch-1.8.1+cu111.dist-info\*
    c:\users\mipc\anaconda3\lib\site-packages\torch\*
    c:\users\mipc\anaconda3\scripts\convert-caffe2-to-onnx.exe
    c:\users\mipc\anaconda3\scripts\convert-onnx-to-caffe2.exe
Proceed (y/n)? y
  Successfully uninstalled torch-1.8.1+cu111

(base) C:\Users\MIPC&gt;pip uninstall torchvision
Found existing installation: torchvision 0.9.1+cu111
Uninstalling torchvision-0.9.1+cu111:
  Would remove:
    c:\users\mipc\anaconda3\lib\site-packages\torchvision-0.9.1+cu111.dist-info\*
    c:\users\mipc\anaconda3\lib\site-packages\torchvision\*
Proceed (y/n)? y
  Successfully uninstalled torchvision-0.9.1+cu111

(base) C:\Users\MIPC&gt;pip uninstall torchaudio
Found existing installation: torchaudio 0.8.1
Uninstalling torchaudio-0.8.1:
  Would remove:
    c:\users\mipc\anaconda3\lib\site-packages\torchaudio-0.8.1.dist-info\*
    c:\users\mipc\anaconda3\lib\site-packages\torchaudio\*
Proceed (y/n)? y
  Successfully uninstalled torchaudio-0.8.1
</code></pre>
<p>And then I followed this process using git, in the Anaconda Prompt</p>
<pre><code class="lang-auto">git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
git submodule sync
git submodule update --init --recursive
</code></pre>
<p>Now, should I reinstall Pytorch from the link on its official website and run programs from Anaconda Prompt? Or do I need to do something else before reinstalling pytorch?</p>
<p>In this case, do you recommend the stable version?</p>
<pre><code class="lang-auto">pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
</code></pre>
<p>or the nightly version ?</p>
<pre><code class="lang-auto">pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
</code></pre>
<p>Is it really necessary to use Visual Studio?<br>
I have Visual Studio 2019 ver. 16.8.30804.86</p>
<p><em>" Note: There’s a <a href="https://github.com/oneapi-src/oneDNN/issues/812" rel="noopener nofollow ugc">compilation issue</a> in several Visual Studio 2019 versions since 16.7.1, so please make sure your Visual Studio 2019 version is not in 16.7.1 ~ 16.7.5"</em>  In theory it should work, right?</p>
<p>To run programs using CUDA from the console, should I do this?</p>
<pre><code class="lang-auto">NVTX is needed to build Pytorch with CUDA. NVTX is a part of CUDA distributive, where it is called "Nsight Compute". To install it onto already installed CUDA run CUDA installation once again and check the corresponding checkbox. Make sure that CUDA with Nsight Compute is installed after Visual Studio.

Currently, VS 2017 / 2019, and Ninja are supported as the generator of CMake. If ninja.exe is detected in PATH, then Ninja will be used as the default generator, otherwise, it will use VS 2017 / 2019.
If Ninja is selected as the generator, the latest MSVC will get selected as the underlying toolchain.
</code></pre>
<p>Where should I download these libraries?</p>
<pre><code class="lang-auto">Additional libraries such as Magma, oneDNN, a.k.a MKLDNN or DNNL, and Sccache are often needed. Please refer to the installation-helper to install them.
</code></pre>
<p>Or only use this commands in the prompt or cmd, and then pytorch will be activate?</p>
<pre><code class="lang-auto">cmd

:: [Optional] If you want to build with the VS 2017 generator for old CUDA and PyTorch, please change the value in the next line to `Visual Studio 15 2017`.
:: Note: This value is useless if Ninja is detected. However, you can force that by using `set USE_NINJA=OFF`.
set CMAKE_GENERATOR=Visual Studio 16 2019

:: Read the content in the previous section carefully before you proceed.
:: [Optional] If you want to override the underlying toolset used by Ninja and Visual Studio with CUDA, please run the following script block.
:: "Visual Studio 2019 Developer Command Prompt" will be run automatically.
:: Make sure you have CMake &gt;= 3.12 before you do this when you use the Visual Studio generator.
set CMAKE_GENERATOR_TOOLSET_VERSION=14.27
set DISTUTILS_USE_SDK=1
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%

:: [Optional] If you want to override the CUDA host compiler
set CUDAHOSTCXX=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe

python setup.py install
</code></pre>

cpeters: <aside class="quote no-group" data-username="ElectrikVocal_95" data-post="5" data-topic="117104">
<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/electrikvocal_95/48/36721_2.png" class="avatar"> ElectrikVocal_95:</div>
<blockquote>
<p>Now, should I reinstall Pytorch from the link on its official website and run programs from Anaconda Prompt? Or do I need to do something else before reinstalling pytorch?</p>
</blockquote>
</aside>
<p>The point is that the version you would install normally (e.g. a precompiled binary) lacks the support for such an old GPU, so to specifically make use of the GT730 you need to build the program from scratch with that support baked in; at no point would you be downloading a full version to install.</p>
<p>To answer some of the other points: you would be best served with the stable version, as you don’t want an unstable build with still-in-testing features you won’t be using; Visual Studio is necessary to provide a compilation environment on windows. If you want your programs to run using GPU acceleration (yes), then you need Nsight installed as it suggests.</p>

ElectrikVocal_95: <p>How do I install Nsight Compute (NVTX) on my pc?<br>
On this page appears this code with 2 functions</p>
<p><a href="https://docs.nvidia.com/gameworks/content/gameworkslibrary/nvtx/nvidia_tools_extension_library_nvtx.htm" class="onebox" target="_blank" rel="noopener nofollow ugc">https://docs.nvidia.com/gameworks/content/gameworkslibrary/nvtx/nvidia_tools_extension_library_nvtx.htm</a></p>

cpeters: <p>Run the normal CUDA installation and it should give you checkboxes to install Nsight Compute.</p>
<blockquote>
<p>To install it onto already installed CUDA run CUDA installation once again and check the corresponding checkbox.</p>
</blockquote>

ElectrikVocal_95: <p>I think I have Nsight Compute installed, right?</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/d/9d2ca80cddbd8b4adda54aebbf17d26b0a135c6b.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/9d2ca80cddbd8b4adda54aebbf17d26b0a135c6b" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/d/9d2ca80cddbd8b4adda54aebbf17d26b0a135c6b_2_690x389.jpeg" alt="image" data-base62-sha1="mqqDBL9qHf4SKgqWk6H2kRKr1Fh" width="690" height="389" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/d/9d2ca80cddbd8b4adda54aebbf17d26b0a135c6b_2_690x389.jpeg, https://discuss.pytorch.org/uploads/default/original/3X/9/d/9d2ca80cddbd8b4adda54aebbf17d26b0a135c6b.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/9/d/9d2ca80cddbd8b4adda54aebbf17d26b0a135c6b.jpeg 2x" data-dominant-color="0D0D0C"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1004×567 60.7 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Apparently I installed it without realizing it, but I think it’s that.</p>
<p>Now with Visual Studio 16.8. and Nsight , should I reinstall pytorch (stable version for CUDA 11.1) with Anaconda prompt and pip?</p>
<p>these commands need to be entered in cmd before i install pytorch? are they really necessary?</p>
<pre><code class="lang-auto">cmd

:: [Optional] If you want to build with the VS 2017 generator for old CUDA and PyTorch, please change the value in the next line to `Visual Studio 15 2017`.
:: Note: This value is useless if Ninja is detected. However, you can force that by using `set USE_NINJA=OFF`.
set CMAKE_GENERATOR=Visual Studio 16 2019

:: Read the content in the previous section carefully before you proceed.
:: [Optional] If you want to override the underlying toolset used by Ninja and Visual Studio with CUDA, please run the following script block.
:: "Visual Studio 2019 Developer Command Prompt" will be run automatically.
:: Make sure you have CMake &gt;= 3.12 before you do this when you use the Visual Studio generator.
set CMAKE_GENERATOR_TOOLSET_VERSION=14.27
set DISTUTILS_USE_SDK=1
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%

:: [Optional] If you want to override the CUDA host compiler
set CUDAHOSTCXX=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe

python setup.py install
</code></pre>

cpeters: <p>You are aware that the instructions you’re following are to compile the program from the source code, with all that entails? No current version of pytorch you can possibly install will have the feature you’re after (old compute capability support), so the entire backend of the program needs to be built again to add it in, then that version you have just built will be installed instead of the online ones.</p>
<p>If you don’t follow the instructions, then it will either fail to build or be missing features, which would defeat the objective.</p>
<p>The only thing that you should be changing in these settings is (I think) wherever the desired compute capability is specified.</p>
<p>One problem you might face is lack of support for the current CUDA version, with the added problem that the 730 is old enough and low enough in Nvidia’s product stack that they no longer have a page for it.</p>

ElectrikVocal_95: <p>In cmd</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC\pytorch&gt;set CMAKE_GENERATOR=Visual Studio 16 2019

(base) C:\Users\MIPC\pytorch&gt;set CMAKE_GENERATOR_TOOLSET_VERSION=14.27

(base) C:\Users\MIPC\pytorch&gt;set DISTUTILS_USE_SDK=1

(base) C:\Users\MIPC\pytorch&gt;for /f "usebackq tokens=*" %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%
El sistema no puede encontrar el archivo -version.

(base) C:\Users\MIPC\pytorch&gt;set CUDAHOSTCXX=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe

(base) C:\Users\MIPC\pytorch&gt;python setup.py install
Building wheel torch-1.9.0a0+gitbc05867
-- Building version 1.9.0a0+gitbc05867
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Visual Studio 16 2019 -DCMAKE_GENERATOR_TOOLSET_VERSION=14.27 -DCMAKE_INSTALL_PREFIX=C:\Users\MIPC\pytorch\torch -DCMAKE_PREFIX_PATH=C:\Users\MIPC\anaconda3\Lib\site-packages -DNUMPY_INCLUDE_DIR=C:\Users\MIPC\anaconda3\lib\site-packages\numpy\core\include -DPYTHON_EXECUTABLE=C:\Users\MIPC\anaconda3\python.exe -DPYTHON_INCLUDE_DIR=C:\Users\MIPC\anaconda3\include -DPYTHON_LIBRARY=C:\Users\MIPC\anaconda3/libs/python38.lib -DTORCH_BUILD_VERSION=1.9.0a0+gitbc05867 -DUSE_NUMPY=True C:\Users\MIPC\pytorch
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Visual Studio 16 2019
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Traceback (most recent call last):
  File "setup.py", line 876, in &lt;module&gt;
    build_deps()
  File "setup.py", line 354, in build_deps
    build_caffe2(version=version,
  File "C:\Users\MIPC\pytorch\tools\build_pytorch_libs.py", line 50, in build_caffe2
    cmake.generate(version,
  File "C:\Users\MIPC\pytorch\tools\setup_helpers\cmake.py", line 329, in generate
    self.run(args, env=my_env)
  File "C:\Users\MIPC\pytorch\tools\setup_helpers\cmake.py", line 140, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "C:\Users\MIPC\anaconda3\lib\subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-GNinja', '-DBUILD_PYTHON=True', '-DBUILD_TEST=True', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_GENERATOR=Visual Studio 16 2019', '-DCMAKE_GENERATOR_TOOLSET_VERSION=14.27', '-DCMAKE_INSTALL_PREFIX=C:\\Users\\MIPC\\pytorch\\torch', '-DCMAKE_PREFIX_PATH=C:\\Users\\MIPC\\anaconda3\\Lib\\site-packages', '-DNUMPY_INCLUDE_DIR=C:\\Users\\MIPC\\anaconda3\\lib\\site-packages\\numpy\\core\\include', '-DPYTHON_EXECUTABLE=C:\\Users\\MIPC\\anaconda3\\python.exe', '-DPYTHON_INCLUDE_DIR=C:\\Users\\MIPC\\anaconda3\\include', '-DPYTHON_LIBRARY=C:\\Users\\MIPC\\anaconda3/libs/python38.lib', '-DTORCH_BUILD_VERSION=1.9.0a0+gitbc05867', '-DUSE_NUMPY=True', 'C:\\Users\\MIPC\\pytorch']' returned non-zero exit status 1.
</code></pre>
<p>Shouldn’t I touch any parameters?</p>
<p>I think something failed here, however I think that in the end the setup.py didn’t work fine, right?</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC\pytorch&gt;for /f "usebackq tokens=*" %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%
El sistema no puede encontrar el archivo -version.
</code></pre>

ElectrikVocal_95: <p>This error is because it cannot find a version for my video card? Is there a way to fix it? (I already followed all the steps)</p>
<pre><code class="lang-auto">(base) C:\Users\MIPC\pytorch&gt;for /f "usebackq tokens=*" %i in ("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%
The system cannot find the -version file
</code></pre>

ptrblck: <p>I’m not sure, if this issue is related to the GPU, as the error message seems to point to Visual Studio, so I guess your VS setup might not be working correctly.</p>

Muhammad_Ali: <p>Hi <a class="mention" href="/u/ptrblck">@ptrblck</a> , I am having this issue with fastai, and fastaudio. I am using Colab Pro +<br>
These are my versions:<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/b/0/b03d53bbd5f4e055c1ce52870d59458cd631251e.png" alt="image" data-base62-sha1="p95qvcEvHcNqHjD4mZbNaaQpcE6" width="603" height="295"></p>
<p>And device is as follows:<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/8/8/88753fb7e7460bfb7637cfcc7d7d29510a172cb3.png" alt="image" data-base62-sha1="jta8IqFcieBGOCNwUQkubY8Medl" width="481" height="182"></p>

ptrblck: <p>Your A100 needs CUDA&gt;=11, so you should install the PyTorch binaries with CUDA11.3 in the selection menu.</p>

Muhammad_Ali: <p>Thanks alot <a class="mention" href="/u/ptrblck">@ptrblck</a> , but how can I select CUDA11.3 in colab?</p>

Muhammad_Ali: <p>I used following for installation:</p>
<pre><code class="lang-auto">!pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

</code></pre>
<p>Now next time, if I get by chance A100, I will check it out. <img src="https://discuss.pytorch.org/images/emoji/apple/smiley.png?v=10" title=":smiley:" class="emoji" alt=":smiley:"><br>
Thanks again, for helping me out</p>