gpuInfo — Return a formatted status string that describes the active GPU provider.
gpuInfo() returns a concise, human-readable string that summarises the active GPU acceleration provider. It is a convenience wrapper around gpuDevice, intended for logging or displaying status information in the REPL and notebooks.
How gpuInfo works
- Queries the same device metadata as
gpuDevice()and formats the fields intoGPU[key=value, ...]. - Includes identifiers (
device_id,index), descriptive strings (name,vendor,backend) and capability hints (precision,supports_double,memory_byteswhen available). - Escapes string values using MATLAB-style single quote doubling so they are display-friendly.
- When no acceleration provider is registered, returns the placeholder string
GPU[no provider]instead of throwing an error, making it safe to call unconditionally. - Propagates unexpected errors (for example, if a provider fails while reporting metadata) so they can be diagnosed.
GPU memory and residency
gpuInfo is a pure metadata query and never changes residency. Arrays stay wherever they already live (GPU or CPU). Use gpuArray, gather, or RunMat Accelerate's auto-offload heuristics to move data between devices as needed.
Examples
Displaying GPU status in the REPL
disp(gpuInfo())Expected output:
GPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true]Emitting a log line before a computation
fprintf("Running on %s\n", gpuInfo())Expected output:
Running on GPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true]Checking for double precision support quickly
summary = gpuInfo();
if contains(summary, "supports_double=true")
disp("Double precision kernels available.");
else
disp("Falling back to single precision.");
endHandling missing providers gracefully
% Safe even when acceleration is disabled
status = gpuInfo();
if status == "GPU[no provider]"
warning("GPU acceleration is currently disabled.");
endCombining gpuInfo with gpuDevice for structured data
info = gpuDevice();
summary = gpuInfo();
if isfield(info, 'memory_bytes')
fprintf("%s (memory: %.2f GB)\n", summary, info.memory_bytes / 1e9);
else
fprintf("%s (memory: unknown)\n", summary);
endExpected output:
GPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true] (memory: 15.99 GB)FAQ
Does gpuInfo change GPU state?⌄
No. It only reads metadata and formats it into a string.
Will gpuInfo throw an error when no provider is registered?⌄
No. It returns GPU[no provider] so caller code can branch without exception handling.
How is gpuInfo different from gpuDevice?⌄
gpuDevice returns a struct that you can inspect programmatically. gpuInfo formats the same information into a single string that is convenient for logging and display.
Does the output order of fields stay stable?⌄
Yes. Fields are emitted in the same order as the gpuDevice struct: identifiers, descriptive strings, optional metadata, precision, and capability flags.
Are strings escaped in MATLAB style?⌄
Yes. Single quotes are doubled (e.g., Ada'GPU becomes Ada''GPU) so the summary can be pasted back into MATLAB code without breaking literal syntax.
Related Acceleration functions
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how gpuInfo works, line by line, in Rust.
- View gpuInfo.rs on GitHub
- Learn how the runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.
- Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
- Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
- A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.