Cuda 12 pytorch 11.8

Sir, i purchased new machine nvidia Geoforce rtx 4090 graphics card it takes as cuda 12 by default but in pytorch the latest version is 11.8 how can I run it .it’s not compatible please reply

The RTX 4090 is sm89 which should be usable with CUDA 11.8. Note that if you install the 11.8 pip wheels e.g., via pip3 install torch torchvision torchaudio --index-url PyTorch will use the CUDA that is bundled with it (11.8 in this case) even if your system has CUDA 12. Please let us know if you have already tried this and it did not work.

If you’re working with Pytorch+cu118 in Stable Difussion, using some WebUI like Comfy or A1111, it’s better to maintain with CUDA toolkit 11.8 even when 12.2 update is available. The UIs will work fine with both versions, but the image segmentation (SAM), with some ultralytics (YOLO), will give you some unexpected results with cu122, and cu118 will give you better results. So, it’s better to wait Pytorch cu122 compatible version to be sure to update CUDA toolkit.

In any other case (not using StableDifussion), it’s better cu122.