Problems with CUDA in recent versions

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
User avatar
74hc595
Posts: 18
Joined: Tue Sep 22, 2020 11:39 am

Problems with CUDA in recent versions

Post by 74hc595 »

I can't use recent daily LuxCore builds due to CUDA errors:
reloading addon: BlendLuxCore 1607237575.4292386 1607529090.1397486 '/home/1/.config/blender/2.91/scripts/addons/BlendLuxCore/__init__.py'
Modules Installed () from '/home/1/lux_builds/2.5_b1/BlendLuxCore-latest-linux64.zip' into '/home/1/.config/blender/2.91/scripts/addons'
Exception in module register(): /home/1/.config/blender/2.91/scripts/addons/BlendLuxCore/__init__.py
Traceback (most recent call last):
File "/home/1/blender/blender-2.91.0-linux64/2.91/scripts/modules/addon_utils.py", line 382, in enable
mod.register()
File "/home/1/.config/blender/2.91/scripts/addons/BlendLuxCore/__init__.py", line 93, in register
pyluxcore.Init(LuxCoreLog.add)
RuntimeError: CUDA driver API error CUDA_ERROR_UNKNOWN (code: 999, file:/home/vsts/work/1/s/LinuxCompile/LuxCore/src/luxrays/core/init.cpp, line: 71): unknown error
I have an older GPU and want to use only CPU for rendering, but LuxCore in Blender crashes with this error immediately upon initialization.
I tried to build from source with flag for disabling CUDA and leaving only OpenCL enabled, but even though CUDA is disabled, I still get an error:
[ 52%] Building CXX object src/slg/CMakeFiles/slg-core.dir/engines/oclrenderengine.cpp.o
/home/1/lux_builds/src/LuxCore-latest/src/slg/engines/oclrenderengine.cpp: In constructor ‘slg::OCLRenderEngine::OCLRenderEngine(const slg::RenderConfig*, bool)’:
/home/1/lux_builds/src/LuxCore-latest/src/slg/engines/oclrenderengine.cpp:128:5: error: ‘CUDADeviceDescription’ was not declared in this scope
128 | CUDADeviceDescription *cudaDesc = (CUDADeviceDescription *)desc;
| ^~~~~~~~~~~~~~~~~~~~~
/home/1/lux_builds/src/LuxCore-latest/src/slg/engines/oclrenderengine.cpp:128:28: error: ‘cudaDesc’ was not declared in this scope; did you mean ‘cudaDescs’?
128 | CUDADeviceDescription *cudaDesc = (CUDADeviceDescription *)desc;
| ^~~~~~~~
| cudaDescs
/home/1/lux_builds/src/LuxCore-latest/src/slg/engines/oclrenderengine.cpp:128:63: error: expected primary-expression before ‘)’ token
128 | CUDADeviceDescription *cudaDesc = (CUDADeviceDescription *)desc;
| ^
make[2]: *** [src/slg/CMakeFiles/slg-core.dir/build.make:290: src/slg/CMakeFiles/slg-core.dir/engines/oclrenderengine.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:466: src/slg/CMakeFiles/slg-core.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
Is it possible to build LuxCore for OpenCL only, or even better, for the CPU only?

Update:
I built it without OpenCL and CUDA, but Blender addon still fails to run:
Could not import pyluxcore.

ImportError: /usr/lib/x86_64-linux-gnu/libjemalloc.so.2: cannot allocate memory in static TLS block
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Problems with CUDA in recent versions

Post by Dade »

74hc595 wrote: Wed Dec 09, 2020 4:32 pm I have an older GPU and want to use only CPU for rendering, but LuxCore in Blender crashes with this error immediately upon initialization.
CUDA_ERROR_UNKNOWN is a quite strange error for CUDA and you may have a broken CUDA/driver installation.
74hc595 wrote: Wed Dec 09, 2020 4:32 pm I tried to build from source with flag for disabling CUDA and leaving only OpenCL enabled, but even though CUDA is disabled, I still get an error:
I should have fixed this problem.
74hc595 wrote: Wed Dec 09, 2020 4:32 pm Update:
I built it without OpenCL and CUDA, but Blender addon still fails to run:
Could not import pyluxcore.

ImportError: /usr/lib/x86_64-linux-gnu/libjemalloc.so.2: cannot allocate memory in static TLS block
You should probably not use jemalloc, it is specific problem of jemalloc/blender/your installation, if you put "libjemalloc cannot allocate memory in static TLS block" in Google you can get some feedback but it is not a problem related to LuxCore: https://devtalk.blender.org/t/problem-w ... odule/7367
Support LuxCoreRender project with salts and bounties
User avatar
74hc595
Posts: 18
Joined: Tue Sep 22, 2020 11:39 am

Re: Problems with CUDA in recent versions

Post by 74hc595 »

Thank you!
I'll update drivers and give it a try again this evening. I didn't use jemalloc anywhere, but maybe precompiled OIDN is using it. I'll try building it from source too with jemalloc disabled.
User avatar
74hc595
Posts: 18
Joined: Tue Sep 22, 2020 11:39 am

Re: Problems with CUDA in recent versions

Post by 74hc595 »

I've tried with most recent version, and it compiles properly with OpenCL support but I still get that jemalloc error, which is weird because when I search the sources for "jemalloc", it occurs literally nowhere, including OIDN.
I updated to most recent NVidia drivers, but still get CUDA_ERROR_UNKNOWN with beta version (maybe it's because I have an old GPU?).
I can't try with daily builds, because there seems to be no Linux build anymore.
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: Problems with CUDA in recent versions

Post by acasta69 »

74hc595 wrote: Sat Dec 19, 2020 9:22 pm I can't try with daily builds, because there seems to be no Linux build anymore.
Last time the Linux build was not uploaded, most probably because a problem on Azure servers.
A new one should be available in short time.
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
User avatar
74hc595
Posts: 18
Joined: Tue Sep 22, 2020 11:39 am

Re: Problems with CUDA in recent versions

Post by 74hc595 »

Thanks! I'll wait for it, LuxCore is my favourite renderer (especially for volumes and caustics) and I really want to be able to use it again.

Update: I tried newest daily build, but still get CUDA_ERROR_UNKNOWN.
I really wish there was an option to avoid CUDA at all, I only use BiDir cpu renderer anyway.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Problems with CUDA in recent versions

Post by B.Y.O.B. »

74hc595 wrote: Sun Dec 20, 2020 10:13 am I really wish there was an option to avoid CUDA at all, I only use BiDir cpu renderer anyway.
Then it is probably used for the film device. You can change that to OpenCL or CPU in the addon preferences.
User avatar
74hc595
Posts: 18
Joined: Tue Sep 22, 2020 11:39 am

Re: Problems with CUDA in recent versions

Post by 74hc595 »

I used to do that in earlier daily builds and it worked perfectly that way. In recent builds I get unknown CUDA error when I try to enable addon, so I can't even get to addon preferences and disable it.
User avatar
74hc595
Posts: 18
Joined: Tue Sep 22, 2020 11:39 am

Re: Problems with CUDA in recent versions

Post by 74hc595 »

I tried recent daily build and it works perfectly now. It automatically switches to CPU-only.
Thanks for fixing this!
I'll post some new renders soon :)
Post Reply