Playing around with CUDA and making some interesting simulations.
Here I make a galaxy from a box of 10,000 particles.
- GLFW 3.3.2
- Environment variable:
GLFW_x64
is the root directory of includes and libraries. i.e.,$(GLFW_x64)/lib
should resolve to the library and$(GLFW_x64)/include
for the headers.
- Environment variable:
- GLEW
- Environment variable:
GLEW_PATH
is the root directory of includes and libraries. i.e.,$(GLEW_PATH)/lib/Release/x64
and$(GLEW_PATH)/include
blah blah.
- Environment variable:
- Visual Studio 2015/17/18
- CUDA 10.2
- Install Visual Studio and CUDA.
- Download GLFW and GLEW
- Clone.
- Open PSim.sln and build either Debug or Release
The GUI was developed using the OpenGL3 + GLFW implementation for ImGui.
- Fully parameterizing initial conditions for gravity simulation.
- Vastly increase number of particles (done via implementing fast multipole method).
- From preliminary calculations, it seems that the current implementation is memory bandwidth limited. By implementing FMM, it should be feasible to convert the O(N^2) runtime to O(N) and hence increase the number of particles that can be reasonably simulated substantially. Preliminary calculations expect a >100x increase in the number of simulatable particles, while maintaining 60 FPS.
- Possibly interacting particles (merging, annihilation, collision, etc.).
- Simulations other than just gravity.
- Rewriting kernels to use C++.
- Fixing memory issues.
- Refactoring functions out of kernel.cu and moving them to Model.cpp.
- Abstract Model to use inheritance to allow multiple different simulations.
- Properly fix memory errors.