LuxCoreRender / BlendLuxCore

Blender Integration for LuxCore
GNU General Public License v3.0
715 stars 90 forks source link

RuntimeError: OptixDenoiserPlugin used while Optix is not available - Switch Denoiser in UI #806

Open canonex opened 1 year ago

canonex commented 1 year ago

.blend file: every new blend file.

Steps to reproduce:

  1. open a new file
  2. switch to LuxCore
  3. display the Rendered preview.

The render starts but as soon as the denoiser starts it crashes and starts again with a black flash like effect.

Suggestion: BlendLuxCore could automatically change Denoiser and set it to OIDN if Optix is not available.

Error message from Blender console:

...
[LuxRays][7.831] [LinearToneMap] Compiler options: -D LUXRAYS_OPENCL_KERNEL -D SLG_OPENCL_KERNEL -D LUXRAYS_CUDA_DEVICE -D LUXRAYS_OS_LINUX --use_fast_math
[LuxRays][7.831] [LinearToneMap] Compiling kernels
[LuxRays][7.832] [LinearToneMap] Program cached
[LuxCore][7.832] [AutoLinearToneMap] Compiling LinearToneMap_Apply Kernel
[LuxCore][7.832] [LinearToneMap] Kernels compilation time: 0ms
Traceback (most recent call last):
  File "/home/crickyx/.config/blender/3.4/scripts/addons/BlendLuxCore/engine/base.py", line 128, in view_draw
    viewport.view_draw(self, context, depsgraph)
  File "/home/crickyx/.config/blender/3.4/scripts/addons/BlendLuxCore/engine/viewport.py", line 238, in view_draw
    framebuffer.update(engine.session, scene)
  File "/home/crickyx/.config/blender/3.4/scripts/addons/BlendLuxCore/draw/viewport.py", line 229, in update
    luxcore_session.GetFilm().GetOutputFloat(self._output_type, self.buffer)
RuntimeError: OptixDenoiserPlugin used while Optix is not available
[LuxCore][9.105] [NVIDIA GeForce GTX 1060 with Max-Q Design CUDAIntersect] Memory used for hardware image pipeline: 56283Kbytes
==================================================
[Engine/Viewport] New session
[Exporter] Creating session
...

OS: Linux, Debian testing Blender version: 3.4.0 LuxCore version: 2.61

Thank you, Riccardo

neo2068 commented 1 year ago

Hi @canonex! NVIDIA GeForce GTX 1060 should support OPTIX since it has a compute capability of 6.1. What drivers version do you use? For OPTIX it should be 470 or above. But you are right. We need a way to check if OPTIX is available. I implemented a first check for older cards but it will not work for the GeForce GTX 1060 because it is capable to use OPTIX.

canonex commented 1 year ago

Yes, it would be useful to show a notice that the denoiser has been changed because the other one is not available (for whatever reason, even if it is just because there is an "x" problem...). The user experience of flash on the screen is unpleasant and might make the novice give up using the software.

Also I have to thank you because you made me do further research and I found out that in order to activate Optix you need to install an additional library on Debian testing (I have Nvidia drivers 510.108.03!) that I was not aware of and on the guide it is not mentioned: apt install libnvoptix1

And now Optix is working!

Ciao, Riccardo

odil24 commented 1 year ago

Hi @canonex! NVIDIA GeForce GTX 1060 should support OPTIX since it has a compute capability of 6.1. What drivers version do you use? For OPTIX it should be 470 or above. But you are right. We need a way to check if OPTIX is available. I implemented a first check for older cards but it will not work for the GeForce GTX 1060 because it is capable to use OPTIX.

@neo2068 Hi. Latest build have an issue with your changes: 943 Previous version of the viewport.py has not this kind of an issue but has been "OptiX not available using OIDN" (me has GTX 1060 6GB with OptiX in Cycles). Any solution with this?

neo2068 commented 1 year ago

I recently added this check to only run OPTIX denoiser on newer Nvidia cards but this seems to give an error for non NVIDIA cards. I will push a fix soon.

odil24 commented 1 year ago

Deletion lines from 66 to 74 inside "viewport.py" file should fix the problem.

neo2068 commented 1 year ago

@odil24 @canonex I fixed the code and it should work with non NVIDIA cards. Can you check?

odil24 commented 1 year ago

@odil24 @canonex I fixed the code and it should work with non NVIDIA cards. Can you check?

I'm interesting on what does mean "non Nvidia card" if my card is Nvidia (GTX 1060 6Gb)?

neo2068 commented 1 year ago

@odil24 For NVIDIA cards the property 'cuda.compute.major' should be available and the error of the code should not occur.

canonex commented 1 year ago

I have to try on another computer without nvidia-card and I'll try disable optix. I'll be on site next week.

To obtain the updated code I just download the zip, it is correct?

Thank you, Riccardo

odil24 commented 1 year ago

I have to try on another computer without nvidia-card and I'll try disable optix. I'll be on site next week.

To obtain the updated code I just download the zip, it is correct?

Thank you, Riccardo

Are you tried download this one? https://github.com/LuxCoreRender/BlendLuxCore/releases/download/latest/BlendLuxCore-latest-win64.zip

canonex commented 1 year ago

Not having libnvoptix1 will still cause issue with the latest build (I'm on Debian Bookworm, tested with the linux build). Here a video with no changed settings:

Video del 2023-02-06 16-04-31.webm

Thank you, Riccardo

canonex commented 1 year ago

Also I have to thank you because you made me do further research and I found out that in order to activate Optix you need to install an additional library on Debian testing (I have Nvidia drivers 510.108.03!) that I was not aware of and on the guide it is not mentioned: apt install libnvoptix1

And now Optix is working!

I have updated the Debian Wiki with this indication: https://wiki.debian.org/NvidiaGraphicsDrivers#OptiX

canonex commented 5 months ago

The bug issue is still causing issue in the latest 2.8 alpha1. https://github.com/LuxCoreRender/BlendLuxCore/assets/1444378/2a2344f4-8af5-48cb-bea1-87087eed44c0

Thank you, Riccardo

odil24 commented 5 months ago

The bug issue is still causing issue in the latest 2.8 alpha1. https://github.com/LuxCoreRender/BlendLuxCore/assets/1444378/2a2344f4-8af5-48cb-bea1-87087eed44c0

Thank you, Riccardo

Hi. Thi bug already fixed in this build: https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.8alpha1