Main Content

gpuDeviceTable

Table of properties of GPU devices

Since R2021a

    Description

    example

    tbl = gpuDeviceTable returns a table of properties of all GPU devices detected in your system. The table displays the value of the Index, Name, ComputeCapability, DeviceAvailable, and DeviceSelected properties of each GPU device detected in your system. Each row of the table contains the properties of a single GPU device.

    example

    tbl = gpuDeviceTable(props) returns a customized table of properties. Each element of props must be one of the properties returned by gpuDevice. Use this syntax to query and compare specific properties of the GPU devices in your system, such as AvailableMemory.

    Examples

    collapse all

    Use gpuDeviceTable to query and compare the properties of all GPUs in your system at a glance.

    tbl = gpuDeviceTable
    tbl =
    
      2×5 table
    
        Index           Name           ComputeCapability    DeviceAvailable    DeviceSelected
        _____    __________________    _________________    _______________    ______________
    
          1      "NVIDIA RTX A5000"          "8.6"               true              true      
          2      "Quadro P620"               "6.1"               true              false       
    

    Both devices are available for use in this MATLAB® session. The selected GPU device, with index 1, has a higher compute capability than the device with index 2.

    Alternatively, you can determine how many GPU devices are available, inspect some of their properties, and select a device to use from the MATLAB® desktop. On the Home tab, in the Environment area, select Parallel > Select GPU Environment.

    The Parallel menu, including the Select GPU Environment pane showing two GPU devices. A tick next to the first device indicates that it is the selected device.

    Use gpuDeviceTable to query and compare the specific properties of all GPUs in your system.

    Compare the compute capability, total memory, multiprocessor count, and availability of the GPU devices in your system.

    tbl = gpuDeviceTable(["Index","ComputeCapability",...
       "TotalMemory","MultiprocessorCount","DeviceAvailable"])
    tbl =
    
      2×5 table
    
        Index    ComputeCapability    TotalMemory    MultiprocessorCount    DeviceAvailable
        _____    _________________    ___________    ___________________    _______________
    
          1            "8.6"          2.5553e+10             64                  true      
          2            "6.1"          2.1473e+09              4                  true      

    Input Arguments

    collapse all

    GPU device properties, specified as a string array or a cell array of character vectors. Each element of props must be one of the properties returned by gpuDevice.

    The variables of the output table are the properties specified by props, in the same order as provided in props.

    Example: ["Name","ComputeCapability","AvailableMemory"]

    Data Types: char | string | cell

    Output Arguments

    collapse all

    Table of GPU device properties, returned as a table.

    The default variables of tbl are Index, Name, ComputeCapability, DeviceAvailable, and DeviceSelected. If you specify the props argument, then the output table contains only the specified properties.

    Extended Capabilities

    Version History

    Introduced in R2021a