Hardware Detection and Validation

Stefano Cacciatore

2026-09-15

gpuinfo detects CPU and GPU hardware and reports whether local compute backends appear usable. Detection is framework-independent: a positive result does not imply that torch, TensorFlow, or another package was compiled with that backend.

Quick check on the current computer

library(gpuinfo)

has_gpu()
has_cuda()
has_metal()
has_rocm()
has_opencl()

hardware_info()
gpu_sitrep()

All probes are defensive. Missing hardware, commands, drivers, or libraries produce FALSE, empty results, or NA fields instead of an installation or runtime error. Detailed backend information distinguishes available, unavailable, and unknown; convenience predicates only return TRUE for a confirmed usable backend.

Evidence shipped with this release

Real-device results are stored with the package and returned inside hardware_info(). The table is intentionally narrower than the implemented probe set.

library(gpuinfo)
hardware_info()$validation
#>   package_version       date                                      os
#> 1           0.1.0 2026-09-05                              macOS 14.5
#> 2           0.1.0 2026-09-05                              macOS 14.5
#> 3           0.1.0 2026-09-05 Linux 6.12.100 / Ubuntu 22.04 container
#> 4           0.1.0 2026-09-05 Linux 6.12.100 / Ubuntu 22.04 container
#> 5           0.1.0 2026-09-05                            Ubuntu 24.04
#>   architecture                   hardware backend result
#> 1        arm64                   Apple M3   metal   pass
#> 2        arm64                   Apple M3     cpu   pass
#> 3       x86_64            NVIDIA Tesla T4    cuda   pass
#> 4       x86_64            NVIDIA Tesla T4  opencl   pass
#> 5        arm64 GitHub-hosted ARM64 runner     cpu   pass
#>                                                                          scope
#> 1                                                  native probe and public API
#> 2                                            cpu model core count and fallback
#> 3 native driver device memory capability runtime toolkit and backend selection
#> 4      native OpenCL enumeration and CUDA OpenCL physical device deduplication
#> 5                          source install native compilation and package tests

For version 0.1.0, real GPU validation covers:

Linux ARM64 validates the CPU path and native package compilation. Hosted Linux, Windows, Intel macOS, and Apple Silicon macOS jobs exercise package installation, tests, and no-GPU behavior. A hosted Windows CPU runner is not evidence of Windows NVIDIA support.

AMD ROCm, Intel GPU OpenCL, and Windows NVIDIA CUDA/OpenCL remain unvalidated for version 0.1.0. Their probes are available for early testing but are not represented as validated hardware support.

Reproducing a real-hardware run

Use a clean public commit so the tested source is recoverable. Replace BACKEND with cuda, metal, rocm, or opencl.

git clone https://github.com/tkcaccia/gpuinfo.git
cd gpuinfo
git rev-parse HEAD
R CMD INSTALL .
Rscript tools/validate-hardware.R BACKEND | tee validation-output.txt

A successful run ends with VALIDATION PASSED. Preserve the full output and record the package commit, operating system, architecture, GPU model, driver, runtime, memory, provider, and job identifier. Cloud instances must be terminated after collecting the evidence; merely disconnecting from or stopping a billable GPU machine may leave charges running.

What counts as validation

The project uses three distinct levels of testing:

  1. Parser fixtures verify that representative command output is interpreted correctly. They do not prove hardware support.
  2. CPU-only continuous integration verifies portability, installation, and safe behavior when accelerators are absent. It does not validate a GPU.
  3. A real-hardware run must enumerate the device and expected backend and must complete tools/validate-hardware.R successfully. Only these runs are added to the validation evidence returned by hardware_info().

This separation keeps release claims auditable and allows later package versions to promote AMD, Intel, or Windows GPU support only after the relevant hardware run passes.