Enabling volume rendering for a large volume makes the application crash

Operating system: windows
Slicer version:4.11.20200930
Expected behavior: volume rendering
Actual behavior: volume rendering freezes

I have datasets that are small (in dimensions) and whenever I ask slicer to do volume rendering, it produces a tiny volume in the middle of the 3d field. When I zoom in on the volume to move it, the program freezes.

1 Like

Can you take a screenshot of the Volume information section of Volumes module (to see dimensions, spacing, and scalar type of your volume)?

screenshot

Thank you. The volume rendering looks good. The image spacing is a bit too small (2 magnitudes smaller than usual), but should not cause application hang.

Do you use CPU or GPU volume rendering?
Does the hang occur when you zoom in? Does the application crash after the hang?
What graphics card do you have?

Please try if rendering the volume in multiple partitions (to ease the load on the GPU) solves the issue, by copy-pasting these lines to the Python console:

threeDViewWidget = slicer.app.layoutManager().threeDWidget(0)
vrDisplayableManager = threeDViewWidget.threeDView().displayableManagerByClassName('vtkMRMLVolumeRenderingDisplayableManager')
vrMapper = vrDisplayableManager.GetVolumeMapper(getNode('skull'))
vrMapper.SetPartitions(1,1,2)

Thank you lasson, for all your help.
I use the gpu volume rendering. the hand occur right after i zoom in. yes it crashes after the hang
my graphics card is amd radeon™ vega 3 400mhz, vram of 1009 mb and total memory of 3542 mb
I tried inserting the code you sent, but i got an error message and the problem did not go away.screenshot

Try what @lassoan suggested with the latest stable it might work better. Also you have a very low end gpu. Even when works, performance is unlikely to be good.

This indicates that you get a TDR error: the operating system shuts down applications that keep the graphics card busy for too long. This happens because the size of the volume is too large for your GPU to comfortably handle. There are several ways to work around this:

  • Option A: Run the code snippet above to split the volume to smaller chunks (that way you have a better chance that the graphics card will not be unresponsive for too long) or increase TDR delay in the registry.
  • Option B: Crop and downsample your volume using Crop volume and volume render this smaller volume.
  • Option C: Increase TDR delay value in registry (see details here)
  • Option D: Use CPU volume rendering.
  • Option E: Upgrade your computer with a stronger graphics card.

You need to run the code after you enabled volume rendering.