OpenCL Error

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.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

OpenCL Error

Post by CodeHD »

Using yesterday's daily build of BlendLuxCore on Win10.

I just had an error with OpenCL trying to render an animation.

It ran fine for 57 frames, then aborted on frame 58. Only rotating objects in the scene, no light changes etc.

error below, full console output for frame 58 attached.
Won't be relevant for me (I hope) since I'm trying to switch to Optix, but perhaps you still need to fix it for others.

Blend-file is quite large, let me know if you need it for testing.

Code: Select all

Traceback (most recent call last):
  File "C:\Users\johannes\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlendLuxCore-daily\engine\base.py", line 86, in render_final
    final.render(self, depsgraph)
  File "C:\Users\johannes\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlendLuxCore-daily\engine\final.py", line 48, in render
    _render_layer(engine, depsgraph, statistics, layer)
  File "C:\Users\johannes\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlendLuxCore-daily\engine\final.py", line 153, in _render_layer
    engine.framebuffer.draw(engine, engine.session, depsgraph.scene, render_stopped=False)
  File "C:\Users\johannes\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\BlendLuxCore-daily\draw\final.py", line 71, in draw
    self._width, self._height, combined.as_pointer(), False, True)
RuntimeError: OpenCL driver API error (code: -4, file:D:\a\1\Luxcore\src\luxrays\devices\ocldevice.cpp, line: 313): CL_MEM_OBJECT_ALLOCATION_FAILURE

ERROR: OpenCL driver API error (code: -4, file:D:\a\1\Luxcore\src\luxrays\devices\ocldevice.cpp, line: 313): CL_MEM_OBJECT_ALLOCATION_FAILURE

[LuxCore][3272.657] [GeForce RTX 2070 OpenCLIntersect] Memory used for hardware image pipeline: 56700Kbytes
Error: OpenCL driver API error (code: -4, file:D:\a\1\Luxcore\src\luxrays\devices\ocldevice.cpp, line: 313): CL_MEM_OBJECT_ALLOCATION_FAILURE
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenCL Error

Post by Dade »

It looks like a memory leak, can you check the system reported amount of GPU memory during the renderings.
Support LuxCoreRender project with salts and bounties
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: OpenCL Error

Post by CodeHD »

Indeed, there is about a 100MB increase per frame, at 1920x1080 resolution.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: OpenCL Error

Post by CodeHD »

The problem seems to be gone with Optix enabled.
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: OpenCL Error

Post by CodeHD »

There have been a few reports of this on the discord server in the last days. People reporting Blender crash when doing animations. In those cases it was the combination of Nvidia GPU and OpenCL. I can also confirm it with an RTX 2070 as well as GTX 765M (i.e. across several GPU generations).

1.) I wanted to give feedback if you get similar support requests, especially for 2.4 where OCL is the default.

2.) For BlendLuxCore: this could be incorporated into the existing "improve CUDA/Optix default settings" topic

3.) For LuxCore It's probably the usual question: Bug or Driver?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenCL Error

Post by Dade »

Do you have a (simple) test animation to replicate problem ?
Support LuxCoreRender project with salts and bounties
CodeHD
Donor
Donor
Posts: 437
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: OpenCL Error

Post by CodeHD »

The default cube already shows it, scene set up with halt conditions attached.

On my laptop now it's about 20MB per frame, so maybe you have to wait a minute or two to notice it. I don't have access to the scene that suffered 100MB per scene right now.
Attachments
oclleak.zip
(91.32 KiB) Downloaded 162 times
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenCL Error

Post by Dade »

I should have fixed the problem.
Support LuxCoreRender project with salts and bounties
Skaven252
Posts: 4
Joined: Tue Apr 27, 2021 4:08 am

Re: OpenCL Error

Post by Skaven252 »

Hello. I appear to have run into the same problem. I'm using LuxCore with Blender 2.92, NVidia RTX 2080, CUDA GPU acceleration. Studio Driver 461.40. Render engine: Path, with Light Tracing enabled.

The GPU memory usage seems to increase a bit every time I switch to rendered viewport mode, and if I render an animation/sequence, it fails after some 40-50 frames with a CL_MEM_OBJECT_ALLOCATION_FAILURE. If I render a single frame, the memory usage goes up, then when I switch to flat shaded mode it goes back down - but it fills up a bit further every time. The only way to flush the memory is to quit and restart Blender.

I have to switch to CPU only, to be able to render a full sequence.

I can upload the Blender scene if needed, but it has a liquid simulation added with some 3 GB of cache data. However as CodeHD said it happens with the default cube scene as well.
Last edited by Skaven252 on Tue Apr 27, 2021 8:27 pm, edited 1 time in total.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenCL Error

Post by Dade »

What LuxCore version are you using ? Does it happen with also with a cube-only scene ? About in how many frames ?
Support LuxCoreRender project with salts and bounties
Post Reply