Rendering on the ETH Euler Cluster
Effect of the Feature
This feature enables us to perform rendering on the ETH euler cluster. To enable this, we modify Nori to work without including the GUI features but only using command line interface. For this, we add a build-option in CMake which can be activated when the application should be built without UI. To communicate with Euler, we use Visual Studio Code and the Remote-SSH extensions (link) which allows to connect directly to the cluster without the struggles of using a pure command line solution such as PuTTY. One important component of the whole approach is, that we save EXR-images every couple of seconds which can be viewed through VSCode to inspect the current progress (and one does not need to finish the render to see the result).
Technical Implementation
To enable rendering without UI, we enable change the system in different places.
- We add a flag
BUILD_WITH_UI
to the CMakeLists.txt to either include or exclude the nanogui dependency - We add a class
nogui.cpp
which has similar functionality togui.cpp
but does not have a dependency on nanogui.
Additionally, this class saves the current render result every 20 seconds to give a preview of the rendering process, and it prints out the current percentage of the render progress.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_UI=false ../cg-project-2022/nori/
New jobs can be run using the following command:
sbatch --ntasks=1 --cpus-per-task=16 --wrap="./nori ../cg-project-2022/nori/scenes/pa4/cbox/cbox_path_mis.xml"
We would like to point out that this is where the number of CPUs can be defined of which Nori can take advantage.
Validation
Renders can be performed on the Cluster which we see as validation enough. The resulting output of our renderer is written to the slurm-<job-id>.out
file.
Code Coordinates
This feature touches the following files:
- CMakeLists.txt (flag and logic to include or not include the nanogui dependency)
- nogui.cpp (initialization of the render process and progress reporting)
- main.cpp (based on the -DBUILD_WITH_UI-flag, we include or not include nanogui and either directly render the scene or show a UI.
This is mainly achieved using compiler-directives, i.e.
#if defined(WITH_UI) ... #endif
)