Pre-built pytorch for CUDA [compute capability] 3.0 on windows?

KFrank: <p>Hi Forum!</p>
<p>Would anybody know of a pre-built pytorch windows / CUDA 3.0<br>
version?  (It’s windows 10, if that matters.)</p>
<p>I’m aware that pytorch no longer formally supports older CUDA<br>
versions, but I have seen older pre-built packages floating<br>
around on the internet – just not this configuration.</p>
<p>(I will be installing pytorch on an older laptop with a CUDA 3.0<br>
quadro k1100m graphics card.  I’ll just be monkeying around,<br>
so I don’t need the gpu, but I’d like to monkey around with<br>
the gpu, as well.  I’d prefer python 3, but I’d be willing to go<br>
with python 2 to get the gpu.)</p>
<p>Thanks for any advice!</p>
<p>K. Frank</p>

ptrblck: <p>Hi Frank,</p>
<p>I assume you are referring to the compute capability 3.0, which should work with CUDA6.0 - CUDA10.1.</p>
<p>If I’m not mistaken, the minimal compute capability for the current binaries is &gt;=3.5, so you could build from source to support this older GPU.</p>
<p>However, if you would like to play around with some legacy PyTorch version, you might get lucky finding some supported binaries <a href="https://drive.google.com/drive/folders/0B-X0-FlSGfCYdTNldW02UGl4MXM" rel="nofollow noopener">here</a> (built by <a class="mention" href="/u/peterjc123">@peterjc123</a>).</p>
<p>Since these binaries are quite old by now, I would recommend building from source. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=9" title=":wink:" class="emoji" alt=":wink:"></p>

KFrank: <p>Hello Peter!</p>
<p>Thanks for your reply.</p>
<aside class="quote no-group" data-username="ptrblck" data-post="2" data-topic="51263" data-full="true">
<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>I assume you are referring to the compute capability 3.0, which should work with CUDA6.0 - CUDA10.1.</p>
</blockquote>
</aside>
<p>Indeed.  I was referring to compute capability 3.0 (not that I knew<br>
it at the time …).  Thanks for clearing up that confusion of mine.</p>
<aside class="quote no-group">
<blockquote>
<p>If I’m not mistaken, the minimal compute capability for the current binaries is &gt;=3.5,</p>
</blockquote>
</aside>
<p>Do you know how I might determine which compute capability a<br>
binary uses before installing it?</p>
<p>For example, on the main <a href="http://pytorch.org" rel="noopener nofollow ugc">pytorch.org</a> page, in the “QUICK<br>
START LOCALLY” section, one is given the choice of CUDA<br>
9.0 and 10.0 (and none), which I suppose I now understand<br>
to be CUDA SDKs 9.0 and 10.0.  Is there any way for me<br>
deduce whether such a download will support compute<br>
capability 3.0, or whether it starts earliest at 3.5?</p>
<aside class="quote no-group">
<blockquote>
<p>However, if you would like to play around with some legacy PyTorch version, you might get lucky finding some supported binaries <a href="https://drive.google.com/drive/folders/0B-X0-FlSGfCYdTNldW02UGl4MXM" rel="noopener nofollow ugc">here</a> (built by <a class="mention" href="/u/peterjc123">@peterjc123</a>).</p>
</blockquote>
</aside>
<p>Thanks for that link.  In a similar vein, do you know how I might<br>
figure out which of these  binaries support which compute capability?</p>
<p>For example, the first file on that google drive is<br>
pytorch_legacy-0.1.12-py35_0.1.12cu80.tar.bz2.</p>
<p>Am I right that the “cu80” part of the file name suggests that the<br>
binary is built with CUDA SDK 8.0 and that it could therefore<br>
potentially support compute capability 2.0 – 6.2?  Is there any<br>
to determine its minimum required compute capability (before<br>
installing)?</p>
<p>(Also am I right that the .tar.bz2 files are linux binaries, while the<br>
.whl file is the sole windows binary?)</p>
<p>Thanks for helping clear these things up for me.</p>
<p>K. Frank</p>

ptrblck: <aside class="quote no-group" data-username="KFrank" data-post="3" data-topic="51263">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ecb155/48.png" class="avatar"> KFrank:</div>
<blockquote>
<p>Do you know how I might determine which compute capability a<br>
binary uses before installing it?</p>
</blockquote>
</aside>
<p>The compute capability is unfortunately not encoded in the file names, so the best approach would be to install the binary and just see, if your GPU works, or print:</p>
<pre data-code-wrap="python"><code class="lang-python">print(torch.__config__.show())
&gt; PyTorch built with:
  - GCC 4.9
  - Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.18.1 (Git Hash 7de7e5d02bf687f971e7668963649728356e0c20)
  - OpenMP 201307 (a.k.a. OpenMP 4.0)
  - NNPACK is enabled
  - CUDA Runtime 10.0
  - NVCC architecture flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_50,code=compute_50
  - CuDNN 7.5.1
  - Magma 2.5.0
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS=  -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, USE_CUDA=True, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=True, USE_NNPACK=True, USE_OPENMP=ON, 
</code></pre>
<aside class="quote no-group" data-username="KFrank" data-post="3" data-topic="51263">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ecb155/48.png" class="avatar"> KFrank:</div>
<blockquote>
<p>Am I right that the “cu80” part of the file name suggests that the<br>
binary is built with CUDA SDK 8.0 and that it could therefore<br>
potentially support compute capability 2.0 – 6.2?</p>
</blockquote>
</aside>
<p>Generally yes, but the used compute capability has to be specified using the <code>TORCH_CUDA_ARCH_LIST</code> flag as used <a href="https://github.com/pytorch/builder/blob/9e7795415713af7efba6c45127bd86b7a7d2ad09/manywheel/build.sh#L27">here</a>.<br>
So while the binaries support e.g. CUDA10, the compute capability might be limited so specific architectures.</p>
<aside class="quote no-group" data-username="KFrank" data-post="3" data-topic="51263">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ecb155/48.png" class="avatar"> KFrank:</div>
<blockquote>
<p>(Also am I right that the .tar.bz2 files are linux binaries, while the<br>
.whl file is the sole windows binary?)</p>
</blockquote>
</aside>
<p>That shouldn’t be the case. <a href="https://pytorch.org/get-started/locally/#cuda-100-1">These .whl packages</a> are used for linux systems.</p>
<p>I’m not sure, if conda uses <code>tar.bz2</code>, while <code>pip</code> uses <code>.whl</code>?<br>
Anyway, both are just zipped containers, so I’m not sure if the file ending is even important. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=12" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>

KFrank: <p>Hello Peter!</p>
<p>Thanks for your reply (and sorry for being a little slow in following up).</p>
<aside class="quote no-group quote-modified" data-username="ptrblck" data-post="4" data-topic="51263" data-full="true">
<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>
<aside class="quote no-group" data-username="KFrank" data-post="3" data-topic="51263">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ecb155/48.png" class="avatar"> KFrank:</div>
<blockquote>
<p>Am I right that the “cu80” part of the file name suggests that the<br>
binary is built with CUDA SDK 8.0 and that it could therefore<br>
potentially support compute capability 2.0 – 6.2?</p>
</blockquote>
</aside>
<p>Generally yes, but the used compute capability has to be specified using the <code>TORCH_CUDA_ARCH_LIST</code> flag as used <a href="https://github.com/pytorch/builder/blob/9e7795415713af7efba6c45127bd86b7a7d2ad09/manywheel/build.sh#L27" rel="noopener nofollow ugc">here</a>.<br>
So while the binaries support e.g. CUDA10, the compute capability might be limited so specific architectures.</p>
</blockquote>
</aside>
<p>Okay, this makes sense.  (I tried installing a “CUDA 9.0” version from<br>
the pytorch main page.  It installed fined, and seemed to run – I didn’t<br>
try anything substantive – but announced that its support for compute<br>
capability started earliest at 3.5, and was not compatible with my 3.0<br>
gpu.  I imagine it runs fine with the cpu, but I didn’t test it.)</p>
<p>Now on to my follow-up question:</p>
<p>Coming back to your earlier post:</p>
<aside class="quote no-group" data-username="ptrblck" data-post="2" data-topic="51263">
<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>However, if you would like to play around with some legacy PyTorch version, you might get lucky finding some supported binaries <a href="https://drive.google.com/drive/folders/0B-X0-FlSGfCYdTNldW02UGl4MXM" rel="noopener nofollow ugc">here</a> (built by <a class="mention" href="/u/peterjc123">@peterjc123</a>).</p>
</blockquote>
</aside>
<p>I downloaded a CUDA 8.0 version from your legacy-binaries link<br>
(specifically pytorch-0.3.0-py36_0.3.0cu80.tar.bz).  It has some<br>
.dll’s in it so I am supposing it is a windows build.  I chose a CUDA<br>
8.0 version in the hope that it might support compute capability 3.0<br>
(but I don’t know that yet).</p>
<p>I ran:</p>
<pre><code class="lang-plaintext">pip3 install file:///C:/&lt;path_to_bz_file&gt;/pytorch-0.3.0-py36_0.3.0cu80.tar.bz2
</code></pre>
<p>and got the following error:</p>
<pre><code class="lang-plaintext">Processing c:\&lt;path_to_bz_file&gt;\pytorch-0.3.0-py36_0.3.0cu80.tar.bz2
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "&lt;string&gt;", line 1, in &lt;module&gt;
      File "c:\&lt;path_to_python&gt;\python36\lib\tokenize.py", line 452, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\USERXY~1\\AppData\\Local\\Temp\\pip-req-build-d2relny2\\setup.py'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\USERXY~1\AppData\Local\Temp\pip-req-build-d2relny2\
</code></pre>
<p>Note the “8.3” format of the username; a ten-alphabetic-character<br>
(no spaces, numbers, or special characters) username has been<br>
translated to the 8.3 form.  I don’t know why or where.</p>
<p>I can confirm that C:\Users\USERXY~1\AppData\Local\Temp\ is<br>
accessible (through the 8.3 username), and that the installing user<br>
can create (and read) subdirectories and files there.  (Note that<br>
nothing else in the path to the “Temp” directory is longer than<br>
eight characters, although the “pip-req-build-d2relny2” subdirectory<br>
that pip created (or tried to create) is.)</p>
<p>I do not see a “pip-req-build-d2relny2” subdirectory in the Temp<br>
directory (nor a setup.py file in such a subdirectory), so either it<br>
wasn’t created, or pip cleaned up after itself after the install failed.</p>
<p>Would you (or anyone else) have some ideas about what might be<br>
going on and how to fix it?  This is on windows 10, if that matters.</p>
<p>Since I wasn’t able to install this particular pytorch build, I wasn’t<br>
able to query it for which compute capability levels it supports.  But<br>
I can unzip / untar the .tar.bz file, so would you know if there is a<br>
way I can figure out the compute capability from the unzipped file,<br>
even if I can’t install it?</p>
<p>Thanks again for your help.</p>
<p>K. Frank</p>

ptrblck: <p>I assume <a class="mention" href="/u/peterjc123">@peterjc123</a> used <a href="https://github.com/peterjc123/pytorch-scripts">this repo</a> to create the legacy Windows binaries. So you might find these paths there.<br>
I’m unfortunately not really familiar with Windows installations etc.</p>
<aside class="quote no-group" data-username="KFrank" data-post="5" data-topic="51263">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ecb155/48.png" class="avatar"> KFrank:</div>
<blockquote>
<p>so would you know if there is a<br>
way I can figure out the compute capability from the unzipped file,<br>
even if I can’t install it?</p>
</blockquote>
</aside>
<p>There might be a way using <code>strings</code>, <code>grep</code> and check all strings for the compute capability in the libraries.<br>
Something like this <em>might</em> work, but I’m not even sure which library really contains all the interesting strings:</p>
<pre><code class="lang-auto">strings torch/lib/libnvrtc-builtins.so | grep -Eo 'compute_[0-9]+' | sort --unique
</code></pre>
<p>Consider it a really dirty hack, but you might get lucky with this command.</p>
<p>That being said, I’m currently not sure, if Windows has similar tools to inspect a <code>.dll</code> <img src="https://discuss.pytorch.org/images/emoji/apple/face_with_raised_eyebrow.png?v=12" title=":face_with_raised_eyebrow:" class="emoji" alt=":face_with_raised_eyebrow:" loading="lazy" width="20" height="20"></p>

peterjc123: <p>On Windows, the similar tools is called <code>dumpbin</code> and it is accessible when you activate the VC develop environment.The command to use would be <code>dumpbin /rawdata torch\lib\nvrtc-builtins64_90.dll</code>. And the result will be like:</p>
<pre><code class="lang-auto">  0000000180007990: 20 63 6F 6D 70 75 74 65 72 20 73 6F 66 74 77 61   computer softwa
  00000001800079B0: 69 61 6C 0D 0A 20 2A 20 63 6F 6D 70 75 74 65 72  ial.. * computer
  0000000180010DF0: 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65 4D 6F 64  ..int computeMod
  0000000180019390: 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65 50 72 65  ..int computePre
  0000000180025770: 74 20 63 6F 6D 70 75 74 65 4D 6F 64 65 3B 0D 0A  t computeMode;..
  000000018002D880: 72 79 3B 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65  ry;..int compute
  000000018002DD10: 74 20 63 6F 6D 70 75 74 65 50 72 65 65 6D 70 74  t computePreempt
  000000018003F5B0: 3B 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65 4D 6F  ;..int computeMo
  000000018003FA40: 63 6F 6D 70 75 74 65 50 72 65 65 6D 70 74 69 6F  computePreemptio
  0000000180047B50: 3B 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65 50 72  ;..int computePr
  0000000180059770: 69 6E 74 20 63 6F 6D 70 75 74 65 4D 6F 64 65 3B  int computeMode;
  0000000180061D10: 69 6E 74 20 63 6F 6D 70 75 74 65 50 72 65 65 6D  int computePreem
  000000018006EEA0: 3B 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65 4D 6F  ;..int computeMo
  000000018006F330: 63 6F 6D 70 75 74 65 50 72 65 65 6D 70 74 69 6F  computePreemptio
  0000000180077440: 3B 0D 0A 69 6E 74 20 63 6F 6D 70 75 74 65 50 72  ;..int computePr
  000000018007B810: 75 72 65 20 63 6F 6D 70 75 74 65 5F 36 30 20 77  ure compute_60 w
  000000018007B870: 2D 61 72 63 68 3D 63 6F 6D 70 75 74 65 5F 36 30  -arch=compute_60
</code></pre>
<p>You 'll have to save it to a file and remove the left part, join the lines together, and then search for <code>compute_[0-9]+</code>.</p>

peterjc123: <p>BTW, <code>.tar.bz</code> is the package format for Conda. You should do <code>conda install &lt;pkgname&gt;.tar.bz</code> and <code>pip install &lt;pkgname&gt;.whl</code>. FYI, the packages &gt;= 0.4 have CUDA CC &gt;= 3.5.</p>

KFrank: <p>Hello Pu!</p>
<aside class="quote no-group" data-username="peterjc123" data-post="8" data-topic="51263" data-full="true">
<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/peterjc123/48/2790_2.png" class="avatar"> peterjc123:</div>
<blockquote>
<p>BTW, <code>.tar.bz</code> is the package format for Conda. You should do <code>conda install &lt;pkgname&gt;.tar.bz</code> and <code>pip install &lt;pkgname&gt;.whl</code>. FYI, the packages &gt;= 0.4 have CUDA CC &gt;= 3.5.</p>
</blockquote>
</aside>
<p>Just to clarify, is the file I downloaded,<br>
pytorch-0.3.0-py36_0.3.0cu80.tar.bz, a “0.3.0” package, and<br>
therefore is “&lt; 0.4”, and therefore would be expected to support<br>
CUDA CC 3.0?</p>
<p>Thanks.</p>
<p>K. Frank</p>

peterjc123: <p>I checked my answers in the Zhihu post and yes, it seems that CC3.0 is supported.</p>

KFrank: <p>Hi Peter and Pu!</p>
<aside class="quote no-group quote-modified" data-username="peterjc123" data-post="8" data-topic="51263" data-full="true">
<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/peterjc123/48/2790_2.png" class="avatar"> peterjc123:</div>
<blockquote>
<p>BTW, <code>.tar.bz</code> is the package format for Conda. You should do `conda install .tar.bz</p>
</blockquote>
</aside>
<p>It looks like I was able to install an old pytorch with cuda for my gpu,<br>
but I get an error when I try to do anything.</p>
<p>I installed* conda and (from the “Anaconda Prompt”) used conda to<br>
install the legacy pytorch binary:</p>
<pre><code class="lang-plaintext">conda install file:///C:/&lt;path_to_bz_file&gt;/pytorch-0.3.0-py36_0.3.0cu80.tar.bz2
</code></pre>
<p>I then ran python (from the “Anaconda Prompt”) and ran:</p>
<pre><code class="lang-plaintext">&gt;&gt;&gt; import torch
&gt;&gt;&gt; print(torch.__version__)
0.3.0b0+591e73e
&gt;&gt;&gt; print(torch.version.cuda)
8.0
&gt;&gt;&gt; print(torch.cuda.is_available())
True
&gt;&gt;&gt; print(torch.cuda.current_device())
THCudaCheck FAIL file=D:\pytorch\pytorch\torch\lib\THC\THCGeneral.c line=120 error=30 : unknown error
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "C:\&lt;path_to_miniconda&gt;\Miniconda3\lib\site-packages\torch\cuda\__init__.py", line 302, in current_device
    _lazy_init()
  File "C:\&lt;path_to_miniconda&gt;\Miniconda3\lib\site-packages\torch\cuda\__init__.py", line 140, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (30) : unknown error at D:\pytorch\pytorch\torch\lib\THC\THCGeneral.c:120
</code></pre>
<p>So it looks like pytorch recognizes my gpu and considers it acceptable,<br>
but can’t actually lazy_init / initialize it.</p>
<p>Do you think there is something broken in my installation (that I can<br>
fix), or should I regard this as a bug in the old pytorch 0.3.0 (and<br>
potentially give up on trying to get this gpu working with pytorch)?</p>
<p>*)  Further details on my installation process:</p>
<p>First I installed miniconda, specifically,<br>
Miniconda3-4.5.4-Windows-x86_64.exe.  I chose this older version<br>
because it was the newest miniconda version that was python 3.6,<br>
which I assume I need for this legacy python-3.6 version of pytorch.</p>
<p>(Of course, conda has to live in its own private sandbox, so now I<br>
have two independent python 3.6 installations.  But I expect that<br>
anaconda considers this a feature, rather than a bug.)</p>
<p>I then used conda to install the legacy pytorch, as above.</p>
<p>When I ran python (from the “Anaconda Prompt”), and ran:</p>
<pre data-code-wrap="python"><code class="lang-python">import torch
</code></pre>
<p>I got the error:</p>
<pre><code class="lang-plaintext">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "C:\&lt;path_to_miniconda&gt;\Miniconda3\lib\site-packages\torch\__init__.py", line 76, in &lt;module&gt;
    from torch._C import *
ImportError: numpy.core.multiarray failed to import
</code></pre>
<p>Okay, no numpy.  (So conda, which bills itself as a package manager,<br>
installs pytorch, but doesn’t install its numpy dependency.  I suppose<br>
I consider this a bug, not a feature, but what do I know?)</p>
<pre><code class="lang-plaintext">conda install numpy
</code></pre>
<p>works, and now</p>
<pre data-code-wrap="python"><code class="lang-python">import torch
</code></pre>
<p>works.</p>
<p>Regarding printing out the pytorch configuration in order to discover<br>
the minimum cuda compute capability, I guess this older version<br>
of pytorch doesn’t support this (or uses a different syntax):</p>
<pre><code class="lang-plaintext">&gt;&gt;&gt; import torch
&gt;&gt;&gt; print(torch.__config__.show())
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: module 'torch' has no attribute '__config__'
</code></pre>
<p>So I don’t know how to definitively probe this version of pytorch for<br>
its minimum required compute capability (but I assume the fact that<br>
<code>torch.cuda.is_available()</code> returns <code>True</code> means that the minimum<br>
required compute capability is 3.0 or lower).</p>
<p>Anyway, thanks again for your help, and any further suggestions on<br>
how to get this going would be appreciated.</p>
<p>Best regards.</p>
<p>K. Frank</p>

ptrblck: <pre><code class="lang-python">RuntimeError: cuda runtime error (30)
</code></pre>
<p>might point to the driver.<br>
Could you have a look at <a href="https://discuss.pytorch.org/t/resolved-cuda-runtime-error-30/1116">this post</a> and check, if any suggestion could help?</p>

KFrank: <p>Hi Peter and Pu!</p>
<p>Thanks for your help getting pytorch working with my old cuda<br>
compute capability 3.0 gpu.  Thanks also to Andrei for his<br>
post (in the thread linked to below) for the observation<br>
that helped get me past my sticking point.</p>
<p>I will select Peter’s post linking to the legacy builds as the<br>
solution although the whole discussion has been helpful.</p>
<p>The solution (for me) is to use a work-around for the<br>
“cuda runtime error (30)” issue – namely don’t call<br>
<code>torch.cuda.is_available()</code>.</p>
<p>I was led to this by this post in the thread linked to by Peter:</p>
<aside class="quote" data-post="20" data-topic="1116">
  <div class="title">
    <div class="quote-controls"></div>
    <img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/848f3c/48.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/resolved-cuda-runtime-error-30/1116/20">[resolved] Cuda Runtime Error(30)</a> 
  </div>
  <blockquote>
    This always works for me (Win10, Cuda 10.1, Python 3.7.2, PyTorch 1.0.1, NVIDIA GTX 1050 Ti): 
import torch
torch.cuda.current_device()

but this always fails for me: 
import torch
torch.cuda.is_available()
torch.cuda.current_device()  # fails here

<a class="mention" href="/u/mohamed_ghadban">@Mohamed_Ghadban</a>, how can I access the NVIDIA Nsight Options? Thanks in advance <img width="20" height="20" src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=12" title="slight_smile" alt="slight_smile" class="emoji">
  </blockquote>
</aside>

<p>I’ve posted some observations about “cuda runtime error (30)” here:</p>
<aside class="quote quote-modified" data-post="1" data-topic="52696">
  <div class="title">
    <div class="quote-controls"></div>
    <img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ecb155/48.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/some-observations-on-cuda-runtime-error-30/52696">Some observations on "cuda runtime error (30)"</a> 
  </div>
  <blockquote>
    Hello Forum! 
I have some information about the behavior of “cuda runtime 
error (30)” (probably somewhat specific to my particular 
configuration). 
This is a follow-on to a number of threads about “error 30,” 
and, in particular, to this post: 
<a href="https://discuss.pytorch.org/t/resolved-cuda-runtime-error-30/1116/20" class="onebox" target="_blank" rel="noopener">https://discuss.pytorch.org/t/resolved-cuda-runtime-error-30/1116/20</a> 
Clued in by Andrei’s observation that torch.cuda.is_available() 
“breaks” cuda, I find (for me) that if torch.cuda.is_available() 
is the first cuda call, subsequent cuda calls will t…
  </blockquote>
</aside>

<p>Here is a script showing some simple gpu-tensor manipulations:</p>
<pre data-code-wrap="python"><code class="lang-python">import torch
print (torch.__version__)
torch.cuda.get_device_capability (0)
torch.cuda.get_device_name (0)
ct = torch.cuda.FloatTensor([[3.3, 4.4, 5.5], [6.6, 7.7, 8.8]])
ct
ct + 0.01 * ct
quit()
</code></pre>
<p>And here is the output:</p>
<pre><code class="lang-plaintext">Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; print (torch.__version__)
0.3.0b0+591e73e
&gt;&gt;&gt; torch.cuda.get_device_capability (0)
(3, 0)
&gt;&gt;&gt; torch.cuda.get_device_name (0)
'Quadro K1100M'
&gt;&gt;&gt; ct = torch.cuda.FloatTensor([[3.3, 4.4, 5.5], [6.6, 7.7, 8.8]])
&gt;&gt;&gt; ct

 3.3000  4.4000  5.5000
 6.6000  7.7000  8.8000
[torch.cuda.FloatTensor of size 2x3 (GPU 0)]

&gt;&gt;&gt; ct + 0.01 * ct

 3.3330  4.4440  5.5550
 6.6660  7.7770  8.8880
[torch.cuda.FloatTensor of size 2x3 (GPU 0)]

&gt;&gt;&gt; quit()
</code></pre>
<p>I’ll follow up if I have any issues actually running models on<br>
this gpu.</p>
<p>Thanks again.</p>
<p>K. Frank</p>