OpenGL2 reslice performance issues on windows (moved)

Thread moved from here where @pieper said:

Other notes: the nightly crashes when started over remote desktop but the 4.8.1 release does not (probably the OpenGL2 issue) and I see the same slowdown in Slice rendering that Andras reported.

Yes, this is a known issue - see details and workarounds here.

@pieper Can you try if disabling ā€œThreaded optimizationā€ (in Windows Control Panel ā†’ NVidia Control Panel) makes it better?

@lassoan

Yes, thatā€™s what I meant by ā€˜the OpenGL2 issueā€™

I tried a bit but it didnā€™t obviously help. I changed the setting to Off and restarted Slicer. Do you need to restart the machine or something to make it work? In any case we should try to get to the heart of the issue because users wonā€™t want to change that level of config just to run Slicer.

must happen during the installer step then?

Yes, you need to restart your computer.

Completely agree. Some gamers keep this option turned off to get more predictable frame rates, but Slicer should not require this. Anyway, letā€™s see first if it fixes the performance problem for you.

Interesting:
with threading optimization on: 8 fps
with threading optimization off, then restart slicer: 15 fps
with threading optimization off, then restart computer: 16.6 fps

What frame rate do you get with Slicer-4.8.1?

41.6 fps with 4.8.1(same machine, same data, slightly bigger slice window size 272x412, instead of 186x420 for the nightly)

This slowdown is unacceptable.
@jcfr Do you think the VTK team could investigate this? What can we do to move things forward?

For the record, my system is running a GTX 1080 that runs everything else very fast.

Has anyone tried profiling their GPU? e.g. with https://www.nvidia.com/object/nsight.html

Cc: @Sankhesh_Jhaveri

I just wanted to say I still experienced this issue in 4.10.2.
I used @lassoan tip and turned off threaded optimization in Nvidia control panel.
Performance jumped from 8-10 fps to 18fps when rendering two volumes in two different 3D views with transformed ROIs dynamically cropping the volume.

What operating system, CPU, and graphics card do you have?

Windows 10, Intel i7-6700HQ @ 2.6GHz, nVidia GTX 1070, 32GB RAM

This is odd. On computers that we tested on, using Intel TBB as SMP backend took care of interference of NVidia threaded optimization (see https://github.com/Slicer/Slicer/pull/930).

Have you built Slicer or extensions yourself? Do you use Intel TBB as SMP backend? (by default, it is used on Windows, but you can double-check the value of Slicer_VTK_SMP_IMPLEMENTATION_TYPE CMake variable).

Does calling vtk.vtkMultiThreader.SetGlobalMaximumNumberOfThreads(1) make any difference?

Maybe you can try to update your NVidia drivers. It would be also nice if you could test on a more recent computer (6th generation Intel CPUs are about 5 years old now, maybe a new model could be significantly faster).

Have you tried setting the default rendering quality to Normal, instead of Adaptive? For me that usually makes a significant differenceā€¦

I havenā€™t built Slicer or any extensions myself - Iā€™m using the prebuilt binary and all extensions are installed using the extensions browser. I wrote a couple of python modules for my project using the extension wizard.

A couple of things to note which are different from the github issue you linked. I noticed a speed up in volume rendering, instead of slice scrolling, by disabling threaded optimization. Secondly, this is on a laptop and not a desktop.

I will try on a newer CPU, but the newest I have available is a desktop i7-7700 with nvidia 1060.

@muratmaga I tried changing between adaptice and normal, but this didnā€™t make a huge difference in frame rate. The biggest speed up (in addition to disabling threaded optim.) was by not using a dynamic cropping ROI.

If this is a laptop, you are certain that Slicer using the Nvidia GPU (not the integrated intel one).

1 Like

Good point. I checked my nvidia settings and it is ambiguous whether Slicer was using the integrated or nvidia GPU (the options and menu are different from the thread you linked). I will test again tomorrow with the same setup, this time focing slicer to use the nvidia gpu and report on the frame rate.

Installation path will differ, but the important thing to make sure that SlicerApp-real.exe is added, not Slicer.exe

@muratmaga @lassoan The framerate didnā€™t change when forcing slicer to use the nvidia GPU, which implies it was using it previously. Iā€™ve attached a screenshot of the nvidia control panel settings:
image