# OpenGL2 reslice performance issues on windows (moved)

**URL:** https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914
**Category:** Uncategorized
**Created:** [January 23, 2018, 4:44pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914 "2018-01-23T16:44:14Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)
#### Post date: [January 23, 2018, 4:44pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/1 "2018-01-23T16:44:14Z")

</div>

Thread moved from [here](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/6) 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.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [January 18, 2018, 3:41pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/2 "2018-01-18T15:41:11Z")

</div>

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/6):
>
> the nightly crashes when started over remote desktop but the 4.8.1 release does not (probably the OpenGL2 issue)

Yes, this is a known issue - see details and workarounds [here](https://issues.slicer.org/view.php?id=4252).

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/6):
>
> I see the same slowdown in Slice rendering that Andras reported

@pieper Can you try if disabling “Threaded optimization” (in Windows Control Panel → NVidia Control Panel) makes it better?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [January 18, 2018, 3:58pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/3 "2018-01-18T15:58:37Z")

</div>

@lassoan

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/9):
>
> Yes, this is a known issue - see details and workarounds here.

Yes, that’s what I meant by ‘the OpenGL2 issue’

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/9):
>
> @pieper Can you try if disabling “Threaded optimization” (in Windows Control Panel -\> NVidia Control Panel) makes it better?

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.

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/10):
>
> vtkmodules package is not expected to exist in the current nightly

must happen during the installer step then?

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [January 18, 2018, 4:18pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/4 "2018-01-18T16:18:04Z")

</div>

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/13):
>
> Do you need to restart the machine or something to make it work?

Yes, you need to restart your computer.

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/13):
>
> 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.

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.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [January 18, 2018, 9:15pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/5 "2018-01-18T21:15:44Z")

</div>

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/15):
>
> Yes, you need to restart your computer.

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

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [January 18, 2018, 9:27pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/6 "2018-01-18T21:27:09Z")

</div>

What frame rate do you get with Slicer-4.8.1?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [January 18, 2018, 11:12pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/7 "2018-01-18T23:12:37Z")

</div>

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/20):
>
> 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)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [January 19, 2018, 12:30am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/8 "2018-01-19T00:30:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [January 19, 2018, 1:10am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/9 "2018-01-19T01:10:58Z")

</div>

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](https://www.nvidia.com/object/nsight.html)

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [January 19, 2018, 1:39pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/10 "2018-01-19T13:39:20Z")

</div>

> [@Vtk python does not import on today's windows nightly](https://discourse.slicer.org/t/vtk-python-does-not-import-on-todays-windows-nightly/1868/22):
>
> Do you think the VTK team could investigate this? What can we do to move things forward?

Cc: @Sankhesh_Jhaveri

---

<div class="post-metadata">

### Author: ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)
#### Post date: [October 29, 2019, 11:50pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/11 "2019-10-29T23:50:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [October 30, 2019, 12:26am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/12 "2019-10-30T00:26:11Z")

</div>

> [@Prashant\_Pandey](#):
>
> I just wanted to say I still experienced this issue in 4.10.2

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

---

<div class="post-metadata">

### Author: ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)
#### Post date: [October 30, 2019, 12:38am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/13 "2019-10-30T00:38:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [October 30, 2019, 3:29am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/14 "2019-10-30T03:29:21Z")

</div>

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](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).

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [October 30, 2019, 3:48am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/15 "2019-10-30T03:48:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)
#### Post date: [October 30, 2019, 3:52am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/16 "2019-10-30T03:52:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [October 30, 2019, 4:05am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/17 "2019-10-30T04:05:04Z")

</div>

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

> [@Can I choose which GPU to use?](https://discourse.slicer.org/t/can-i-choose-which-gpu-to-use/3149):
>
> Hi all, I’m using a gaming laptop (Dell Alienware 13 R3) which comes with an NVIDIA GeForce GTX 1060 GPU. Is there a way to configure Slicer to use it instead of the default GPU?

---

<div class="post-metadata">

### Author: ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)
#### Post date: [October 30, 2019, 4:22am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/18 "2019-10-30T04:22:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [October 30, 2019, 4:24am UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/19 "2019-10-30T04:24:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Prashant\_Pandey](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@Prashant\_Pandey](https://discourse.slicer.org/u/Prashant_Pandey)
#### Post date: [October 30, 2019, 8:18pm UTC](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914/20 "2019-10-30T20:18:10Z")

</div>

@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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/f/6fa24e60f41ee00a4a0518080d21b75c572c857f.png)

[Next page](https://discourse.slicer.org/t/opengl2-reslice-performance-issues-on-windows-moved/1914.md?page=2)
