Skip to content

FluidX3D v3.9 (faster CPU FP16S)

Latest

Choose a tag to compare

@ProjectPhysX ProjectPhysX released this 15 Nov 11:13

This update brings up to 4x speedup for running FluidX3D on CPUs. Looking at the x86 assembly, I stumbled upon two major performance issues on CPU: vload_half()/vstore_half_rte() OpenCL functions were not vectorized by Intel CPU Runtime for OpenCL - an oversight in the compiler - however plain (half)<->(float) datatype casting gets the load/store vectorized to vcvtph2ps/vcvtps2ph, and that brings massive performance speedup. The second issue was that the guard clause early in the stream_collide() kernel causes thread divergence, which again breaks vectorization. Turning the guard clause into a mask for the remaining kernel resolved that and brings some speedup for all FP32/FP16S/FP16C storage types.

This update also contains an important fix for Nvidia GPUs: Nvidia quietly enshittified their drivers starting at version 610, by making OpenCL single buffer allocations >1/4 of VRAM capacity fail. This meant FluidX3D could only use a fraction of the GPU's VRAM. A hidden, undocumented environment variable NVCL_DISABLE_MAX_MEM_ALLOC_SIZE_CHECK=1 is now applied as a workaround.


Improvements

  • enabled vectorized FP16S load/store and branchless guard clause on CPUs, FP16S on CPUs is now up to 4x faster, FP16C up to 1.5x faster, FP32 up to 1.2x faster
  • moved index tables from scratchpad to constant memory space and other minor micro-optimizations
  • added dumping for AMD ISA, Intel vISA and CPU x86 assembly, along Nvidia PTX
  • display max workgroup size in device infos
  • updated driver install instructions

Bug fixes

  • fixed maximum buffer allocation size limit for Nvidia GPUs with driver 610 or newer
  • fixed temperature advection artifacting at beta=0 with volume force
  • fixed streamline rendering in 3D with Nz=1
  • fixed integer overflow in graphics_q()
  • fixed wrong OpenCL barriers
  • hardened read_bmp() and read_stl_raw() against corrupt files

Have fun with the software!
-- Moritz