BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
doctor5000
Posts: 4
Joined: Sun Dec 06, 2020 11:36 pm

BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by doctor5000 »

Hi all,
I've been banging my head against the wall for a while about this. I would really appreciate your help.

Machine description:
HP Laptop 15t-dy100 (64-bit architecture)
Intel Core i7-1065G7 CPU
Intel Iris(R) Plus Graphics
16GB RAM

OS: Dual-boot Windows 10 and Ubuntu 20.04.1 LTS, ISSUE WITH UBUNTU

Blender and BlendLuxCore versions tried (all combinations):
Blender 2.83.3, 2.83.9, 2.90, 2.91.0, 2.92.0
BlendLuxCore 2.4, 2.5 Beta 1

Description of issue:
After installing BlendLuxCore on Ubuntu, switching render engine to LuxCore, when I click to enter material-shaded mode or viewport-render mode, or press F12 to render, Blender freezes and must be killed from the command line. This does not happen on the Windows partition (Blender 2.83.3 I believe); everything behaves as expected on Windows.

Solutions tried:
Using various versions of both software (uninstalling and installing BlendLuxCore correctly as detailed in the wiki)
Using the Snap Store version of Blender
Using the Zip packed version of Blender
Installing Intel OpenCL runtime for Ubuntu
Running Blender as root user
Disabling OpenCL Tonemapper for camera
Completely disabling Tonemapper
Using Device: GPU (doesn't find any devices, hangs after clicking update device list)
Using a clean install of Blender with no presets/add-ons

Additional details:
As stated, everything works fine on the Windows partition. In the "Devices" drop-down under both the render-settings and camera imagepipeline tab on Windows, the GPU is present (but not on Ubuntu). I've downloaded LuxMark on Ubuntu and it renders perfectly in every benchmark mode except for Benchmark (OpenCL CPUs), where it throws this error:

Code: Select all

2020-12-06 19:23:26 - RUNTIME ERROR: No OpenCL device selected or available
When I run Blender from the command line on Ubuntu, these are the last few lines before it hangs:

Code: Select all

Export took 0.0 s
[LuxCore][33.675] Film resolution: 1293x525
[SDL][33.676] Film output definition: RGB_IMAGEPIPELINE [image.png]
[SDL][33.676] Image pipeline: film.imagepipelines.000
[SDL][33.676] Image pipeline step 0: OUTPUT_SWITCHER
[SDL][33.676] Image pipeline step 1: TONEMAP_LINEAR
[SDL][33.676] Film output definition: ALBEDO [ALBEDO.exr]
[LuxRays][33.676] OpenCL support: enabled
The last line is present in every case I've tried. When Blender hangs, it does not respond to keypresses, the UI does not react to clicks or hover events, and the window(s) cannot be closed by clicking the system "X" UI quit. It must be terminated with killall. If terminated by sending a CTRL+Z to the terminal that spawned it, the terminal indicates that it has been killed but the unresponsive window(s) remain and can only be closed by ending the task in the system monitor.

Result of $glxinfo -B:

Code: Select all

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) Iris(R) Plus Graphics (ICL GT2) (0x8a52)
    Version: 20.0.8
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Iris(R) Plus Graphics (ICL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.0.8
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
Result of $sudo lshw -C video:

Code: Select all

  *-display                 
       description: VGA compatible controller
       product: Iris Plus Graphics G7
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       logical name: /dev/fb0
       version: 07
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=i915 latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
       resources: iomemory:600-5ff iomemory:400-3ff irq:146 memory:6000000000-6000ffffff memory:4000000000-400fffffff ioport:4000(size=64) memory:c0000-dffff
I'm sure I've tried more solutions that I don't remember. Such is life :roll: . Please let me know if more relevant system info would be helpful.

Thank you in advance for the help,
doctor5000
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by Dade »

The problem should be in the driver you are using: it looks like you are using open source Mesa driver while you should try to use the Intel one. They may not work too because Intel GPUs computing capabilities are very limited and they are usually blacklisted (i.e. avoided) by Blender (both by Cycles and LuxCore).
The fact that they work on Windows seems to suggest they may work on Linux too.

Keeps also in mind that GPU kernel compilation (required only the very first time you run a render engine) can take several minutes: have you tried to just wait ?
Support LuxCoreRender project with salts and bounties
doctor5000
Posts: 4
Joined: Sun Dec 06, 2020 11:36 pm

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by doctor5000 »

Thanks for the response @Dade. I let blender sit open "Starting viewport render" while I got ready this morning (~30m), and nothing happened. I left it on the frozen F12 render screen as another test for around 20 min while organizing, again nothing.

My understanding is that the term Mesa refers to the i915 driver's source (mesa3d), which appears to be the Intel-endorsed distributor for graphics drivers.

This page: https://www.intel.com/content/www/us/en ... phics.html links to 01Intel Graphics for Linux, which says in the FAQ:
Most Linux distributions include built-in support for Intel® Linux* Graphics. That means you don’t have to install or update any additional drivers after you install or update your operating system (OS). Using the latest release of your distribution ensures you will always have the latest stable release of the graphics drivers. ... Intel® Linux* Graphics drivers for Linux are fully open source. You can obtain the source code from Mesa3D.org.
I've installed the OpenCL runtime per: https://dgpu-docs.intel.com/installatio ... focal.html.

Also, running lspci shows the kernel driver in use and kernel module are both i915. (Quick rant, i915 is the umbrella driver for anything with similar architecture to Pentium P4; they never changed the name even for the HD graphics line).

Most importantly here, I think, is that I don't want to actually use the awful integrated GPU to render with LuxCoreRender. I want it as far away from my renders as possible. I just want to be able to render on the CPU like I can on Windows. Still not sure how LuxMark works on Ubuntu but BlendLuxCore doesn't.

Also, I'm a little star-struck and honored that you responded to my question :D . I'm indebted to your contributions to LuxCore and admire your research.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by Dade »

doctor5000 wrote: Mon Dec 07, 2020 8:10 pm Most importantly here, I think, is that I don't want to actually use the awful integrated GPU to render with LuxCoreRender. I want it as far away from my renders as possible. I just want to be able to render on the CPU like I can on Windows.
LuxCore can uses the GPU for 2 things:

1) Rendering;
2) Image pipeline;

In order to avoid the GPU, you have to select CPU rendering for the #1 and run the image pipeline on CPU too, I'm not sure where is the option in BlendLuxCore for the later, may be in the camera panel :?:

Your current problem seems related to LuxCore trying to use the GPU for #2.
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by B.Y.O.B. »

In v2.5, this option has been moved to the addon user preferences.
doctor5000
Posts: 4
Joined: Sun Dec 06, 2020 11:36 pm

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by doctor5000 »

In order to avoid the GPU, you have to select CPU rendering for the #1 and run the image pipeline on CPU too
Per OP I've tried using Device -> CPU and disabling OpenCL in the Camera tab for the ImagePipeline, and I've also disabled all ImagePipeline options (including tonemapper); still the same dying breath from the console:

Code: Select all

[LuxRays][33.676] OpenCL support: enabled
In v2.5, this option has been moved to the addon user preferences.
In v2.5 user preferences the only option in the dropdown is CPU. I've tried the same combinations of render device/tonemapper on or off/OpenCL on or off in the camera tab with v2.5 as well.

I installed the standalone LuxCore and loaded the cornell box, same last line from the console with a different identifier before it:

Code: Select all

[LuxRays][16.866] OpenCL support: enabled
Is there a very basic, "Hello World" style scene I could try to render in the standalone renderer to see if anything works? Thanks again for the input
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by Dade »

doctor5000 wrote: Tue Dec 08, 2020 6:26 pm
In order to avoid the GPU, you have to select CPU rendering for the #1 and run the image pipeline on CPU too
Per OP I've tried using Device -> CPU and disabling OpenCL in the Camera tab for the ImagePipeline, and I've also disabled all ImagePipeline options (including tonemapper); still the same dying breath from the console:

Code: Select all

[LuxRays][33.676] OpenCL support: enabled
This message is just print when OpenCL is detected (it doesn't mean it is used). You could just uninstall OpenCL ICD to disable OpenCL.
doctor5000 wrote: Tue Dec 08, 2020 6:26 pm
In v2.5, this option has been moved to the addon user preferences.
In v2.5 user preferences the only option in the dropdown is CPU. I've tried the same combinations of render device/tonemapper on or off/OpenCL on or off in the camera tab with v2.5 as well.
You are looking in the wrong place, it is now on the Addon preferences (i.e. Menu Edit => Preferences => Addon => BlendLuxCore).
doctor5000 wrote: Tue Dec 08, 2020 6:26 pm I installed the standalone LuxCore and loaded the cornell box, same last line from the console with a different identifier before it:

Code: Select all

[LuxRays][16.866] OpenCL support: enabled
Is there a very basic, "Hello World" style scene I could try to render in the standalone renderer to see if anything works? Thanks again for the input
You can try this:

Code: Select all

bin/luxcoreui -D renderengine.type PATHCPU -D sampler.type SOBOL -D film.opencl.enable 0 scenes/cornell/cornell.cfg
Support LuxCoreRender project with salts and bounties
doctor5000
Posts: 4
Joined: Sun Dec 06, 2020 11:36 pm

Re: BlendLuxCore hangs when starting render/viewport render (OpenCL?)

Post by doctor5000 »

Dade wrote: Thu Dec 10, 2020 11:04 am You can try this:

Code: Select all

bin./luxcoreui -D renderengine.type PATHCPU -D sampler.type SOBOL -D film.opencl.enable 0 scenes/cornell/cornell.cfg
Running this opened a medium-sized window but the window contents were entirely black, and the system UI controls for the window unresponsive (could not close it with the "X"). It hung at the same point (LuxRay detecting opencl on the system).
Dade wrote: Thu Dec 10, 2020 11:04 am This message is just print when OpenCL is detected (it doesn't mean it is used). You could just uninstall OpenCL ICD to disable OpenCL.
A half-success!
I purged the Intel ICD and its associated packages/files/dirs. I left /etc/OpenCL/vendors/intel.icd in place because it wasn't autoremoved when I ditched the Intel repo, and because after uninstalling, running $clinfo showed zero devices.

After uninstalling, I ran your cornell box snippet again. The UI displayed successfully, and I can interact with it, but it errors rendering the scene:

Code: Select all

RenderSession starting error: 
OpenCL driver API error (code: -1001, file:/home/vsts/work/1/s/LinuxCompile/LuxCore/src/luxrays/devices/ocldevice.cpp, line: 72): -1001
:(
I opened a fresh Blender 2.83 instance (properly uninstalled BlendLuxCore, deleted config folder) and installed BlendLuxCore 2.4 again. This time, switching to rendered view gave me an error! No crash! Same error as the LuxCoreUI test.

I cleaned the 2.83 env again and tried BlendLuxCore 2.5: Success! Suzanne in all her glory:
Image

I'd still like to be able to have OpenCL enabled in case some application needs it, and I'd like to explore LuxCoreUI, but I think I'll take what I can get.

Thanks Dade and B.Y.O.B!
Post Reply