···11-# Heater ๐ฅ
11+# Heater
2233-A Rust command-line application that churns your CPU and GPU at maximum capacity for testing, benchmarking, or keeping your system warm.
44-55-## Features
66-77-- ๐ฅ Maximizes CPU usage across multiple cores
88-- ๐ฎ Optional GPU heating using compute shaders
99-- ๐ก๏ธ Leaves one core free by default (configurable)
1010-- โฑ๏ธ Run for a specific duration or indefinitely
1111-- ๐ Graceful shutdown with Ctrl+C
1212-- ๐ Real-time thread and GPU iteration status
1313-- ๐ Cross-platform GPU support (Metal, Vulkan, DX12, OpenGL)
33+A Rust command-line application that churns your CPU cores at maximum capacity so your laptop isn't cold
144155## Build
166···22122313## Usage
24142525-### CPU heating only (default)
1515+### Run indefinitely (until Ctrl+C)
2616```bash
2727-# Run indefinitely (until Ctrl+C)
2817cargo run --release
1818+# or
1919+./target/release/heater
2020+```
29213030-# Run for 30 seconds
2222+### Run for a specific duration (in seconds)
2323+```bash
3124cargo run --release -- --duration 30
3232-3333-# Leave 2 cores free
3434-cargo run --release -- --free-cores 2
2525+# or
2626+./target/release/heater --duration 30
3527```
36283737-### GPU heating
2929+### Customize the number of free cores
3830```bash
3939-# Enable GPU heating with the --gpu flag
4040-cargo run --release -- --gpu
3131+# Leave 2 cores free
3232+cargo run --release -- --free-cores 2
41334242-# GPU + CPU for 60 seconds
4343-cargo run --release -- --gpu --duration 60
3434+# Use ALL cores (leave 0 free)
3535+cargo run --release -- --free-cores 0
44364545-# Max heat: all cores + GPU
4646-cargo run --release -- --gpu --free-cores 0
4747-```
4848-4949-### Advanced examples
5050-```bash
5151-# Use ALL cores (leave 0 free) + GPU for 2 minutes
5252-./target/release/heater --gpu --free-cores 0 --duration 120
5353-5454-# CPU only, leaving 3 cores free, run indefinitely
5555-./target/release/heater --free-cores 3
3737+# Run for 60 seconds, leaving 2 cores free
3838+cargo run --release -- --duration 60 --free-cores 2
5639```
57405841## Options
···6043```
6144-d, --duration <DURATION> Duration to run in seconds (omit for indefinite run)
6245-f, --free-cores <FREE_CORES> Number of cores to leave free (default: 1)
6363--g, --gpu Enable GPU heating (requires compatible GPU)
4646+-g, --gpu Enable GPU usage (makes more heat)
6447-h, --help Print help
6548-V, --version Print version
6649```
6767-6868-## How It Works
6969-7070-### CPU Heating
7171-The application:
7272-1. Detects the number of logical CPU cores on your system
7373-2. Spawns threads equal to (total cores - free cores)
7474-3. Each thread performs intensive mathematical operations in a tight loop
7575-4. Continues until the specified duration expires or you press Ctrl+C
7676-7777-### GPU Heating
7878-When `--gpu` is enabled:
7979-1. Initializes GPU using wgpu (supports Metal, Vulkan, DX12, OpenGL)
8080-2. Creates compute shaders that perform intensive trigonometric and exponential operations
8181-3. Dispatches large workgroups (256x256) continuously to maximize GPU utilization
8282-4. Runs in parallel with CPU heating threads
8383-8484-## Use Cases
8585-8686-- CPU/GPU stress testing
8787-- Thermal testing and validation
8888-- Benchmarking cooling solutions
8989-- Testing throttling behavior
9090-- Power consumption testing
9191-- Keeping your laptop warm in winter โ๏ธ
9292-9393-## GPU Compatibility
9494-9595-The GPU heater uses `wgpu` which supports:
9696-- **macOS**: Metal
9797-- **Windows**: DirectX 12, Vulkan
9898-- **Linux**: Vulkan, OpenGL
9999-- **Web**: WebGPU
100100-101101-If GPU initialization fails, the app will fall back to CPU-only heating.
102102-103103-## Safety Notes
104104-105105-โ ๏ธ **Warning**: This application will significantly increase CPU and GPU temperature and power consumption.
106106-107107-- Ensure your system has adequate cooling before running for extended periods
108108-- Monitor temperatures if running for long durations
109109-- Some laptops may throttle or shut down if temperatures get too high
110110-- Use `--free-cores` to leave headroom for system processes