Does pytouch 1.8 support cuda11.8 under source compilation?

simpleKang: <p>I am using a 4060 video card and the compute power is 8.9. so I need to install cuda11.8 at the minimum. but I need to install pytorch1.8. is there any solution for this? Is it possible to solve it by installing pytorch from source?</p>

ptrblck: <p>The PyTorch 1.8 binary release was shipping with CUDA 10.2 and 11.1. I don’t remember which changes were needed to update to 11.8, but note that your sm_89 GPU is binary compatible with sm_86 and sm_80, so the older release might just work.</p>

simpleKang: <p>Thanks for your answer!<br>
But I get the following error when I run the code：</p>
<p>`RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)</p>
<p>nvrtc compilation failed:</p>
<p><span class="hashtag-raw">#define</span> NAN __int_as_float(0x7fffffff)<br>
<span class="hashtag-raw">#define</span> POS_INFINITY __int_as_float(0x7f800000)<br>
<span class="hashtag-raw">#define</span> NEG_INFINITY __int_as_float(0xff800000)</p>
<p>template<br>
<strong>device</strong> T maximum(T a, T b) {<br>
return isnan(a) ? a : (a &gt; b ? a : b);<br>
}</p>
<p>template<br>
<strong>device</strong> T minimum(T a, T b) {<br>
return isnan(a) ? a : (a &lt; b ? a : b);<br>
}</p>
<p>extern “C” <strong>global</strong><br>
void fused_sub_exp(float* t0, float* t1, float* aten_exp) {<br>
{<br>
if (512 * blockIdx.x + threadIdx.x&lt;33200 ? 1 : 0) {<br>
float v = __ldg(t0 + 512 * blockIdx.x + threadIdx.x);<br>
float v_1 = __ldg(t1 + 512 * blockIdx.x + threadIdx.x);<br>
aten_exp[512 * blockIdx.x + threadIdx.x] = expf(v - v_1);<br>
}<br>
}<br>
}<br>
`</p>
<p>nvidia-smi<br>
Sat Mar  2 01:49:25 2024<br>
±----------------------------------------------------------------------------+<br>
| NVIDIA-SMI 525.125.06   Driver Version: 525.125.06   CUDA Version: 12.0     |<br>
|-------------------------------±---------------------±---------------------+<br>
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |<br>
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |<br>
|                               |                      |               MIG M. |<br>
|===============================+======================+======================|<br>
|   0  NVIDIA GeForce …  Off  | 00000000:01:00.0  On |                  N/A |<br>
|  0%   40C    P8     7W / 160W |    384MiB /  8188MiB |      1%      Default |<br>
|                               |                      |                  N/A |<br>
±------------------------------±---------------------±---------------------+</p>
<p>±----------------------------------------------------------------------------+<br>
| Processes:                                                                  |<br>
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |<br>
|        ID   ID                                                   Usage      |<br>
|=============================================================================|<br>
|    0   N/A  N/A      1436      G   /usr/lib/xorg/Xorg                176MiB |<br>
|    0   N/A  N/A      1697      G   /usr/bin/gnome-shell               46MiB |<br>
|    0   N/A  N/A      2724      G   …6B5B1BC9E56BDE4153AC87FEA        4MiB |<br>
|    0   N/A  N/A      3179      G   …736815699028964499,262144      153MiB |<br>
±----------------------------------------------------------------------------+</p>
<p>My environment is: cuda11.1, pytorch1.8, 4060ti. what error is happening to me?Thanks for your reply！</p>

Sehaba95: <p>I am facing the same issue :</p>
<ul>
<li>torch                     1.8.0+cu111</li>
<li>torch-cluster             1.5.9</li>
<li>torch-geometric           1.6.2</li>
<li>torch-scatter             2.0.6</li>
<li>torch-sparse              0.6.9</li>
<li>torch-spline-conv         1.2.1</li>
<li>torchaudio                0.8.0</li>
<li>torcheval                 0.0.7</li>
<li>torchvision               0.9.0+cu111</li>
</ul>
<p>and I got the following error :</p>
<pre><code class="lang-auto">RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)

nvrtc compilation failed: 

#define NAN __int_as_float(0x7fffffff)
#define POS_INFINITY __int_as_float(0x7f800000)
#define NEG_INFINITY __int_as_float(0xff800000)


template&lt;typename T&gt;
__device__ T maximum(T a, T b) {
  return isnan(a) ? a : (a &gt; b ? a : b);
}

template&lt;typename T&gt;
__device__ T minimum(T a, T b) {
  return isnan(a) ? a : (a &lt; b ? a : b);
}

extern "C" __global__
void fused_add_div(float* t0, float* t1, float* aten_div, float* aten_add) {
{
  if (512 * blockIdx.x + threadIdx.x&lt;107312 ? 1 : 0) {
    float t1_1 = __ldg(t1 + 512 * blockIdx.x + threadIdx.x);
    aten_add[512 * blockIdx.x + threadIdx.x] = t1_1 + 1.000000016862384e-16f;
    float v = __ldg(t0 + 512 * blockIdx.x + threadIdx.x);
    aten_div[512 * blockIdx.x + threadIdx.x] = v / (t1_1 + 1.000000016862384e-16f);
  }
}
}```</code></pre>