Skip to content

Informative error if memory to burn is less than threshold#119

Closed
ashuthak210 wants to merge 4 commits into
wilicc:masterfrom
ashuthak210:master
Closed

Informative error if memory to burn is less than threshold#119
ashuthak210 wants to merge 4 commits into
wilicc:masterfrom
ashuthak210:master

Conversation

@ashuthak210
Copy link
Copy Markdown

[Problem]
If the %age memory to burn is below a threshold then program aborts without any user friendly message.

[Solution]
Added a user friendly message that can save debugging for the user

[Testing]
Testing with following run

ashuthak@ashuthak-ubuntu:~/gpu_burn/gpu-burn$ ./gpu_burn -m 1% 60
Using compare file: compare.ptx
Burning for 60 seconds.
GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU (UUID: GPU-062ffaaa-3ab3-31f9-1938-451fee6a15fb)
Initialized device 0 with 7721 MB of memory (7594 MB available, using 75 MB of it), using FLOATS
Results are 268435456 bytes each, thus performing 68719476734 iterations
Provide bytes (75 MB) are not sufficient. aborting.
terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
1.7%  proc'd: -1 (0 Gflop/s)   errors: 0  (DIED!)  temps: 49 C

If the %age memory to burn is below a threshold then program aborts
without any user friendly message.

[Solution]
Added a user friendly message that can save debugging for the user

[Testing]
Testing with following run
```
ashuthak@ashuthak-ubuntu:~/gpu_burn/gpu-burn$ ./gpu_burn -m 1% 60
Using compare file: compare.ptx
Burning for 60 seconds.
GPU 0: NVIDIA GeForce RTX 4060 Laptop GPU (UUID: GPU-062ffaaa-3ab3-31f9-1938-451fee6a15fb)
Initialized device 0 with 7721 MB of memory (7594 MB available, using 75 MB of it), using FLOATS
Results are 268435456 bytes each, thus performing 68719476734 iterations
Provide bytes (75 MB) are not sufficient. aborting.
terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
1.7%  proc'd: -1 (0 Gflop/s)   errors: 0  (DIED!)  temps: 49 C
```
@wilicc
Copy link
Copy Markdown
Owner

wilicc commented May 31, 2026

Thanks for the PR. The line just above the abort already prints Initialized device N with X MB of memory (Y MB available, using Z MB of it) — which shows the attempted size — so the new printf duplicates info that's already on screen one line up. Also the PR includes a couple of unrelated .scad files. Going to leave this one closed; the existing Low mem for result. aborting. is doing its job for what's a user-input edge case (asking for too little memory to fit the working set). Thanks again.

@wilicc wilicc closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants