Unable to install pytorch for cuda 12.8

Mahesh_Reddy_Tapeti: <p>Hey,<br>
I was trying to install pytorch compatible with cuda 12.8 with rtx 5070 ti but this error shows up<br>
<code>Looking in indexes: https://download.pytorch.org/whl/cu128 ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch </code></p>
<p>I have cuda installed on my system<br>
<code>nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2025 NVIDIA Corporation Built on Wed_Jan_15_19:20:09_PST_2025 Cuda compilation tools, release 12.8, V12.8.61 Build cuda_12.8.r12.8/compiler.35404655_0 </code><br>
In a different conda env I have torch with cu128 installed but not able to install in other environments. How to fix it?</p>
<p>Thanks in advance!</p>

ptrblck: <p>Which Python version are you using in the working and failing environments?</p>

Mahesh_Reddy_Tapeti: <aside class="quote no-group" data-username="ptrblck" data-post="2" data-topic="220538">
<div class="title">
<div class="quote-controls"></div>
<img 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>Which Python version are you using in the</p>
</blockquote>
</aside>
<p>I’m using <code>Python 3.8.20</code> in failing and Python 3.9.21 in working</p>

ptrblck: <p>Our binaries support Python 3.9-3.13, so you would need to update your Python version.</p>

Mahesh_Reddy_Tapeti: <p>`<br>
NVIDIA GeForce RTX 5070 Ti with CUDA capability sm_120 is not compatible with the current PyTorch installation.<br>
The current PyTorch install supports CUDA capabilities sm_50 sm_60 sm_70 sm_75 sm_80 sm_86 sm_90.<br>
If you want to use the NVIDIA GeForce RTX 5070 Ti GPU with PyTorch, please check the instructions at <a href="https://pytorch.org/get-started/locally/" rel="noopener nofollow ugc">https://pytorch.org/get-started/locally/</a></p>
<p>RuntimeError: CUDA error: no kernel image is available for execution on the device<br>
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.<br>
For debugging consider passing CUDA_LAUNCH_BLOCKING=1<br>
Compile with <code>TORCH_USE_CUDA_DSA</code> to enable device-side assertions.<br>
`</p>
<p>I have this issue cuda 12.4, python 3.12, ubuntu 22 and  rtx 5070</p>

ptrblck: <p>You need to install the latest stable or nightly PyTorch binary with CUDA 12.8.</p>

Oba: <aside class="quote no-group" data-username="ptrblck" data-post="6" data-topic="220538">
<div class="title">
<div class="quote-controls"></div>
<img 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>latest stable or nightly PyTorch binary with CUDA 12.8.</p>
</blockquote>
</aside>
<p>pip3 install torch torchvision torchaudio --index-url <a href="https://download.pytorch.org/whl/nightly/cu128" rel="noopener nofollow ugc">https://download.pytorch.org/whl/nightly/cu128</a>. does not support sm_120<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/a/2a6bd5265695ac569448d1fa2fb810f5032eb51b.png" data-download-href="https://discuss.pytorch.org/uploads/default/2a6bd5265695ac569448d1fa2fb810f5032eb51b" title="Screenshot 2025-06-22 at 19.56.06"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a6bd5265695ac569448d1fa2fb810f5032eb51b_2_690x119.png" alt="Screenshot 2025-06-22 at 19.56.06" data-base62-sha1="63h5db6Ig7bytIDK8U1yyyWk3QT" width="690" height="119" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a6bd5265695ac569448d1fa2fb810f5032eb51b_2_690x119.png, https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a6bd5265695ac569448d1fa2fb810f5032eb51b_2_1035x178.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/a/2a6bd5265695ac569448d1fa2fb810f5032eb51b_2_1380x238.png 2x" data-dominant-color="2C2C2C"><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">Screenshot 2025-06-22 at 19.56.06</span><span class="informations">2096×364 125 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>

ptrblck: <p>It does. Your screenshot shows an older PyTorch 2.5.1 binary with CUDA 12.1.</p>

Oba: <p>Thanks, I tried several ways, this link works pip install --pre torchvision torchaudio --index-url  <a href="https://download.pytorch.org/whl/nightly/cu128" rel="noopener nofollow ugc">https://download.pytorch.org/whl/nightly/cu128</a>, but now i am unable to use llama ccp, it does not see the GPU.  Any suggestions ?, i tried compile severel times but i get an 128 bit error i cant fix.</p>
<p>regards !</p>

ptrblck: <p>I would recommend asking in the corresponding repository as I don’t know which code base you are using and what “128 bit error” means.</p>

Oba: <p>So far im still stuck here.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/d/2daccff45bae7d4f00f092b86c5918f0f13afd60.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/2daccff45bae7d4f00f092b86c5918f0f13afd60" title="Screenshot 2025-06-23 at 08.15.35"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/d/2daccff45bae7d4f00f092b86c5918f0f13afd60_2_690x322.jpeg" alt="Screenshot 2025-06-23 at 08.15.35" data-base62-sha1="6w3JyOuW055gSZPDSeZFv1m9Gak" width="690" height="322" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/d/2daccff45bae7d4f00f092b86c5918f0f13afd60_2_690x322.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/2/d/2daccff45bae7d4f00f092b86c5918f0f13afd60_2_1035x483.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/d/2daccff45bae7d4f00f092b86c5918f0f13afd60_2_1380x644.jpeg 2x" data-dominant-color="2F2F2F"><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">Screenshot 2025-06-23 at 08.15.35</span><span class="informations">1920×898 238 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>

Nabib_Sujan: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/d/edc7c7a55469b21faed1175405002db234ed948c.png" data-download-href="https://discuss.pytorch.org/uploads/default/edc7c7a55469b21faed1175405002db234ed948c" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/e/d/edc7c7a55469b21faed1175405002db234ed948c.png" alt="image" data-base62-sha1="xVvbAof8VXjtnreGpqgA4s83rGc" width="690" height="414" data-dominant-color="1E1B1B"><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">914×549 38.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>

ptrblck: <p>Make sure you are using a supported Python version (3.9-3.13) when trying to install <code>torch==2.7.0+cu128</code>.</p>
<p>You can find the binaries for Linux and Windows <a href="https://download.pytorch.org/whl/torch/">here</a> in case you want to pull them explicitly.</p>