Building LuxCoreRender - FAQ: Difference between revisions
| (38 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== Is it possible | == Is it possible to set-up a local-only, end-to-end, build chain? == | ||
Yes it is | Yes it is, but for Linux only, at the moment, and starting with v2.11. | ||
<p>Also, important caveat: this kind of build is solely intended for development and tests. Do not use in production</p> | |||
* Step#1: Build dependencies locally | |||
Build a wheel | Use [[Building_LuxCoreRender#Local_Plain_Build|local plain build]] or [[Building_LuxCoreRender#Local_Continuous_Integration | local CI build]] of LuxCoreDeps | ||
* Step#2: Inject local dependencies in LuxCore build | |||
<pre>python -m build-system.luxmake.deps --local <path/to/deps> --release test</pre> | |||
* Step#3: Build a testing wheel | |||
<pre>make wheel-test</pre> | <pre>make wheel-test</pre> | ||
Inject wheel for test in Blender: | |||
* Step#4: Inject testing wheel in Blender: | |||
Use [[Developing_and_debugging_BlendLuxCore | BlendLuxHelper]] | |||
For a debugging with luxcoreui only, one can also replace steps #3 & #4 by: | |||
* Step#3bis: Build luxcoreui: | |||
<pre>make luxcoreui</pre> | |||
== Can I use <code>git bisect</code>? == | |||
Yes, if you need to find a faulty commit in <code>LuxCore</code>, you can use <code>git bisect</code>. | |||
In that case, please note the correct verb to build LuxCoreRender at each step is | |||
<pre>make clear && make deps && make</pre> | |||
Caveat: this method only works for version >= v2.10.0 | |||
Example for Linux (please adapt to other contexts): | |||
<pre> | |||
# Start git bisecting | |||
git bisect start | |||
# Define bounds | |||
git bisect good samples-v2.10.0 # For instance | |||
git bisect bad HEAD | |||
# Build the app, test it and report status to git bisect | |||
make clear && make deps && make # Build at this stage | |||
./out/install/Release/bin/luxcoreui mytestscene/render.cfg | |||
git bisect <good|bad|skip> # Depending on above test... | |||
# Bisection loop | |||
... | |||
# At a certain point, the bisection stops and points at the faulty commit | |||
# You can reset bisection | |||
git bisect reset | |||
</pre> | |||
== Can I generate debug information for dependencies (LuxCoreDeps)? == | |||
Yes, it's possible, but only for local build, at the moment. | |||
In this context, the build type is controlled by <code>DEPS_BUILD_TYPE</code> environment variable, so set it to your target build type before building: | |||
<pre>export DEPS_BUILD_TYPE=Debug</pre> | |||
After having built dependencies in local, you may want to inject them in LuxCore. This can be done with the following: | |||
<pre>python -m build-system.luxmake.deps --local <path/to/deps> --release test --build-type=Debug</pre> | |||
(this replaces <code>make deps</code>) | |||
== How can I build a sanitized version of LuxCore? == | |||
It is possible to build a sanitized version of LuxCore, including <code>luxcoreui</code>, <code>luxcoreconsole</code>, <code>pyluxcore</code> and the wheels. | |||
It just consists in setting the environment variable <code>LUX_SANITIZE</code>: | |||
<pre>export LUX_SANITIZE=1 # or whatever value you want</pre> | |||
To come back to unsanitized build, just <code>unset LUX_SANITIZE</code>. | |||
2 caveats: | |||
* You'll need to export the following before running LuxCore: | |||
<pre>ASAN_OPTIONS=protect_shadow_gap=0</pre> | |||
otherwise LuxCore will stop early with the following error message: | |||
<pre>terminate called after throwing an instance of 'std::runtime_error' | |||
what(): CUDA driver API error CUDA_ERROR_NOT_INITIALIZED | |||
</pre> | |||
* Unfortunately, sanitized version of the wheel will not do with Blender, as Blender has special code to control sanitizing and will override ours. | |||
== In Linux, I try to set an environment variable that should control LuxCore build, but it does not work == | |||
In Linux, for LuxCore build system to take them into account, the environment variables that control the build (LUX_BUILD_TYPE, LUX_SANITIZE...) should not only be set, but also exported: | |||
<pre>export LUX_BUILD_TYPE=Debug # `set LUX_BUILD_TYPE=Debug` would be insufficient</pre> | |||
Latest revision as of 11:07, 26 April 2026
Is it possible to set-up a local-only, end-to-end, build chain?
Yes it is, but for Linux only, at the moment, and starting with v2.11.
Also, important caveat: this kind of build is solely intended for development and tests. Do not use in production
- Step#1: Build dependencies locally
Use local plain build or local CI build of LuxCoreDeps
- Step#2: Inject local dependencies in LuxCore build
python -m build-system.luxmake.deps --local <path/to/deps> --release test
- Step#3: Build a testing wheel
make wheel-test
- Step#4: Inject testing wheel in Blender:
Use BlendLuxHelper
For a debugging with luxcoreui only, one can also replace steps #3 & #4 by:
- Step#3bis: Build luxcoreui:
make luxcoreui
Can I use git bisect?
Yes, if you need to find a faulty commit in LuxCore, you can use git bisect.
In that case, please note the correct verb to build LuxCoreRender at each step is
make clear && make deps && make
Caveat: this method only works for version >= v2.10.0
Example for Linux (please adapt to other contexts):
# Start git bisecting git bisect start # Define bounds git bisect good samples-v2.10.0 # For instance git bisect bad HEAD # Build the app, test it and report status to git bisect make clear && make deps && make # Build at this stage ./out/install/Release/bin/luxcoreui mytestscene/render.cfg git bisect <good|bad|skip> # Depending on above test... # Bisection loop ... # At a certain point, the bisection stops and points at the faulty commit # You can reset bisection git bisect reset
Can I generate debug information for dependencies (LuxCoreDeps)?
Yes, it's possible, but only for local build, at the moment.
In this context, the build type is controlled by DEPS_BUILD_TYPE environment variable, so set it to your target build type before building:
export DEPS_BUILD_TYPE=Debug
After having built dependencies in local, you may want to inject them in LuxCore. This can be done with the following:
python -m build-system.luxmake.deps --local <path/to/deps> --release test --build-type=Debug
(this replaces make deps)
How can I build a sanitized version of LuxCore?
It is possible to build a sanitized version of LuxCore, including luxcoreui, luxcoreconsole, pyluxcore and the wheels.
It just consists in setting the environment variable LUX_SANITIZE:
export LUX_SANITIZE=1 # or whatever value you want
To come back to unsanitized build, just unset LUX_SANITIZE.
2 caveats:
- You'll need to export the following before running LuxCore:
ASAN_OPTIONS=protect_shadow_gap=0
otherwise LuxCore will stop early with the following error message:
terminate called after throwing an instance of 'std::runtime_error' what(): CUDA driver API error CUDA_ERROR_NOT_INITIALIZED
- Unfortunately, sanitized version of the wheel will not do with Blender, as Blender has special code to control sanitizing and will override ours.
In Linux, I try to set an environment variable that should control LuxCore build, but it does not work
In Linux, for LuxCore build system to take them into account, the environment variables that control the build (LUX_BUILD_TYPE, LUX_SANITIZE...) should not only be set, but also exported:
export LUX_BUILD_TYPE=Debug # `set LUX_BUILD_TYPE=Debug` would be insufficient