最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - What is the command to install pytorch with cuda 12.8? - Stack Overflow

programmeradmin8浏览0评论

I notice on the website of pytorch (/) there is a command for cuda 12.6 but not for the latest version of cuda which is 12.8.

Is there a command specifically for cuda 12.8?

Will the command for cuda 12.6 work if I'm using cuda 12.8?

I notice on the website of pytorch (https://pytorch./get-started/locally/) there is a command for cuda 12.6 but not for the latest version of cuda which is 12.8.

Is there a command specifically for cuda 12.8?

Will the command for cuda 12.6 work if I'm using cuda 12.8?

Share Improve this question edited Mar 27 at 13:15 chux 155k16 gold badges151 silver badges301 bronze badges asked Mar 27 at 4:18 ChrisChris 1
Add a comment  | 

4 Answers 4

Reset to default 1

as of now, pytorch which supports cuda 12.8 is not released yet.

but unofficial support released nightly version of it.

here are the commands to install it. so with this pytorch version you can use it on rtx 50XX. I've got 5080 and it works just fine.

pip install --pre torch==2.8.0.dev20250324+cu128 torchvision==0.22.0.dev20250325+cu128 torchaudio==2.6.0.dev20250325+cu128 --index-url https://download.pytorch./whl/nightly/cu128

PyTorch does not yet offer official support for CUDA 12.8 in its stable releases. You may need to wait for native support or consider installing WSL.

Reference: https://discuss.pytorch./t/how-to-install-torch-version-that-supports-rtx-5090-on-windows-cuda-kernel-errors-might-be-asynchronously-reported-at-some-other-api-call/216644

I had to make a 4 into a 5 on the torch version to get it.

pip install --pre torch==2.8.0.dev20250325+cu128 torchvision==0.22.0.dev20250325+cu128 torchaudio==2.6.0.dev20250325+cu128 --index-url https://download.pytorch./whl/nightly/cu128

You're right, PyTorch currently provides pre-built binaries only up to CUDA 12.6, even though your system might have CUDA 12.8 installed.

I had the same setup with CUDA 12.8 installed system-wide, and when I tried:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch./whl/cu126

It didn’t work.

But then I used:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch./whl/cu124
And it worked without any issues. PyTorch doesn't need the exact same version of the CUDA toolkit installed locally, it uses its own

You can check your driver’s supported CUDA version in the terminal with:
nvidia-smi

发布评论

评论列表(0)

  1. 暂无评论