Pytorch version warning: GPU with CUDA capability Warning: sm_86 is not compatible with the current PyTorch installation

I’m running diffusers on my PC locally with my own GPUs (RTX A2000),

when I run
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16).to("cuda")

I get the warning
NVIDIA RTX A2000 8GB Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.

and later when I try to run pipe(prompt)
I get the error
Runtime Error: CUDA error: no kernel image is available for execution on the device CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

I found a solution here
[NEED HELP] Trouble with CUDA capability sm_86 - PyTorch Forums

Apparantly Ampere based GPUs only support CUDA version >11.0, so I needed to reinstall pytorch with the correct version from here Start Locally | PyTorch
By choosing cuda version 11.3.

But now torch.cuda.is_available() returns False.

What do I do?

Can anyone help?

Maybe “torch.cuda.is_available() returns False.” is a drivers problem?

Here is an installation link:

That means you likely dont have the right wheel.

I’d recommend trying:

pip install light-the-torch
ltt install torch torchvision

(Or this is how i dealt with this issue)

3 Likes

I think this is related to incompatible versions between torch / cuda / etc., like Zach mentions above. I’ve exported my local setup here in case you want to use that: environment.yml
(You’d need conda installed locally, and can setup an env using conda env create -f environment.yml)