I have the latest Apple MacBook with Apple silicon, 96GB of RAM running Ventura. I am using the most recent build of Slicer for Mac from 2023-4-25. My fairly large data sets are rendering well, though slowly, using the CPU, but when I swap to GPU the volume is a uniform prism of color. Here is an example data set of a clingfish.
I expect the answer is that Apple silicon is just not working well with Slicer, but if someone has a workaround it would be great.
Thanks for sharing the data. I could use GPU rendering on a mac pro, but on a mac book air m2 I got this error:
[VTK] Invalid texture dimensions [447, 318, 2308]
[FD] UNSUPPORTED (log once): POSSIBLE ISSUE: unit 1 GLD_TEXTURE_INDEX_3D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
so it must be a hardware or driver limit, probably to 2048 max dimension
I used CropVolume with a 1.5x multiplier on the spacing and then GPU rendering worked on the m2 machine:
This is an unfortunate limitation, particularly if this is true for the top of the line M2 macbook pro @Fishguy has. I donāt have this problem on my 2018 intel macbook pro.
Do you know if there is a way to report this to apple? I am concerned because a lot of biology folks use Slicer on Mac, and thatās a limitation we canāt do much.
Just to follow up. Steve has found the issue. More than 2048 slices and the GPU wonāt work. I have tested this with 5 data sets that were not working, and by cutting down the number of slices they work just fine. The InputStack module in SlicerMorph (which I think Steve wrote) has a āSkip Slicesā option that allows you to tune the total slices in the Z direction. That is a work around until Apple gets itself in order on this.
From what I can tell this is a hardware limit on Apple GPUs. This document says that all the apple GPUs, including the āMetal 3ā in the M2 have a max size of 2048 in all dimensions. Itās hard to know if they will relax this in the future. For. now Iām afraid downsampling is the best option.
@Adam_Summers if skipping slices give you okay image quality then thatās a good workaround. Using CropVolume to downsample a larger volume will be less lossy, but more time consuming of course.
As a follow-up, this is being addressed by @lassoan through PR-8430:
On macOS graphics hardware, maximum 3D texture size (along any axis) is typically 2048. This commit sets volume partitioning partitioned to not exceed this size by default.
On other systems volume is maximum size is set to 4096 by default, which will not split up the volume in most cases (which was the behavior before this commit).