OpenGL2 reslice performance issues on windows (moved)

This does not show the important part: have you set Slicer.exe or SlicerApp-real.exe to use the GPU?

It’s slicerapp-real.exe

Do you see different values in “Reslicing” test in “Performance Tests” module when you enable/disable Slicer to use the NVidia GPU?

No difference, I get 60fps both ways. Nvidia control panel doesnt give me the option to disable the nvidia gpu - just to switch between ‘Auto-select’ and ‘GTX 1070’.

I actually think, unusually, my laptop only has the nvidia GPU and no integrated intel gpu - I checked in device manager and ‘dxdiag’.

Maybe I should start a separate thread - but is there a way to improve the frame rate in general and specifically for volume rendering? When rendering two volumes my frame rate never goes higher than ~18-19 fps. I’ve selected ‘adaptive’ and told Slicer that the GPU memory is 8GB. However I can see that only about ~25% of the GPU memory is being utilized.

60fps is due to vsync lock, you reached the max refresh rate. It is usually does not work like this on an integrated graphics card, so this also suggest that Slicer uses the NVidia GPU.

Improving frame rate for volume rendering is very different from improving frame rate in general.

Volume rendering is usually very fast on a fast GPU, because the entire image is uploaded in the GPU memory and the CPU barely needs to do anything. It would be great if you could do some profiling. Best is if you build Slicer in RelWithDebInfo mode and use VisualStudio performance profiler. But first you may just try to attach VerySleepy to your current Slicer and see if any method call stands out as potential culprit.

Is rendering much faster if you don’t keep changing the clipping plane? Maybe changing the clipping plane triggers shader recompilations or other lengthy operations. Is it faster if you render in only one 3D view or render only a single volume?

Yes, rendering is slightly faster (20-25fps) when the clipping plane isn’t changing and there is only one volume being rendered. When there are two volumes and clipping plane it’s about 15 fps. When I use the depth peeling option it drops further to 10fps.

In task manager I can see that slicer is using significant CPU resources (approx 40%) while GPU usage is 10-25%. I haven’t used the other profiling tools before, but I will give them a go.

In Nvidia control panel, does changing the power management from “optimal power” to “performance” help?

@lassoan here is the profiling (using very sleepy) from when I am doing volume rendering and dynamic cropping. I don’t really know what this information means so I would appreciate if you could help me understand what’s going on. https://drive.google.com/open?id=1DayvbsKzwnw_2EALrltEnNPokEwjqkt7

@muratmaga No significant difference between using the optimal power and maximum/performance power settings.

Additionally I have noticed that the longer a scene is loaded, the general frame rate for all views/visualizations drops over time even if no new data has been loaded into the scene. For example frame rated dropped by 4-6 fps when volume rendering when the scene had been loaded for about an hour.

Small update: A few settings in Nvidia control panel which have helped overall framerate improve (particularly in Slice Views)
Threaded Optimization: ON
Vsync: OFF (I don’t think this is doing much for the 3D viewer)
Maximum pre-rendered frames: 1 (AKA ‘Low Latency Mode’ in updated nvidia control panel - turn it on)

With these 2D reslicing is very very smooth. However, two 3D volume renderings using depth peeling and dynamic ROI cropping are still at roughly 14-15 fps. I think this is partly due to the ROI as I mentioned above, but also because I have a few models being displayed with opacities < 1.

1 Like