+18
-79
README.md
+18
-79
README.md
···
1
-
# Heater ๐ฅ
1
+
# Heater
2
2
3
-
A Rust command-line application that churns your CPU and GPU at maximum capacity for testing, benchmarking, or keeping your system warm.
4
-
5
-
## Features
6
-
7
-
- ๐ฅ Maximizes CPU usage across multiple cores
8
-
- ๐ฎ Optional GPU heating using compute shaders
9
-
- ๐ก๏ธ Leaves one core free by default (configurable)
10
-
- โฑ๏ธ Run for a specific duration or indefinitely
11
-
- ๐ Graceful shutdown with Ctrl+C
12
-
- ๐ Real-time thread and GPU iteration status
13
-
- ๐ Cross-platform GPU support (Metal, Vulkan, DX12, OpenGL)
3
+
A Rust command-line application that churns your CPU cores at maximum capacity so your laptop isn't cold
14
4
15
5
## Build
16
6
···
22
12
23
13
## Usage
24
14
25
-
### CPU heating only (default)
15
+
### Run indefinitely (until Ctrl+C)
26
16
```bash
27
-
# Run indefinitely (until Ctrl+C)
28
17
cargo run --release
18
+
# or
19
+
./target/release/heater
20
+
```
29
21
30
-
# Run for 30 seconds
22
+
### Run for a specific duration (in seconds)
23
+
```bash
31
24
cargo run --release -- --duration 30
32
-
33
-
# Leave 2 cores free
34
-
cargo run --release -- --free-cores 2
25
+
# or
26
+
./target/release/heater --duration 30
35
27
```
36
28
37
-
### GPU heating
29
+
### Customize the number of free cores
38
30
```bash
39
-
# Enable GPU heating with the --gpu flag
40
-
cargo run --release -- --gpu
31
+
# Leave 2 cores free
32
+
cargo run --release -- --free-cores 2
41
33
42
-
# GPU + CPU for 60 seconds
43
-
cargo run --release -- --gpu --duration 60
34
+
# Use ALL cores (leave 0 free)
35
+
cargo run --release -- --free-cores 0
44
36
45
-
# Max heat: all cores + GPU
46
-
cargo run --release -- --gpu --free-cores 0
47
-
```
48
-
49
-
### Advanced examples
50
-
```bash
51
-
# Use ALL cores (leave 0 free) + GPU for 2 minutes
52
-
./target/release/heater --gpu --free-cores 0 --duration 120
53
-
54
-
# CPU only, leaving 3 cores free, run indefinitely
55
-
./target/release/heater --free-cores 3
37
+
# Run for 60 seconds, leaving 2 cores free
38
+
cargo run --release -- --duration 60 --free-cores 2
56
39
```
57
40
58
41
## Options
···
60
43
```
61
44
-d, --duration <DURATION> Duration to run in seconds (omit for indefinite run)
62
45
-f, --free-cores <FREE_CORES> Number of cores to leave free (default: 1)
63
-
-g, --gpu Enable GPU heating (requires compatible GPU)
46
+
-g, --gpu Enable GPU usage (makes more heat)
64
47
-h, --help Print help
65
48
-V, --version Print version
66
49
```
67
-
68
-
## How It Works
69
-
70
-
### CPU Heating
71
-
The application:
72
-
1. Detects the number of logical CPU cores on your system
73
-
2. Spawns threads equal to (total cores - free cores)
74
-
3. Each thread performs intensive mathematical operations in a tight loop
75
-
4. Continues until the specified duration expires or you press Ctrl+C
76
-
77
-
### GPU Heating
78
-
When `--gpu` is enabled:
79
-
1. Initializes GPU using wgpu (supports Metal, Vulkan, DX12, OpenGL)
80
-
2. Creates compute shaders that perform intensive trigonometric and exponential operations
81
-
3. Dispatches large workgroups (256x256) continuously to maximize GPU utilization
82
-
4. Runs in parallel with CPU heating threads
83
-
84
-
## Use Cases
85
-
86
-
- CPU/GPU stress testing
87
-
- Thermal testing and validation
88
-
- Benchmarking cooling solutions
89
-
- Testing throttling behavior
90
-
- Power consumption testing
91
-
- Keeping your laptop warm in winter โ๏ธ
92
-
93
-
## GPU Compatibility
94
-
95
-
The GPU heater uses `wgpu` which supports:
96
-
- **macOS**: Metal
97
-
- **Windows**: DirectX 12, Vulkan
98
-
- **Linux**: Vulkan, OpenGL
99
-
- **Web**: WebGPU
100
-
101
-
If GPU initialization fails, the app will fall back to CPU-only heating.
102
-
103
-
## Safety Notes
104
-
105
-
โ ๏ธ **Warning**: This application will significantly increase CPU and GPU temperature and power consumption.
106
-
107
-
- Ensure your system has adequate cooling before running for extended periods
108
-
- Monitor temperatures if running for long durations
109
-
- Some laptops may throttle or shut down if temperatures get too high
110
-
- Use `--free-cores` to leave headroom for system processes