Heater 🔥#
A Rust command-line application that churns your CPU and GPU at maximum capacity for testing, benchmarking, or keeping your system warm.
Features#
- 🔥 Maximizes CPU usage across multiple cores
- 🎮 Optional GPU heating using compute shaders
- 🛡️ Leaves one core free by default (configurable)
- ⏱️ Run for a specific duration or indefinitely
- 🛑 Graceful shutdown with Ctrl+C
- 📊 Real-time thread and GPU iteration status
- 🌐 Cross-platform GPU support (Metal, Vulkan, DX12, OpenGL)
Build#
cargo build --release
The compiled binary will be at target/release/heater.
Usage#
CPU heating only (default)#
# Run indefinitely (until Ctrl+C)
cargo run --release
# Run for 30 seconds
cargo run --release -- --duration 30
# Leave 2 cores free
cargo run --release -- --free-cores 2
GPU heating#
# Enable GPU heating with the --gpu flag
cargo run --release -- --gpu
# GPU + CPU for 60 seconds
cargo run --release -- --gpu --duration 60
# Max heat: all cores + GPU
cargo run --release -- --gpu --free-cores 0
Advanced examples#
# Use ALL cores (leave 0 free) + GPU for 2 minutes
./target/release/heater --gpu --free-cores 0 --duration 120
# CPU only, leaving 3 cores free, run indefinitely
./target/release/heater --free-cores 3
Options#
-d, --duration <DURATION> Duration to run in seconds (omit for indefinite run)
-f, --free-cores <FREE_CORES> Number of cores to leave free (default: 1)
-g, --gpu Enable GPU heating (requires compatible GPU)
-h, --help Print help
-V, --version Print version
How It Works#
CPU Heating#
The application:
- Detects the number of logical CPU cores on your system
- Spawns threads equal to (total cores - free cores)
- Each thread performs intensive mathematical operations in a tight loop
- Continues until the specified duration expires or you press Ctrl+C
GPU Heating#
When --gpu is enabled:
- Initializes GPU using wgpu (supports Metal, Vulkan, DX12, OpenGL)
- Creates compute shaders that perform intensive trigonometric and exponential operations
- Dispatches large workgroups (256x256) continuously to maximize GPU utilization
- Runs in parallel with CPU heating threads
Use Cases#
- CPU/GPU stress testing
- Thermal testing and validation
- Benchmarking cooling solutions
- Testing throttling behavior
- Power consumption testing
- Keeping your laptop warm in winter ❄️
GPU Compatibility#
The GPU heater uses wgpu which supports:
- macOS: Metal
- Windows: DirectX 12, Vulkan
- Linux: Vulkan, OpenGL
- Web: WebGPU
If GPU initialization fails, the app will fall back to CPU-only heating.
Safety Notes#
⚠️ Warning: This application will significantly increase CPU and GPU temperature and power consumption.
- Ensure your system has adequate cooling before running for extended periods
- Monitor temperatures if running for long durations
- Some laptops may throttle or shut down if temperatures get too high
- Use
--free-coresto leave headroom for system processes