Back: Graphics
I’m inspired by the ability of modern computer graphics cards to run large parallel simulations, so I set myself the goal of simulating 8 billion people using a graphics card in pursuit of creating a global democracy simulation for better understanding distributed democracy.
My first experiment simulating a large number of people is to consider each person to have a position and a velocity. I’ve implemented a basic particle simulation for 128 million particles, each particle using 8 bytes, or 2 RGBA pixels, of video texture memory. Without rendering the simulation to the screen, the GPU runs at a maximum speed of ~18 billion particle simulations per second. The rendering above is only showing 1/1024th of the total number of particles simulated because the screen becomes solid white if all 128 million are rendered.
I have not yet reached my goal of simulating 8 billion particles for a realistic democracy simulation, but I’ve learned a lot about tradeoffs between GPU and CPU memory processing sweet spots.
Population | CPU speed | GPU speed |
8 billion | ||
3 billion | 1.5 billion / second | |
1.5 billion | 1.5 billion / second | 2.2 billion / second |
1 billion | 1.5 billion / second | 2.4 billion / second |
512 million | 1.5 billion / second | 2.9 billion / second |
256 million | 1.5 billion / second | 4.2 billion / second |
128 million | 1.5 billion / second | 15.4 billion / second |
64 million | 1.5 billion / second | 16.8 billion / second |
32 million | 1.5 billion / second | 17.7 billion / second |
16 million | 1.5 billion / second | 18.2 billion / second |
8 million | 1.5 billion / second | 18.2 billion / second |
4 million | 1.7 billion / second | 17.5 billion / second |
2 million | 3.2 billion / second | 16.3 billion / second |
1 million | 5.7 billion / second | 14.0 billion / second |
512 thousand | 5.6 billion / second | 11.4 billion / second |
256 thousand | 2.3 billion / second | 9.0 billion / second |
128 thousand | 2.0 billion / second | 5.4 billion / second |
64 thousand | 1.7 billion / second | 3.0 billion / second |
32 thousand | 0.9 billion / second | 1.5 billion / second |
2022.11.25