gpu-burn

repository·master·Indexed 25 days ago

https://github.com/wilicc/gpu-burn

A GPU stress-testing tool designed to push NVIDIA GPUs to their limits. This repository provides a Windows port that maintains the same stress-test behavior as the Linux version. It supports CUDA-based testing with options for memory usage, double-precision, and Tensor core utilization. The tool can be built from source using make or CMake, or run via Docker.

Tokens
1.2K
Snippets
7
Records
9
Agent score
31%

What's inside gpu-burn

  1. Build gpu-burn on Windows manually with CMake

    master

    If you prefer not to use build.bat, you can invoke CMake directly. The build process involves configuring the project with the desired compute capability and then building the solution.

    cmake -S . -B build -DCOMPUTE=120
    cmake --build build --config Release
  2. Build gpu-burn on Windows using build.bat

    master

    The project provides a build.bat script which acts as a wrapper around CMake. You can specify the target compute capability using the -c flag. By default, it builds for compute_75 (Turing).

    build.bat                  REM defaults to compute_75 (Turing)
    build.bat -c 86            REM Ampere
    build.bat -c 89            REM Ada
    build.bat -c 90            REM Hopper
    build.bat -c 120           REM Blackwell
    build.bat -c 86 -d         REM Debug build
  3. Build gpu-burn from source

    master

    To build the binary from source using make, use the following commands:

    Standard Build

    make

    Clean Build Artifacts

    make clean

    Customizing the Build

    • Compute Capability: Defaults to 7.5. Override using COMPUTE=<value>.
    • Multiple Architectures: To build a fat binary or use specific features (like sm_90a), set COMPUTE= (empty) and provide -gencode flags via NVCCFLAGS.
    • Compiler/Linker Flags: Append CFLAGS, LDFLAGS, or NVCCFLAGS to the make command.
    • Paths: Use CUDAPATH to point to a specific CUDA toolkit installation (defaults to /usr/local/cuda) and CCPATH to specify a specific gcc (defaults to /usr/bin).
    make
    make clean
    make COMPUTE=75
    make COMPUTE= NVCCFLAGS='-gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_90,code=sm_90'
    make CUDAPATH=/usr/local/cuda-<version>
  4. Build a Docker image using make

    master

    You can use the make command to build the Docker image target. This allows you to pass variables like IMAGE_NAME, CUDA_VERSION, and IMAGE_DISTRO directly through the Makefile.

    Example:

    make IMAGE_NAME=myregistry.private.com/gpu-burn CUDA_VERSION=12.0.1 IMAGE_DISTRO=ubuntu22.04 image
    make IMAGE_NAME=myregistry.private.com/gpu-burn CUDA_VERSION=12.0.1 IMAGE_DISTRO=ubuntu22.04 image
  5. Run gpu-burn using Docker

    master

    You can quickly build and run the stress test using Docker. To use the GPU within the container, you must use the --gpus all flag during docker run.

    To build with default settings:

    git clone https://github.com/wilicc/gpu-burn
    cd gpu-burn
    docker build -t gpu-burn .
    docker run --rm --gpus all gpu-burn

    You can customize the build using build arguments for the CUDA version, compute capability, and base image distribution:

    docker build --build-arg CUDA_VERSION=13.0.0 --build-arg COMPUTE=75 --build-arg IMAGE_DISTRO=ubi8 -t gpu-burn .
    docker build -t gpu-burn .
    docker run --rm --gpus all gpu-burn
  6. Requirements for gpu-burn on Windows

    master

    To build or run gpu-burn on Windows, ensure your environment meets the following requirements:

    • OS: Windows 10 or 11
    • CUDA Toolkit: 11.0+ (Note: Use 13.0+ if targeting compute_120 / Blackwell architecture)
    • CMake: 3.18 or newer
    • Compiler: Visual Studio 2019 or 2022 with C++ build tools installed
    • NVIDIA Driver: Must be installed and nvidia-smi must be available in your PATH.
  7. Use gpu_burn.exe for GPU stress testing

    master

    The Windows version uses the same command-line flags as the Linux version. Common usage patterns include specifying duration, VRAM usage, or specific GPU indices.

    gpu_burn.exe -d 3600       REM burn all GPUs with doubles for an hour
    gpu_burn.exe -m 50% 60     REM 50% of available VRAM, 1 minute
    gpu_burn.exe -i 0 60       REM only GPU 0
    gpu_burn.exe -l            REM list GPUs and exit
  8. Use the gpu_burn CLI

    master

    The gpu_burn utility is used to stress test CUDA GPUs. The basic syntax is: gpu_burn [OPTIONS] [TIME]

    Options:

    • -m X: Use X MB of memory.
    • -m N%: Use N% of the available GPU memory.
    • -d: Use doubles.
    • -tc: Try to use Tensor cores (if available).
    • -l: List all GPUs in the system.
    • -i N: Execute only on GPU N.
    • -h: Show this help message.

    Example: Run a double-precision stress test for 3600 seconds

    gpu_burn -d 3600
    gpu_burn -d 3600