Generated banner for Matlab Setup Gpu
Generated logo for Matlab Setup Gpu

Matlab Setup Gpu

MathWorksOfficialCreated by MathWorks

  • Skill
  • Tool integration
  • Science and research
  • BSD-2-Clause
  • No issues found

From the author

Detect and validate GPU availability for MATLAB GPU computing. Use when the user can't use their GPU, or is setting up or selecting a GPU. Triggers on: gpuDevice, GPU setup, check GPU, GPU not found, GPU not working, can't use GPU, GPU not available, unable to find a supported GPU device, compatible GPU, canUseGPU, validateGPU.
— the description by MathWorks

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured procedure for verifying GPU compatibility and performance readiness within MATLAB. It guides users through checking licensing, driver status, and hardware visibility, while offering specific troubleshooting steps for common failure modes like driver model conflicts or compute-mode restrictions. It is designed to ensure the environment is correctly configured for GPU-accelerated tasks before computation begins.

What it does

  • Verifies if a compatible GPU is available and licensed for use in MATLAB.
  • Diagnoses common GPU setup failures using built-in diagnostic tools.
  • Lists all visible GPU devices and their respective indices.
  • Queries specific device properties and driver models.
  • Provides troubleshooting guidance for Windows driver model limitations.
  • Offers a pathway to benchmark GPU performance for computing tasks.

When to use it

  • When you need to confirm if your system supports GPU-accelerated MATLAB code.
  • When you encounter errors while attempting to initialize a GPU device.
  • When setting up or selecting a specific GPU in a multi-GPU environment.
  • When troubleshooting why GPU computing is not functioning as expected.

Advantages

  • Uses native MATLAB APIs for accurate environment validation.
  • Provides a clear, step-by-step diagnostic path for common errors.
  • Helps identify configuration issues like WDDM driver model limitations.
  • Distinguishes between licensing issues, driver requirements, and hardware visibility.

Usage examples

“Check if my computer is ready for MATLAB GPU computing.”
The agent will run the canUseGPU check and, if necessary, guide you through the validateGPU diagnostic process to confirm hardware and licensing status.
“I am getting an error when using gpuDevice. How do I troubleshoot?”
The agent will walk you through listing available devices with gpuDeviceTable and using validateGPU to identify specific driver or compute-mode failures.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/matlab/matlab-setup-gpu/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip matlab-setup-gpu.zip -d .agents/skills

Documentation by MathWorks

Set Up GPU for MATLAB

Detect whether a compatible GPU is available, validate it works, and diagnose common failure modes.

When to Use

  • User wants to check if their system can run GPU code in MATLAB

  • User gets errors when calling gpuDevice or gpuArray

  • User wants to set up or select a specific GPU in a multi-GPU system

  • User needs to troubleshoot why GPU computing isn't working

  • As a prerequisite check before any GPU-accelerated workflow

When NOT to Use

  • Writing or optimizing GPU-accelerated code — this skill only detects and diagnoses GPU availability

  • Monitoring GPU memory or utilization during computation — use gpuDevice properties directly or NVIDIA tools

  • Distributing work across multiple GPUs with parallel pools — use parpool workflows

Conventions

  • Use MATLAB-native APIs (canUseGPU, gpuDeviceTable, gpuDevice) for detection and properties — reserve nvidia-smi for information MATLAB cannot provide

  • Prefer canUseGPU over gpuDeviceCount == 0 or isempty(gpuDeviceTable) for availability checks — canUseGPU also verifies licensing and toolbox state

  • If recommending a driver update, fetch the GPU Computing Requirements documentation page for the user's MATLAB release to check the driver selection policy

Workflow

1. Is a GPU available?
canUseGPU

Returns true if PCT is installed, licensed, GPU support is present, and a device is available. If true, proceed to step 3 (list available devices).

2. If canUseGPU returns false — diagnose
validateGPU("all")

If the output contains "requires a newer graphics driver": this does not guarantee a newer driver exists. Do not state that the GPU is unsupported or end-of-life — direct the user to verify on the GPU Computing Requirements page for this MATLAB release before drawing any conclusion about hardware compatibility.

For all other failures, interpret using the Troubleshooting table.

3. List available devices
gpuDeviceTable          % List all GPUs and indices (no memory allocation)

Always run gpuDeviceTable before selecting a device — it confirms which devices are visible and their MATLAB indices.

4. Select device and query properties
d = gpuDevice(N);       % Select GPU N
properties(d)           % List available device properties
5. Check driver model (Windows only)
d = gpuDevice;              % returns device already selected
d.DriverModel
d.KernelExecutionTimeout

If WDDM: the GPU is shared with the display — long-running kernels may be killed by the OS watchdog, and the GPU may exhibit unstable behaviour when low on memory. If d.KernelExecutionTimeout is true, kernel timeouts are active.

TCC or MCDM avoid these issues but are only available on select professional and data centre GPUs not connected to a display. If switching is not an option, and user experiences kernel timeouts, advise: increase TDR timeout in Windows Registry, close other GPU-accelerated apps, or break computation into smaller chunks.

6. Benchmark GPU performance (optional)

To qualify the GPU's computing power, suggest the user run gpuBench (available from the MATLAB File Exchange, not shipped with MATLAB). It benchmarks memory bandwidth, single/double precision compute, compares GPU vs CPU performance, and provides comparison data against other popular GPUs.

Troubleshooting

SymptomCauseResolution
canUseGPU returns false, no errorPCT not licensedCheck license('test','Distrib_Computing_Toolbox'). If false, user needs a PCT license.
validateGPU not foundPCT not installed or pre-R2024bCheck ver('parallel') — if empty, PCT is not installed; if version is below 24.2 (R2024b), validateGPU is not available in that release.
"requires a newer graphics driver" or validateGPU: platform or driver check FAILEDNVIDIA driver too old, or driver support for the GPU architecture may have endedDoes not guarantee a newer driver exists. Consult the GPU Computing Requirements documentation page for the user's release to confirm the GPU is still supported before advising a driver update.
validateGPU: "Device available" FAILEDProhibited or exclusive compute modeCheck the message: if "prohibited" — vGPU graphics-only profile ("B" suffix, e.g. A16-2B), requires compute-enabled profile (Q or C suffix), advise user to escalate to system administrator. If "exclusive" — GPU in use by another process, free it or select a different device.
validateGPU: device count is 0Device not visible to MATLABIf running in a container, verify GPU passthrough is configured. Otherwise, consult the GPU Computing Requirements documentation page for the user's release to confirm supported hardware.
GPU kernel killed mid-computation (Windows)WDDM driver model with TDR activeSee step 5 for driver model implications and remediation

Key Functions

FunctionPurpose
canUseGPUQuick availability check — true if PCT licensed and a usable GPU device exists
validateGPUStructured diagnostic — tests each layer and reports results
gpuDeviceTableList all visible GPUs with indices, names, and status (no memory allocation)
gpuDeviceSelect a GPU by index, or return the current device (no argument)

Copyright 2026 The MathWorks, Inc.


Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

The author says: >=R2024b

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
MathWorks
Publisher
MathWorks (Official)
Source
matlab/matlab-agentic-toolkit · skills-catalog/parallel-computing/matlab-setup-gpu · commit 2a7f215
Licence
BSD 2-Clause License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by MathWorks.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-setup-gpu.zip