Unable to find a valid cuDNN algorithm to run convolution
I'm getting the runtime error Unable to find a valid cuDNN algorithm to run convolution and I don't know how to solve it. Has anyone seen this or have any understanding of where it's coming from that I could resolve the issue?
Thanks, here's the traceback:
Traceback (most recent call last):
File "scripts/txt2img.py", line 344, in
main()
File "scripts/txt2img.py", line 295, in main
samples_ddim, _ = sampler.sample(S=opt.ddim_steps,
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "c:\stable-diffusion\stable-diffusion-main\ldm\models\diffusion\ddim.py", line 96, in sample
samples, intermediates = self.ddim_sampling(conditioning, size,
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "c:\stable-diffusion\stable-diffusion-main\ldm\models\diffusion\ddim.py", line 149, in ddim_sampling
outs = self.p_sample_ddim(img, cond, ts, index=index, use_original_steps=ddim_use_original_steps,
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "c:\stable-diffusion\stable-diffusion-main\ldm\models\diffusion\ddim.py", line 177, in p_sample_ddim
e_t_uncond, e_t = self.model.apply_model(x_in, t_in, c_in).chunk(2)
File "c:\stable-diffusion\stable-diffusion-main\ldm\models\diffusion\ddpm.py", line 987, in apply_model
x_recon = self.model(x_noisy, t, **cond)
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "c:\stable-diffusion\stable-diffusion-main\ldm\models\diffusion\ddpm.py", line 1410, in forward
out = self.diffusion_model(x, t, context=cc)
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "c:\stable-diffusion\stable-diffusion-main\ldm\modules\diffusionmodules\openaimodel.py", line 732, in forward
h = module(h, emb, context)
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "c:\stable-diffusion\stable-diffusion-main\ldm\modules\diffusionmodules\openaimodel.py", line 87, in forward
x = layer(x)
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\nn\modules\conv.py", line 447, in forward
return self._conv_forward(input, self.weight, self.bias)
File "C:\Users\Matthew.conda\envs\ldm\lib\site-packages\torch\nn\modules\conv.py", line 443, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
Hmm what CuDNN / CUDA version are you running?
Hey, thanks for the reply. I use a Lenovo Legion 7 laptop and it turns out they must have used slightly modified driver sets for the graphics chipset. So I went to the NVidia driver downloads and grabbed the drivers from them, removed the manufacturers drivers and replaced them with the NVidia drivers and it works fine now. I'm not sure what they changed but that did the trick.