LuxCoreRender / BlendLuxCore

Blender Integration for LuxCore
GNU General Public License v3.0
724 stars 91 forks source link

'bgl' imported without an OpenGL backend. Please update your add-ons to use the 'gpu' module error #931

Open bennu99 opened 1 month ago

bennu99 commented 1 month ago

.blend file:

Steps to reproduce:

Screenshots or rendered images:

Error message from Google Collab console:

Blender 4.0.0 (hash 878f71061b8e built 2023-11-14 00:52:48) Read prefs: "/root/.config/blender/4.0/config/userpref.blend" WARN (bgl): source/blender/python/generic/bgl.cc:2676 BPyInit_bgl: 'bgl' imported without an OpenGL backend. Please update your add-ons to use the 'gpu' module.

..............

Error: No hardware device selected or available Traceback (most recent call last): File "/root/.config/blender/4.0/scripts/addons/BlendLuxCore/engine/base.py", line 91, in render_final final.render(self, depsgraph) File "/root/.config/blender/4.0/scripts/addons/BlendLuxCore/engine/final.py", line 44, in render _render_layer(engine, depsgraph, statistics, layer) File "/root/.config/blender/4.0/scripts/addons/BlendLuxCore/engine/final.py", line 56, in _render_layer engine.session = engine.exporter.create_session(depsgraph, engine=engine, view_layer=view_layer) File "/root/.config/blender/4.0/scripts/addons/BlendLuxCore/export/init.py", line 217, in create_session pyluxcore.KernelCacheFill(config_props_copy) RuntimeError: No hardware device selected or available ERROR: No hardware device selected or available

Blender quit

................

Its the same problem for the Blender3.6 version

................

OS: linux Blender version:4, 3.6 (with the appropriate version of BlendLuxCore) LuxCore version:2.7 for Blender 3.6 LTS and BlendLuxCore-v2.8alpha1-linux64

MigCurto commented 1 month ago

As I see it the problem lies probably somewhere in CUDA drivers, Colab got upgraded to Ubuntu 22.04 and so CUDA drivers that probably for some reason I cant grasp arent working ok with OpenCL, BlendLuxCore is by default set to OpenCL, you can change the preferences to CUDA by cmd , but ATM and probably related it isnt showing Light Paths: renders but without caustics:

https://colab.research.google.com/drive/1xlczqw5Ep1ExAKhEIQrvB7ma_0N5xq2F?usp=sharing

bennu99 commented 1 month ago

Thanks for the replay. The problem is not only with google colab though. I have tried AWS and now, today I tried multiple times on GCloud instance as well. No matter what I do - nothing works. The only solution I have for the moment is use blender3 with luxcore2.6. Anything above blender3 with luxcore just errors out. I did try your colab notebook - it works but the render comes very washed out. Do you have an idea for why or what else I can do?

bennu99 commented 1 month ago

I should mention that on AWS and GCloud I use ubuntu22 LTS.

MigCurto commented 1 month ago

I'm not sure where the problem is, I can make it work with OpenCL in Colab if I update the drivers with:

!apt update !apt purge nvidia -y !apt-get install -y cuda-drivers

replaces current 535 with 555

If prior to that you try !clinfo you get 0 (zero) devices

Still, same results as using CUDA (shared notebook): no Light Tracing. So your problem is mostly because of botched NVIDIA drivers, still I dont have NVIDIA but I'm trying to grab a laptop with NVIDIA to see if (my) problem could be with the BlendLuxCore add on.

I dont have experience with AWS or GCloud. AFAIK ubuntu22 LTS is the same as Colab: 22.04