On this page |
When you start viewport rendering with Karma XPU, often the OptiX device may stall for a short time. The reason for this delay is that the renderer compiles programs for execution on the GPU. There’s a corresponding message in the viewport’s upper right corner.
Karma XPU differentiates between two fundamental types of programs:
-
Render kernels (XPU rendering code)
-
User shaders (custom user-created shader graphs, eg Materials or Light Filters)
The render kernels represent the core rendering code for XPU and are essential for the render process. This code can change depending on what is required for a scene and can take anywhere from a few seconds to several minutes to compile. Once compiled they are cached, meaning re-loading the same (or similar) scene will use the cached results and start instantly. But to avoid long initial waiting times, you can pre-compile the kernels. This feature was introduced in Houdini 21.
Pre-compiling render kernels:
-
is absolutely optional and doesn’t affect Karma XPU’s functionality or mode of operation
-
optimizes only the OptiX device (the EmbreeCPU device does not benefit)
-
is not necessary for Karma CPU
Note
You can only pre-compile render kernels. You can’t pre-compile user shaders, as it’s not possible to anticipate how the graphs will be arranged. Fortunately, user shaders typically compile much faster than render kernels, so they don’t present a significant performance issue.
When you start a fresh installation of Houdini for the first time and create a Solaris LOP node, you’ll get a message. The message suggests to pre-compile the kernels. If you don’t want to see this message in the future, you can click the appropriate button. If you want to pre-compile the kernels, you don’t have to do it when the message pops up, you can start this process at any time. On Houdini’s main menu’s Render dropdown menu you can find a Pre-compile Karma XPU Render Kernels entry.
We recommend to save your current work before you compile the kernels and free as many computer resources as possible. Some users reported that their computers became slow or even unresponsive during compilation. Once you've started the pre-compling, you can monitor its progress in the window.
You can also interrupt the process and resume later, it will pick up from where it left off. The entire process can take up several hours, but the actual time strongly depends on your system specifications.
Re-compiling ¶
There are also several occasions where it’s necessary to re-compile the kernels, for example with a new installation of Houdini or after a GPU driver update. When you render, you’ll see a viewport message telling you that it’s time to update the cache.
An invalid cache doesn’t affect the quality of the render, but Karma XPU will compile the missing kernels on the fly. In this case, please prepare for some waiting time again.
Cache Location ¶
The cache may use several gigabytes of disk space and is stored separately for each major Houdini release. To remove it and return to compile-as-you-go mode, delete the corresponding Houdini directory at the following location.
For Windows users, the Houdini 21.0 cache is stored here: C:\Users\USERNAME\AppData\Local\NVIDIA\OptixCache\Houdini21.0
For Linux users, it’s stored here: /var/tmp/OptixCache_USERNAME/Houdini21.0
Networks and farms ¶
Perhaps you already had the idea of storing the kernels centrally, for example on a network drive, with the intention of sharing the cache to avoid (p)re-compiling the kernels for every single machine. The kernels are compiled to very specific system and GPU specifications, and as such are not easily shared. We do not recommend this.
On farm machines you don’t have to pre-compile the kernels, because:
-
farm machines will compile shaders/kernels as needed
-
pre-compiling is mainly to improve interactive experience (which farm machines don’t need)