ROCsim is an open-source, GPU-accelerated physics simulation engine optimized for AMD Radeon GPUs using ROCm/HIP, with full support for NVIDIA GPUs. Built with Qt and OpenGL, ROCsim provides real-time visualization of complex physics simulations including gravitational systems, collision dynamics, and spring networks.
- Deliverable 2 Demo Video on Google Drive
- Deliverable 3 Demo Video on Google Drive
- Multiple Physics Models
- Gravitational N-Body simulation with orbital mechanics
- Particle collision system with elastic/inelastic collisions
- Spring-mass network with Hooke's Law
- GPU-Accelerated Computing
- HIP/ROCm optimized kernels for AMD GPUs
- Full CUDA compatibility for NVIDIA GPUs
- Direct GPU-to-GPU data sharing (zero-copy pipeline)
- Advanced Numerical Integration
- Verlet integration for energy conservation
- Runge-Kutta 4th order for high precision
- Adaptive time stepping for stability
- Interactive 3D Visualization
- Real-time OpenGL rendering
- Smooth particle systems with 100-5000+ particles
- Color-coded particles based on velocity/energy
- Real-Time Controls
- Play/Pause/Reset simulation
- Dynamic parameter adjustment (gravity, damping, particle count)
- Runtime physics model switching
- Performance Monitoring
- Live FPS counter
- GPU compute time tracking
- Memory usage statistics
- OpenGL-HIP Interoperability: Direct buffer sharing between compute and graphics
- Cross-Platform: Linux (Ubuntu 22.04+) and Windows 10/11 (WSL2)
- Modern C++17: Clean architecture with design patterns
- Extensible Design: Plugin-ready for custom physics models
ROCsim/
βββ code/ # Header and C++ source files
β βββ mainwindow.h
β βββ openglwidget.h
β βββ particlekernel.h
β βββ CMakeLists.txt
β βββ ...
βββ docs/ # Project report, UML diagrams and any design files
β βββ Deliverable 1/
β βββ Deliverable 2/
β βββ Deliverable 3/
βββ tests/ # GoogleTest unit tests
βββ README.md
# Debug build with verbose output
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON
make -j$(nproc)
# Run tests
ctest --output-on-failure- Strategy Pattern: Interchangeable physics models
- Factory Pattern: Physics model instantiation
- Singleton Pattern: GPU memory manager
- Observer Pattern: Performance monitoring
ROCsim addresses the lack of open-source physics simulators optimized for AMD GPUs. While many tools use NVIDIA's CUDA, ROCsim provides:
- AMD-First Development: Optimized for ROCm and Radeon GPUs
- Cross-Vendor Compatibility: Works on both AMD and NVIDIA hardware
- Educational Focus: Visualize physics concepts for students and researchers
- Performance: Real-time simulation of thousands of particles at 60 FPS
- GPU: AMD Radeon (RDNA2+) or NVIDIA (Compute 6.0+) with HIP support
- RAM: Minimum 8GB system memory
- Display: OpenGL 3.3+ compatible graphics
- OS: Ubuntu 22.04+ or Windows 10/11 (with WSL2)
- ROCm: Version 6.4.2 or newer
- Qt: Version 6.5 or newer
- CMake: Version 3.16 or newer
- Compiler: GCC 11+ or Clang 14+ with C++17 support
# Ubuntu 22.04/24.04
wget https://repo.radeon.com/amdgpu-install/latest/ubuntu/jammy/amdgpu-install_latest_all.deb
sudo apt install ./amdgpu-install_latest_all.deb
sudo amdgpu-install -y --usecase=rocm
# Verify installation
rocminfosudo apt update
sudo apt install -y qt6-base-dev qt6-opengl-dev
sudo apt install -y libglfw3-dev libglew-dev cmake build-essentialgit clone https://github.com/yourusername/ROCsim.git
cd ROCsim
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)./rocm_qt_opengl_physics_demo- Mouse Left Click + Drag: Rotate 3D camera
- Mouse Scroll: Zoom in/out
- Spacebar: Pause/Resume simulation
- R: Reset simulation
- 1/2/3: Switch physics models (Gravity/Collision/Springs)
- +/-: Increase/decrease particle count
- ESC: Exit application
- Simulation Type Dropdown: Select physics model
- Parameter Sliders:
- Gravity strength (0.0 - 2.0)
- Damping factor (0.5 - 1.0)
- Particle count (100 - 5000)
- Performance Monitor: Real-time FPS and GPU metrics
// Export simulation state
File β Export β Simulation Data (CSV)
// Save configuration
File β Save Configuration β config.jsonROCsim follows a layered architecture with clear separation of concerns:
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Qt GUI β
β MainWindow | ControlPanel | PerformanceMonitor β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββ
β Business Logic Layer β
β SimulationManager | PhysicsEngine | RenderEngine β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββ
β Compute Layer β
β HIPKernelManager | GPUMemoryManager β
β IntegratorConstraintSolver | PhysicsModels β
βββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββ
β Data Layer β
β Particle | PhysicsParameters β
β ConfigurationManager | PerformanceMetrics β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
Physics Engine (Team 1)
PhysicsEngine: Core physics computation coordinatorHIPKernelManager: GPU kernel executionIntegratorConstraintSolver: ODE solving with constraintsPhysicsModel(Strategy Pattern): Gravitational, Collision, Spring models
Rendering Engine (Team 2)
RenderEngine: OpenGL visualization pipelineMainWindow: Qt application frameworkControlPanel: User interaction controlsPerformanceMonitor: Real-time metrics display
| Configuration | Particle Count | FPS (AMD RX 6800) | FPS (NVIDIA RTX 3070) |
|---|---|---|---|
| Gravity | 500 | 60 | 60 |
| Gravity | 1000 | 58 | 60 |
| Collision | 500 | 55 | 58 |
| Springs | 1000 | 52 | 55 |
Benchmarks on Ubuntu 22.04, ROCm 6.4, Qt 6.5
We welcome contributions! Please see our Contributing Guide for details.
- Team 1 (Physics & GPU Compute): Jiwon Lee, Jacob Lee
- Team 2 (Visualization & UI): Eric Jean, Maharshii Patel
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- β Basic physics engine with gravitational model
- β Qt GUI with OpenGL rendering
- β HIP-OpenGL interoperability
- β³ Single physics model working
- β³ All three physics models (Gravity, Collision, Springs)
- β³ Advanced numerical integration (Verlet, RK4)
- β³ Performance optimization
- β³ Complete testing suite
- β³ Final documentation and video demo
This project is licensed under the MIT License - see the LICENSE file for details.
- AMD ROCm Team: For excellent GPU computing platform
- Qt Project: For robust cross-platform GUI framework
- Western University CS3307: Course project for Object-Oriented Design
- NVIDIA CUDA Samples: Reference implementations for GPU interoperability
- OpenGL Community: Tutorials and documentation
Project Link: https://github.com/yourusername/ROCsim
Team 1 (Physics/GPU):
- Jiwon Lee - jlee3859@uwo.ca
- Jacob Lee - jlee3887@uwo.ca
Team 2 (Graphics/UI):
- Eric Jean - ejean2@uwo.ca
- Maharshii Patel - mpate588@uwo.ca
Made with β€οΈ by the ROCkers | Fall 2025
