Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

fluids3

> 编程语言
Open source

fluids v.3

185 stars0 likes1 views
WebsiteGitHub

About

fluids v.3

Fluids:

A fast, GPU-based, smooth particle hydrodynamics (SPH) fluid simulator. Rama Hoetzlein (c) 2007-2025

Project Website: https://ramakarl.com/fluids3

Fluids v.3 was the first very fast, interactive >1 million particle, Smooth Particle Hydrodynamic simulator.

This repository contains the complete history of Fluids.

NEW (2025): The latest Fluids 5.0 has been published in Nov 2025!

The current version is even faster, uses the CUDA Driver API, can handle >4 million particles, uses full smart CPU/GPU pointers, buffer-based structure of arrays, integrated CPU/GPU switching, with cleaner, simplified code.

Latest Performance

Date: 11/23/2025

Hardware: GeForce RTX 4090

# Particles: 4,000,000

  • Fluids ver 3.2 ➔ 32 fps
  • Fluids ver 3.9 ➔ 71 fps
  • Fluids ver 4.0 ➔ 98 fps
  • Fluids ver 5.0 ➔ 160 fps

(same hardware & num particles for all versions)

How to Build

I recommend you build the latest Fluids v5.0.

Run CMake on the Fluids v5.0 folder.

The CUDA Toolchain must be setup correctly for your Graphics Cards model, CUDA Toolkit version and NVIDIA Driver.

Set the CUDA_ARCH_BIN and CUDA_ARCH_PTX cmake variables to match your hardware.

For example: GeForce RTX 5060, CUDA 13.0, NV Driver 581.80 => CUDA_ARCH_BIN=compute_120, CUDA_ARCH_PTX=sm_120

Use ChatGPT to help install the proper toolchain for your specific hardware, or if you don't know what I'm talking about.

History

Fluids 5.0

  • Modernized, 2023
  • Cuda Driver API (cuLaunchKernel), no longer requires CUDA Run-time linkage
  • Large-scale prefixSums, custom code, >4 million particles
  • Full Smart Pointers, CPU & GPU (DataPtr)
  • Buffer-based kernels
  • Abstract Buffer management (DataX)
  • Removed run modes
  • Integrated CPU & GPU switching per func (instead of ver 4.0 Run modes)
  • Modern folder struct (src, assets)
  • Major code cleanup and reduction

Fluids 4.0

  • Rewrite, 2022
  • Fluid struct removed
  • Fluid as buffers (SofA, see fluid.h)
  • Buffer-based kernels
  • Allows for arbitrary per-particle properties
  • New kernels: sampleParticles, computeQuery
  • Write to disk (SavePoints)
  • Equivalent CPU & GPU code
  • Run modes: SEARCH, CPU_SLOW, CPU_GRID, VALIDATE, GPU_FULL, PLAYBACK

Fluids 3.9

  • Major update, 2021
  • Switched to Cuda Driver API (cuLaunchKernel), no need to link to Cuda Run-time
  • Large-scale prefix sums, custom code, >4 million particles
  • Allocation helper, cpu & gpu (AllocateBuffer)
  • Source at top level

Fluids 3.2

  • Minor update, 2013
  • Application code (abstracted main)
  • GUI added
  • Still using Cuda Run-time API (cudaLaunchKernel)
  • Identical kernels to 3.0

Fluids 3.0

  • Major update, 2012
  • New Insertion-sort based
  • Entirely on GPU
  • Explicit memory allocs
  • Cuda Run-time API (cudaLaunchKernel)
  • Static/mixed host code (fluid_system_host.cu)
  • 3rd party Prefix scan
  • Fluid as struct (AofS)
  • Kernels: insertParticles, countingSort, computePressure, computeForce, advanceParticles
  • Introduced insertion-sort and prefix scan, as faster alternatives to radix-sort for particle search
  • GTC 2014 Talk: 2014, Hoetzlein. Fast Fixed-Radius Nearest Neighbors: Interactive Million-Particle Fluids. GPU Technology Conference. Santa Clara, CA. 2014.

Fluids 2

  • First GPU version, 2011
  • Radix-sort based (Simon Green, 2010)
  • CPU-GPU transfers per frame (pipeline bottleneck)

Fluids 1

  • First CPU version, 2007
  • Smoothed Particle Hydrodynamics (SPH)
  • Proof of concept
  • Self learning

Keyboard commands (Fluids 3.0):

H		Turn scene info on/off
N, M		Change number of particles
[, ]		Change example scene (loaded from scene.xml)
F, G		Change algorithm (CPU, GPU, etc.)
J		Change rendering mode (points, sprites, spheres)
C		Adjust camera (using mouse)
L		Adjust light (using mouse)
A,S,W,D	Move camera target
1		Draw acceleration grid
2		Draw particle IDs (be sure # < 4096 first)
~		Start video capture to disk (tilde key)
-, +		Change grid density

Scene parameters (Fluids 3.0)

  • Example scenes are loaded from the scene.xml file

All parameters are permitted in either Fluid or Scene sections.

…

Contact

Feel free to contact me if you have any questions, comments or suggestions:

Rama Hoetzlein

Website: ramakarl.com

Email: [email protected]

License & Copyright

MIT License

FLUIDS - SPH Fluid Simulator for CPU and GPU

Copyright (c) 2007-2023. Rama Hoetzlein

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言