Page MenuHome

Cycles OpenCL: Proposal Select better base features to reduce recompilation
Closed, ResolvedPublic


Currently there are many features that will trigger a recompilation. This design task will reevaluate the current setup and come with a better approach.

Current situation

  • NODE_GROUP_LEVEL_*: currently all the scenes of our benchmark always uses NODE_GROUP_LEVEL_MAX during foreground and background rendering. As these are always selected we could remove this, or come with a better set for eacht NODE_GROUP_LEVEL_?
  • NODE_FEATURE_*: There are some compile directives and node features that are linked. like NODE_FEATURE_VOLUME and use_volume. NODE_FEATURE_HAIR and use_hair.
  • all features are detected based on the existing of nodes or other data in the scene.


We have done several experiments by enabling different features by default. We used the BMW, Classroom, Pavilion, Fishy cat and Barbershop scenes for benchmarking.
The reference hardware is AMD Ryzen 1700 with 16GB ram and a Vega Frontier Edition.
We tested these configurations during background rendering.

Subsurface and volumes did not increased the render time noticeable, but most of the compilation time is concentrates around those two features. Enable other features will increase the compilation times for volume and subsurface.

Current situationProposalEnable hairEnable motionEnable subsurfaceEnable volumeEnable subsurface + volumeProposed + subsurface
Compile times12.2515.6113.1912.5316.9221.8425.7318.71
Render times1:351:371:461:461:371:391:401:40


  • Enable use_transparent by default
  • Enable use_shadow_tricks by default
  • Enable use_transparent by default
  • Enable use_principled by default
  • Enable use_denoising by default
		experimental = false;
		max_nodes_group = NODE_GROUP_LEVEL_MAX;
		nodes_features = 0;
		use_hair = false;
		use_object_motion = false;
		use_camera_motion = false;
		use_baking = false;
		use_subsurface = false;
		use_volume = false;
		use_integrator_branched = false;
		use_patch_evaluation = false;
		use_transparent = true;
		use_shadow_tricks = true;
		use_principled = true;
		use_denoising = true;
		use_shader_raytrace = false;
		use_true_displacement = false;
		use_background_light = false;
Compile times12.2515.61
Render times1:351:37
Compile times12.1415.42
Render times3:383:28
Compile times30.9434.15
Render times9:219:22
Compile times12.6315.37
Render times7:507:47
Compile times13.519.48
Render times3:143:16

User experience

With this new setup the kernels will be less recompiled when building a scene (or doing the lighting). Kernels will still need to be compiled when

  • switching between path tracing and branched path
  • enable hair
  • enable volumetric
  • enable subsurface
  • enable subdivision patch evaluation
  • use nodes that use raytracing techniques ( NODE_BEVEL and NODE_AMBIENT_OCCLUSION)
  • use camera or object motion (background rendering only)

I would only suggest to enable these defaults in foreground and background rendering. The selected features are not noticeable in compilation time and rendertime.



Event Timeline

Jeroen Bakker (jbakker) triaged this task as Normal priority.
Jeroen Bakker (jbakker) updated the task description. (Show Details)
Jeroen Bakker (jbakker) updated the task description. (Show Details)

I would propose to implement this as a last step. In the upcoming month I want to reorganize the kernels and that might influence the choices made here. I don't think that the proposed choices stated above will be effected, only we might want to add subsurface or volume when we are able to get their compile times better.

Interesting stats. I agree we can enable the proposed features always.

There is some possibility to optimize some of the more expensive features individually so that maybe they can become part of the default too, but we'll have to see if there is enough time.

@Brecht Van Lommel (brecht)
I apologize, I thought they were related and that they could be good insights from a user perspective that could also be useful via development to do "the possibility of excluding individual objects or individual functions not strictly necessary" from the rendering.