Crash with small spread angles

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.
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Crash with small spread angles

Post by lighting_freak »

Hi,

if I decrease the spread angle of a light source below 20 degrees, blender crashes after starting rendering.
Spread_Angle.JPG
Spread_Angle.JPG (14.93 KiB) Viewed 6530 times
This is the console message:

Code: Select all

Read blend: C:\Users\Martin\Downloads\MyPrism.blend
init
exporter init
exporter init
create_session
[SDL][15.366] Camera type: perspective
[SDL][15.366] Camera position: Point[0, 0, 0.05]
[SDL][15.366] Camera target: Point[0, 0, 0.049]
[SDL][15.366] Camera clipping plane disabled
[SDL][15.382] Texture definition: 131641928
[SDL][15.382] Volume definition: 128466264
[SDL][15.382] Material definition: Surface_Emitter_131636232
[SDL][15.382] Material definition: Surface_Material_131639336
[SDL][15.398] Material definition: Surface_Glas_Material_131637784
[SDL][15.398] The Mesh_Laser_128043672000 object is a light sources with 30 tria
ngles
[SDL][15.398] Scene objects count: 3
[LuxCore][15.398] Configuration:
[LuxCore][15.398]   light.maxdepth = 16
[LuxCore][15.398]   renderengine.seed = 1
[LuxCore][15.398]   sampler.type = "METROPOLIS"
[LuxCore][15.398]   path.forceblackbackground.enable = 0
[LuxCore][15.398]   renderengine.type = "BIDIRCPU"
[LuxCore][15.398]   film.filter.width = 3.2999999523162842
[LuxCore][15.413]   film.width = 540
[LuxCore][15.413]   film.filter.type = "BLACKMANHARRIS"
[LuxCore][15.413]   path.maxdepth = 1016
[LuxCore][15.413]   film.height = 540
[LuxCore][15.413]   film.outputs.0.filename = "image.png"
[LuxCore][15.413]   film.outputs.0.type = "RGB_IMAGEPIPELINE"
[LuxCore][15.413]   film.imagepipeline.1.type = "TONEMAP_AUTOLINEAR"
[LuxCore][15.413]   film.imagepipeline.2.scale = 0.5
[LuxCore][15.413]   film.imagepipeline.0.type = "NOP"
[LuxCore][15.413]   film.imagepipeline.2.type = "TONEMAP_LINEAR"
Export took 0.1s
[LuxCore][15.429] Film resolution: 540x540
[SDL][15.429] Film output definition: RGB_IMAGEPIPELINE [image.png]
[SDL][15.429] Image pipeline: film.imagepipeline
[SDL][15.429] Image pipeline step 0: NOP
[SDL][15.429] Image pipeline step 1: TONEMAP_AUTOLINEAR
[SDL][15.444] Image pipeline step 2: TONEMAP_LINEAR
[SDL][15.444] Film output definition: RGB_IMAGEPIPELINE [image.png]
[LuxRays][15.444] OpenCL Platform 0: Intel(R) Corporation
[LuxRays][15.444] OpenCL Platform 1: NVIDIA Corporation
[LuxRays][15.444] OpenCL Platform 2: Intel(R) Corporation
[LuxRays][15.444] Device 0 name: NativeThread
[LuxRays][15.444] Device 0 type: NATIVE_THREAD
[LuxRays][15.444] Device 0 compute units: 1
[LuxRays][15.444] Device 0 preferred float vector width: 4
[LuxRays][15.460] Device 0 max allocable memory: 0MBytes
[LuxRays][15.460] Device 0 max allocable memory block size: 0MBytes
[LuxRays][15.460] Device 1 name:       Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz

[LuxRays][15.460] Device 1 type: OPENCL_CPU
[LuxRays][15.460] Device 1 compute units: 4
[LuxRays][15.476] Device 1 preferred float vector width: 4
[LuxRays][15.476] Device 1 max allocable memory: 16265MBytes
[LuxRays][15.476] Device 1 max allocable memory block size: 4066MBytes
[LuxRays][15.476] Device 2 name: Quadro 2000M
[LuxRays][15.476] Device 2 type: OPENCL_GPU
[LuxRays][15.476] Device 2 compute units: 4
[LuxRays][15.476] Device 2 preferred float vector width: 1
[LuxRays][15.476] Device 2 max allocable memory: 2048MBytes
[LuxRays][15.476] Device 2 max allocable memory block size: 512MBytes
[LuxRays][15.476] Device 3 name:       Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz

[LuxRays][15.491] Device 3 type: OPENCL_CPU
[LuxRays][15.491] Device 3 compute units: 4
[LuxRays][15.491] Device 3 preferred float vector width: 8
[LuxRays][15.491] Device 3 max allocable memory: 16265MBytes
[LuxRays][15.507] Device 3 max allocable memory block size: 4066MBytes
[LuxRays][15.507] Preprocessing DataSet
[LuxRays][15.507] Total vertex count: 112
[LuxRays][15.507] Total triangle count: 40
[LuxRays][15.507] Preprocessing DataSet done
[LuxRays][15.507] Creating 4 intersection device(s)
[LuxRays][15.507] Allocating intersection device 0: NativeThread (Type = NATIVE_
THREAD)
[LuxRays][15.507] Allocating intersection device 1: NativeThread (Type = NATIVE_
THREAD)
[LuxRays][15.507] Allocating intersection device 2: NativeThread (Type = NATIVE_
THREAD)
[LuxRays][15.522] Allocating intersection device 3: NativeThread (Type = NATIVE_
THREAD)
[LuxRays][15.522] Adding DataSet accelerator: EMBREE
[LuxRays][15.522] Total vertex count: 112
[LuxRays][15.522] Total triangle count: 40
[LuxRays][15.538] EmbreeAccel build time: 0ms
[LuxCore][15.538] Configuring 4 CPU render threads
Session created in 0.1s
Error: EXCEPTION_ACCESS_VIOLATION

C:\Users\Martin\Downloads\blender-2.79a-rc-windows64>
There is a sample file. Hope you can reproduce it.
MyPrism.blend
(559.12 KiB) Downloaded 253 times
Thanks in advance
BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Crash with small spread angles

Post by B.Y.O.B. »

I can reproduce it on Windows.
However it only happens in final render, not in viewport render.
jensverwiebe
Supporting Users
Posts: 141
Joined: Tue Jan 09, 2018 6:48 pm

Re: Crash with small spread angles

Post by jensverwiebe »

Cannot reproduce on Linux.
Both pre and final work.
Testing a bit more ....

EDIT: i can reproduce a crash when vieport render was not stopped manually or paused frpm haltcond. atm..

Code: Select all

# Blender 2.79 (sub 2), Commit date: 2018-02-05 09:31, Hash f9fcda5
bpy.data.node_groups["Emitter"].nodes["Emission"].spread_angle = 0.261799  # Property
Traceback (most recent call last):
  File "/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/engine/__init__.py", line 237, in view_draw
    self._framebuffer.draw(region_size, view_camera_offset, view_camera_zoom, self, context)
ReferenceError: StructRNA of type LuxCoreRenderEngine has been removed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/engine/__init__.py", line 259, in view_draw
    del self._session
ReferenceError: StructRNA of type LuxCoreRenderEngine has been removed

location: <unknown location>:-1
  # Error

# backtrace
./blender(BLI_system_backtrace+0x1d) [0x1a70fcd]
./blender() [0x1046c7b]
/lib/x86_64-linux-gnu/libc.so.6(+0x36cb0) [0x7f998d64ecb0]
/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/bin/pyluxcore.so(+0x2e531e) [0x7f997191631e]
/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/bin/pyluxcore.so(+0x2e6323) [0x7f9971917323]
/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/bin/pyluxcore.so(+0x6368ca) [0x7f9971c678ca]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7f998f0b4184]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f998d71603d]
Second crash, preview was finished and paused:

Code: Select all

# Blender 2.79 (sub 2), Commit date: 2018-02-05 09:31, Hash f9fcda5
bpy.context.space_data.viewport_shade = 'RENDERED'  # Property

# backtrace
/media/Workdata3/Development/blender_git/blender_master_build/blender_master/blender(BLI_system_backtrace+0x1d) [0x1a70fcd]
/media/Workdata3/Development/blender_git/blender_master_build/blender_master/blender() [0x1046c7b]
/lib/x86_64-linux-gnu/libc.so.6(+0x36cb0) [0x7f4b3cf59cb0]
/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/bin/pyluxcore.so(+0x2e531e) [0x7f4b2121631e]
/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/bin/pyluxcore.so(+0x2e6323) [0x7f4b21217323]
/home/jensverwiebe/.config/blender/2.79/scripts/addons/BlendLuxCore/bin/pyluxcore.so(+0x6368ca) [0x7f4b215678ca]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7f4b3e9bf184]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f4b3d02103d]
Jens
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Crash with small spread angles

Post by lighting_freak »

Hi,

So it's going to be fixed with one of upcoming releases?

BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Crash with small spread angles

Post by Dade »

lighting_freak wrote: Thu Feb 08, 2018 1:15 pm So it's going to be fixed with one of upcoming releases?
I have missed this one, I will look into this problem.
Support LuxCoreRender project with salts and bounties
jensverwiebe
Supporting Users
Posts: 141
Joined: Tue Jan 09, 2018 6:48 pm

Re: Crash with small spread angles

Post by jensverwiebe »

Found reason for my crasher: viewtopic.php?f=4&t=92&p=1466&sid=d18d2 ... 7bbb#p1466

The narrow <= 20 angle problem persists. I happens on bidir only.

Edit: ups wrong url first

Jens
Last edited by jensverwiebe on Thu Feb 08, 2018 3:18 pm, edited 1 time in total.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Crash with small spread angles

Post by B.Y.O.B. »

In general it's a good idea to open an issue on github rather than a forum post, a github issue is harder to miss for us :)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Crash with small spread angles

Post by Dade »

Ok, this is the chain of events leading to the crash:

- you have 30 triangle light sources with an area of about 10^-9 (i.e. very very small);

- once the theta is too small, the emitted power becomes nearly 0.

- default light strategy uses log(1+power) and it is 0 in your case (due to limited numerical precision).

- BIDIRCPU has no light to sample and crashes.

This bug affect only BIDIRCPU and LIGHTCPU. I fixed the case when there are no light sources to samples but you will end with a plain black image because your emitted power is too low for the log() precision. Try to use larger triangle if you want to use smaller thetas. Switching to a light strategy not using log() may help too.

P.S. you eye path is 1016 long, it may be a typo.
Support LuxCoreRender project with salts and bounties
lighting_freak
Posts: 234
Joined: Thu Jan 18, 2018 6:02 pm

Re: Crash with small spread angles

Post by lighting_freak »

Hi,

thanks for explaination. I think I got it, but one more question occurs.
- you have 30 triangle light sources with an area of about 10^-9 (i.e. very very small);
To generate this light source I simply made a "Circle" in Blender and filled it afterwards.
In Blender GUI it looks like a single surface. How can I see the number of triangles before running the render.

EDIT
Just ran a test using a simple plane instead of cricle. That should be 2 triangles right? Still the same. It crashes using angles smaller 20deg.
MyPrism.blend
(554.45 KiB) Downloaded 245 times
BTW
P.S. you eye path is 1016 long, it may be a typo.
Yes it is a typo.

BR
OS - Windows 7 X64
CPU - Intel CORE i7
GPU1 - Variants of notebook card from nVidia
GPU2 - Variants of notebook onboard card from Intel
Lux - Latest possible relaease
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Crash with small spread angles

Post by B.Y.O.B. »

You can add a triangulate modifier and enable "wire" and "show all edges" in object settings. (Note that the triangulation performed on export might be a bit different than the modifier does it, but it's an estimate).

You can also create your circle with the "triangle fan" fill method.
In general it's not a good idea to use a high poly light source, because each triangle is an individual light.

It might be better to use a quad with a blend texture generating the circle (control both emission and opacity).
Attachments
scrn_2018-02-10_10-30-25.png
scrn_2018-02-10_10-31-00.png
Post Reply