Page 1 of 1

Problems with CUDA in recent versions

Posted: Wed Dec 09, 2020 4:32 pm
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

Re: Problems with CUDA in recent versions

Posted: Thu Dec 10, 2020 10:57 am
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

Re: Problems with CUDA in recent versions

Posted: Mon Dec 14, 2020 12:27 pm
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.

Re: Problems with CUDA in recent versions

Posted: Sat Dec 19, 2020 9:22 pm
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.

Re: Problems with CUDA in recent versions

Posted: Sat Dec 19, 2020 9:30 pm
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.

Re: Problems with CUDA in recent versions

Posted: Sun Dec 20, 2020 10:13 am
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.

Re: Problems with CUDA in recent versions

Posted: Tue Dec 22, 2020 12:54 pm
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.

Re: Problems with CUDA in recent versions

Posted: Wed Dec 23, 2020 8:40 am
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.

Re: Problems with CUDA in recent versions

Posted: Tue Jan 19, 2021 9:54 am
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 :)