Which current algorithms of Slicer could be improved by GPU use?

Faster 3D view rendering?
Faster segment editor effects?
Other things?

Please mention which changes would be more impactful in terms of community reach and performance
Would this changes need VTK changes first and which changes would not?

For me definitely, better performance in large polydata models. In my subjective experience, with a powerful GPU volume rendering works well, but polydata rendering doesn’t seem to scale up that well.

According to this blog it may be possible to speed up PolyData rendering for 100M plus triangle scenes using VTK’s WebGPU implementation

AFAIK, only ‘Volume rendering’ invokes GPU computation in Slicer, so if polydata or segmentation objects could benefit from GPU, +1.

There have been much talks about AVX-512 recently on phoronix in other domains than visualisation, seeming to confirm speed gains. It’s a CPU extension, not GPU computation. I don’t know if Slicer already makes use of this, but it could be a speed improvement pathway to consider.

I don’t think that’s simple drag and drop replacement, and will probably require extensive reengineering both on VTK and Slicer side. We had a grant proposal to do that, but unfortunately it wasn’t reviewed favorably.

1 Like

We could enable usage of latest instruction sets when building Slicer, but then we would lose compatibility with older, less capable hardware. It would be nice if someone tested Slicer built for latest CPUs and see if the performance gain is significant. My limited experience is the improvements are up to maybe 10-20% in the best case, so it is not really worth the trouble.

Polydata rendering is fully GPU accelerated. VTK uses OpenGL API to upload the polydata to the GPU and the driver renders it utilizing both CPU and GPU. You should see an enormous difference between rendering speed of large models on discrete NVIDIA GPU vs. some integrated graphics hardware. If that is not the case then there may be a bug that we should fix.

OpenGL API inefficiencies and complexities might also add some overhead, which might be improved in the WebGPU backend.

Why are you asking? What do you have in mind?

I just was wondering if there was some low-hanging fruits for improving something using WebGPU inside Slicer

I am not sure avx-512 specifically available outside of Intel CPUs. For example this is a 3rd generation EPYC server, which has been recently purchased at our institute, and it doesn’t list avx-512 extension.

For CPU only systems, I read openSWR is pretty complaint but wasn’t able to test: https://www.openswr.org/

processor       : 127
vendor_id       : AuthenticAMD
cpu family      : 25
model           : 1
model name      : AMD EPYC 7763 64-Core Processor
stepping        : 1
microcode       : 0xa0011d3
cpu MHz         : 2445.497
cache size      : 512 KB
physical id     : 1
siblings        : 64
core id         : 63
cpu cores       : 64
apicid          : 127
initial apicid  : 127
fpu             : yes
fpu_exception   : yes
cpuid level     : 16
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca
bugs            : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 4866.04
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]

avx-512 is available on recent AMD CPUs. You comment prompted me to check the previously available AMD CPUs in office, released 3 to 4 years ago: they list only avx and avx2. So it’s probably not worth investing in this direction for Slicer, not now, the more so that the benefit may be doubtful.

1 Like