Run Quadro k4200 on pytorch

lnBrTgAaaL: <p>Hi<br>
I am running a CNN model on pytorch<br>
and i need to run it on gpu<br>
my gpu is Nividia Quadro k4200 but i get the error message “CUDA error: no kernel image is available for execution on the device”<br>
and a warning " Found GPU0 Quadro K4200 which is of cuda capability 3.0.<br>
PyTorch no longer supports this GPU because it is too old.<br>
The minimum cuda capability that we support is 3.5."<br>
I read that i can do it by compiling pytorch from source but it didn’t work out for me or i did something wrong somewhere.<br>
i followed the instructions here <a href="https://github.com/pytorch/pytorch/blob/master/README.md#from-source" rel="nofollow noopener">https://github.com/pytorch/pytorch/blob/master/README.md#from-source</a><br>
what else can i do?</p>

ptrblck: <p>Your Quadro K4200 has a compute capability of 3.0, while the binaries ship with &gt;=3.7.<br>
What kind of error are you seeing while compiling from source?</p>

lnBrTgAaaL: <p>i don’t get any errors it just runs smoothly but still getting the same old gpu message</p>

lnBrTgAaaL: <p>pytorch&gt;python setup.py install<br>
Building wheel torch-1.6.0a0+f41742f<br>
– Building version 1.6.0a0+f41742f<br>
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Visual Studio 15 2017 -DCMAKE_GENERATOR_TOOLSET_VERSION=14.11 -DCMAKE_INSTALL_PREFIX=C:\Users\M-El Behery\pytorch\torch -DCMAKE_PREFIX_PATH=C:\Users\M-El Behery\anaconda3\Lib\site-packages -DNUMPY_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\lib\site-packages\numpy\core\include -DPYTHON_EXECUTABLE=C:\Users\M-El Behery\anaconda3\python.exe -DPYTHON_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\include -DPYTHON_LIBRARY=C:\Users\M-El Behery\anaconda3/libs/python37.lib -DTORCH_BUILD_VERSION=1.6.0a0+f41742f -DUSE_NUMPY=True C:\Users\M-El Behery\pytorch<br>
CMake Error: Error: generator : Ninja<br>
Does not match the generator used previously: Visual Studio 15 2017<br>
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.<br>
Traceback (most recent call last):<br>
File “setup.py”, line 739, in <br>
build_deps()<br>
File “setup.py”, line 321, in build_deps<br>
cmake=cmake)<br>
File “C:\Users\M-El Behery\pytorch\tools\build_pytorch_libs.py”, line 59, in build_caffe2<br>
rerun_cmake)<br>
File “C:\Users\M-El Behery\pytorch\tools\setup_helpers\cmake.py”, line 324, in generate<br>
self.run(args, env=my_env)<br>
File “C:\Users\M-El Behery\pytorch\tools\setup_helpers\cmake.py”, line 141, in run<br>
check_call(command, cwd=self.build_dir, env=env)<br>
File “C:\Users\M-El Behery\anaconda3\lib\subprocess.py”, line 363, in check_call<br>
raise CalledProcessError(retcode, cmd)<br>
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘-GNinja’, ‘-DBUILD_PYTHON=True’, ‘-DBUILD_TEST=True’, ‘-DCMAKE_BUILD_TYPE=Release’, ‘-DCMAKE_GENERATOR=Visual Studio 15 2017’, ‘-DCMAKE_GENERATOR_TOOLSET_VERSION=14.11’, ‘-DCMAKE_INSTALL_PREFIX=C:\Users\M-El Behery\pytorch\torch’, ‘-DCMAKE_PREFIX_PATH=C:\Users\M-El Behery\anaconda3\Lib\site-packages’, ‘-DNUMPY_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\lib\site-packages\numpy\core\include’, ‘-DPYTHON_EXECUTABLE=C:\Users\M-El Behery\anaconda3\python.exe’, ‘-DPYTHON_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\include’, ‘-DPYTHON_LIBRARY=C:\Users\M-El Behery\anaconda3/libs/python37.lib’, ‘-DTORCH_BUILD_VERSION=1.6.0a0+f41742f’, ‘-DUSE_NUMPY=True’, ‘C:\Users\M-El Behery\pytorch’]’ returned non-zero exit status 1.</p>
<p>this is the message showed after running python setup.py install</p>

ptrblck: <p>I’m not deeply familiar with Windows, but these lines seem interesting:</p>
<pre><code class="lang-auto">Does not match the generator used previously: Visual Studio 15 2017
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
</code></pre>
<p>Could you remove the cache file etc. and rerun it?<br>
<code>python setup.py clean</code> might also work to get rid of these files.</p>

lnBrTgAaaL: <aside class="quote no-group" data-username="ptrblck" data-post="5" data-topic="78610">
<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/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p>Could you remove the cache file etc. and rerun it?</p>
</blockquote>
</aside>
<p>i did remove the cache file and it still prints the same message</p>
<aside class="quote no-group" data-username="ptrblck" data-post="5" data-topic="78610">
<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/ptrblck/48/1823_2.png" class="avatar"> ptrblck:</div>
<blockquote>
<p><code>python setup.py clean</code> might also work to get rid of these files.</p>
</blockquote>
</aside>
<p>i ran it and still the same message after trying to install</p>

lnBrTgAaaL: <p><a class="mention" href="/u/ptrblck">@ptrblck</a> i figured out i had the thing called ninja so when i tried to make the VS 2017 the generator i got that message above<br>
when i ran it on he ninja generator it kept loading and printing alot of text when is searched for the word error i found this at the end<br>
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘-j’, ‘36’]’ returned non-zero exit status 1.<br>
how do i know that it was installed succesfully?</p>

ptrblck: <p>If the installation was successful, you should be able to <code>import torch</code> and run some code.<br>
Also, the log should print something like <code>successfully installed torch...</code></p>