4
$\begingroup$

I'm trying to render my scene, which was working fine before, but suddenly when I want to render it starts to throw CUDA error. I upgraded to 2.9 and same deal. I'm using OPTIX denoiser, but render on normal CUDA. I have Razer blade 2020 with RTX2080 MAX-Q super Any tips? I updated windows, restarted the laptop etc. I'm pretty sure all my drivers are up to date. I have motion blur enabled, as well as denoising, 512 samples, DoF is enabled as well.

Also after it shows up once, I'm getting "failed to initialize CUDA context" every time after it. :/

enter image description here

$\endgroup$
3
  • 2
    $\begingroup$ It seems that the issue is OPTIX denoising. In gerenal anytime I try to use optix render or denoising blender craps out. I'm not sure why that happens. The scene I THINK is a bit complex (I'm a newbie, so I may have not optimized it properly, but it's nothing CRAZY complex), but it seems that non-optix, just CUDA rendering works. Odd stuff. Does OPTIX need so much more VRAM? $\endgroup$
    – AciD
    Sep 12, 2020 at 11:22
  • $\begingroup$ I had the same. Saving the file, closing program and reopend the file was for me the solution. $\endgroup$
    – E.F. Lucas
    Feb 23, 2021 at 20:53
  • $\begingroup$ I had the same error but the problem wasnt in denoising but was caused by (nvidia's) GPU compute and had no problem rendering in CPU. The problem was gone upon restarting the app and it renders fine on GPU. $\endgroup$ Sep 19, 2021 at 17:31

6 Answers 6

3
$\begingroup$

I had the same problem. It always appeared when PC woke up from sleep mode. Restarting the app worked, but was annoying. I found the solution in this thread and it worked perfect for me. Now there is no more CUDA error afte trying to render after sleep mode:

https://blenderartists.org/t/failed-to-create-cuda-context-illegal-adress/1278322

In my case I only had to do the last part of the solution:

  • In file browser open etc/modprobe.d as root

  • Create a new file nvidia.conf

  • Open it in text editor and write: options nvidia NVreg_PreserveVideoMemoryAllocations=1then save and close.

  • Back in the terminal, run: sudo update-initramfs -u

  • Reboot.

My system setup: AMD Ryzon 5 3600 16 MB RAM Nvidia GForce RTX 2060 Super Cycles Renderer via GPU and CPU, Optix Denoiser in View and Renderer Ubuntu 20.04 blender 3 snap Nvidia Driver 470 (495 makes problems with Optix Denoiser)

$\endgroup$
2
$\begingroup$

Sometimes when I render things and it doesn't work I just make a new project and then I append everything into that new project from my old project then it usually works. It's annoying but I don't know how else to fix it.

$\endgroup$
1
$\begingroup$

currently running on an old machine . had the same problem however changed from GPU to CPU in device solved the issue in render properties tab.

$\endgroup$
1
$\begingroup$

Overclocking NVidia GPU's can cause CUDA errors. I encountered this same issue with an Nvidia RTX 3070 GPU on both Blender 3.0 and 3.1, stable releases. Removing GPU overclocking, in my case with the MSI Center application on Windows 10, and restarting Blender solved the issue.

$\endgroup$
1
$\begingroup$

Anything (over)loading your GPU could fail CUDA context initialization in my recent case on a RTX 2060 FE it was rendering color depth.

Switching from 16bit to 8bit unstucked the rendering.

$\endgroup$
0
$\begingroup$

For me its working fine after just reinstalling the Nvidia driver.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .