# Better GPU will benefit or not VR volume rendering

**URL:** <https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008>\
**Category:** Support\
**Created:** [December 10, 2021, 4:31pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008 "2021-12-10T16:31:57Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 14, 2021, 8:29am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/21 "2021-12-14T08:29:34Z")

</div>

That’s all I can get in Volume Rendering with your eyeglobe data using a 6700XT on Linux.

 ![unusable](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/d/8d0a8913247a913f07116882dfd69c80fcfbecb7.png)

Unusable.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 14, 2021, 9:58am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/22 "2021-12-14T09:58:28Z")

</div>

This is after rescaling the intensity range from 0 to 5000.

 ![better](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/a/2ad9f370e7f7f0a1b3ad40767c7b6520ed46f1a8.jpeg)

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 14, 2021, 12:36pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/23 "2021-12-14T12:36:19Z")

</div>

I managed to replace 6900XT today with 3090 … Volume rendering the eye, 3090 appears to be stable at normal quality. Using adaptive quality, 3090 works at about 80-90% when rotating non-stop in 3D view, a little laggy when making sudden rotations. At maximum quality, slicer just closes. In windows.

---

<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:** [December 14, 2021, 1:39pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/24 "2021-12-14T13:39:26Z")

</div>

> [@Hao\_Li](#):
>
> At maximum quality, slicer just closes. In windows

Windows stops applications that use the GPU for too long, exceeding the [TDR delay](https://discourse.slicer.org/t/volume-rendering-causes-application-crash/3783/4). You can increase TDR delay to avoid this, but it would be great if you could test if [setting volume partitions](https://discourse.slicer.org/t/stitching-artifact-with-volume-rendering-large-volumes-feb-17-2021-nightly/16390/16) solves this issue, too.

> [@Hao\_Li](#):
>
> Using adaptive quality, 3090 works at about 80-90% when rotating non-stop in 3D view, a little laggy when making sudden rotations.

At “adaptive” quality setting the renderer measures rendering time and adjusts rendering quality (number of rays, sampling distances, etc.) for the next rendering request to achieve the requested frame rate. This mechanism works very well for CPUs because the computation is very predictable. However, rendering time on GPU can be highly nonlinear and the GPU may perform complex internal optimizations, too, therefore the prediction is often very inaccurate, especially for large volumes. As a result, “adaptive” setting may not work as intended for GPU volume rendering.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 14, 2021, 7:27pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/25 "2021-12-14T19:27:14Z")

</div>

> [@davide445](#):
>
> Will be possible for you to test on this file

> [@chir.set](#):
>
> Volume Rendering with your eyeglobe data using a 6700XT on Linux.

Volume rendering with the eyeglobe dataset works equally well with a 5500XT on Linux, with or without intensity resampling.

It’s worthwhile mentioning that it’s good also on my laptop having an AMD Ryzen 5 2500U with integrated Radeon Vega Mobile Gfx video chip, and only 1 GB _shared_ VRAM, using Linux of course.

It seems that if results are near random with a 6900XT on Windows, it would be the video driver’s performance to be questioned. This is quite surprising because AMD gives optimized drivers for Windows first.

All this to say that the Radeon cards are good, with good drivers.

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [December 14, 2021, 7:53pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/26 "2021-12-14T19:53:04Z")

</div>

> [@chir.set](#):
>
> It seems that if results are near random with a 6900XT on Windows, it would be the video driver’s performance to be questioned. This is quite surprising because AMD gives optimized drivers for Windows first.

@Hao_Li will be possible for you to check on the 6900 XT

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 16, 2021, 8:30am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/27 "2021-12-16T08:30:18Z")

</div>

Hi!  
I tried the [setting volume partitions](https://discourse.slicer.org/t/stitching-artifact-with-volume-rendering-large-volumes-feb-17-2021-nightly/16390/16) method on 3090 opening the eyeglobe data and used 2, 2, 2 and 4, 4, 4. They both negatively affected volume rendering speed. Most obvious was under normal method, it became very laggy. No difference was observed with 222/444 under maximum quality, every rotation movement took about 5-10 seconds, if the movement was too fast, windows will close slicer. I did not dare to test change TDR delay, as I’m not very handy with computers, it felt dangerous…

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 16, 2021, 9:15am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/28 "2021-12-16T09:15:05Z")

</div>

Hi Davide!

I’m happy to test the data for you. Do you have some more files you want tested on 6900XT? I have switched over to work with 3090 now. I’m not very handy with computers so it’s a big project for me to change graphic cards 😅 If you have more files, I can try them at same time.

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 16, 2021, 1:22pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/29 "2021-12-16T13:22:23Z")

</div>

@davide445  
Just freshly tested volume rendering of the eye on 6900XT. Ran smoothly under normal quality. Laggy at adaptive quality. At maximum quality, it is very slow, around 5 seconds for each rotation movement. All similar to 3090. I’ll keep the card today and tomorrow, let me know if you want more data tested.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/9/a9381ca1e91a7def1e31c249315f9affca2a91fb.jpeg)

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [December 16, 2021, 8:38pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/30 "2021-12-16T20:38:15Z")

</div>

@Hao_Li @chir.set there are two final tests to me worth doing

- testing with resolution 2047 and 2049 (so just below and just above 2048)
- test same resolution on Linux and not Windows

I didn’t find scans just above the 2048 limit, will be possibile to upscale this eye, or downscale an higher res one?

The reason for this test is looking good at the [OpenGL Reports DB](https://opengl.gpuinfo.org/listreports?sortby=date_desc) I noticed the same AMD GPU (almost all the one I checked) have GL\_MAX\_3D\_TEXTURE\_SIZE = 2048 under Windows and 8192 under Linux.  
Also all Nvidia GPU has the same parameter as 16384 regardless if Windows or Linux.

I found a few cases where this is not true, but if so seems AMD GPU Windows drivers are reporting the wrong value. I didn’t understand if the GPU hw architecture define this value, so there is maybe another “true” and max possible value, but seems to me worth a test (if possible).

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 16, 2021, 9:31pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/31 "2021-12-16T21:31:40Z")

</div>

@davide445 I’m happy to test on Windows. Just send a file 🤠

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 17, 2021, 7:33am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/32 "2021-12-17T07:33:46Z")

</div>

> [@davide445](#):
>
> - testing with resolution 2047 and 2049 (so just below and just above 2048)
> - test same resolution on Linux and not Windows

I’l be happy to test with my 6700XT on Linux. I don’t have any datasets with such high resolution.

> [@davide445](#):
>
> all Nvidia GPU has the same parameter as 16384 regardless if Windows or Linux.

This [post](https://discourse.slicer.org/t/gpu-based-volume-rendering-fails-if-one-dimension-is-more-than-2000px/6546/8) suggests that not all software report GL\_MAX\_3D\_TEXTURE\_SIZE reliably.

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 17, 2021, 9:45am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/33 "2021-12-17T09:45:13Z")

</div>

@davide445  
I realized I have alot of scans above 2048 and I think I can confirm your concerns.  
I have tested the following scans on windows with 6900XT

2367x1784x942 = 7G No  
1950x1830x1600 = 11G Wrong stitching  
885x1300x1230 = 5G Yes  
2125x2510x938 = 10G No  
1937x1829x951 = 6,5G Wrong stitching  
2836x1948x2664 = 14G No  
1928x1927x937 = 6,8G Wrong stitching  
2098x1919x936 = 7G No  
1268x1454x1064 = 3G yes  
2572x1837x951 = 8G no

After testing, I believe scans with any dimension above 2048 (2098 smallest of my scans) can not be volume rendered disregard total scan file size.

Out of curiousity I tested on 3090 as well the followings.  
2097x 2134x 1850 , 16G  
2292x2207x2238, 46G  
3784x3784x2085, 58G  
They all could be volume rendered properly on 3090 in windows, I didn’t have larger scans to test the limit.

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [December 17, 2021, 9:53am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/34 "2021-12-17T09:53:12Z")

</div>

@Hao_Li thanks a lot. Might I ask if you can share your 2098 file so @chir.set can test it on Linux.  
Also if you will be able to downsample a not rendering image to lower resolution (i.e. using Resample Scalar Volume module) we can cross check.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 17, 2021, 9:54am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/35 "2021-12-17T09:54:56Z")

</div>

> [@davide445](#):
>
> if you can share your 2098 file so @chir.set can test it on Linux.

Yep, I was about to request the 3784x3784x2085, 58G series too. All duly anonymized of course.

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 17, 2021, 10:01am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/36 "2021-12-17T10:01:15Z")

</div>

Hi, I’m sorry I cannot share the scans, they don’t belong to me …

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 17, 2021, 10:16am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/37 "2021-12-17T10:16:22Z")

</div>

I used Resample Scalar Volume, Spacing 0,0,0 and interpolation linear.  
Volume size resulted same from 2572x1837x951 to 2572x1837x951  
And the volume was not able to be rendered, empty square.

---

<div class="post-metadata">

**Author:** ![davide445](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide445/32/13460_2.png) [@davide445](https://discourse.slicer.org/u/davide445)\
**Post date:** [December 17, 2021, 11:37am UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/38 "2021-12-17T11:37:27Z")

</div>

@Hao_Li @chir.set can you try on the ircadb1.12 to use the Crop Volume feature with this parameters and try if the result can be rendered  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/d/5df234939bedce52c8f10c04be7136dc0ad943a0.png)  
The resulting volume need to have more than 2048 slice  
Edit: sorry use 0.24 spacing scale , not 0.26 as in the image

---

<div class="post-metadata">

**Author:** ![Hao\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hao_li/32/3420_2.png) [@Hao\_Li](https://discourse.slicer.org/u/Hao_Li)\
**Post date:** [December 17, 2021, 12:14pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/39 "2021-12-17T12:14:01Z")

</div>

Hi! I got this on 6900XT. Can not volume render.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/0/c094fd382ce2fb4b4dfcf63fd5be4c626bcefd39.png)

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 17, 2021, 2:15pm UTC](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008/40 "2021-12-17T14:15:44Z")

</div>

> [@davide445](#):
>
> use the Crop Volume feature with this parameters and try if the result can be rendered

I don’t fully understand your requirements :

- what is the original volume ?

I tested with the eyeglobe and another 512x512x2147 slices volume with ‘Spacing scale’ \< 0.24, Volume rendering always works on Linux. In both cases, though the ''Crop volume module shows high dimension values, the ‘Volumes’ module always show the source dimensions for the cropped volumes.

 ![crop_0](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/3/b3ed25732a40105cdd16d2fba2e29ba9978ff32a.png)

 ![crop_1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/a/aae447fc54ea59d1266abb1c4b83707e8cb7a553.png)

[Previous page](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008.md?page=1)

[Next page](https://discourse.slicer.org/t/better-gpu-will-benefit-or-not-vr-volume-rendering/21008.md?page=3)
