Select Specific GPU for Zivid Software

This article demonstrates how to specify a computational device for Zivid Software. You should consider this if you have multiple GPUs and want to use a specific one. This can be one integrated GPU and one or more dedicated GPUs.

Note

Make sure that the GPU requirements for Zivid are met. If you are trying to run Zivid SDK using CPU or AMD GPU, check how to opt in to run the SDK with an unsupported compute device.

Specifying GPU is done by updating the Zivid Config file. If the file already exists and its located in %LOCALAPPDATA%ZividAPI for Windows or "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API for Ubuntu, go top step 3.

If the file does not exist:

  1. Download the Config.yml file.

    The config file contains the following information:

    __version__: 4
    Configuration:
        ComputeDevice:
            SelectionFilter: ""
            Type: GPU
            Vendor: Nvidia
    
  2. Place the config file in the following directory:

    mkdir %LOCALAPPDATA%\Zivid\API
    move %HOMEPATH%\Downloads\Config.yml %LOCALAPPDATA%\Zivid\API\
    
    mkdir --parents "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API
    mv ~/Downloads/Config.yml "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API/
    

    Caution

    Any existing Config file will be overwritten.

Caution

Zivid configuration files must use .yml file extension ( not .yaml).

  1. The desired GPU (if it is known) is assigned by changing the config file ComputeDevice parameters:

  2. If you have a single GPU per vendor (e.g. an integrated Intel GPU and a dedicated NVIDIA GPU), change Type to GPU and Vendor to NVIDIA or Intel, e.g.

    ComputeDevice:
        SelectionFilter: ""
        Type: GPU
        Vendor: NVIDIA
    
  3. If you have multiple GPUs of the same vendor (e.g. two Nvidia GPUs), write something in the selection filter, e.g. “something” and leave Type and Vendor as Any, e.g.

    ComputeDevice:
        SelectionFilter: "something"
        Type: Any
        Vendor: Any
    

    Start Zivid Studio. An error message like this should appear:

    ../../../_images/studio-error-wrong-gpu-selected.png

    Change the SelectionFilter to any unique part of the string that describes the desired available devices, e.g.

    ComputeDevice:
        SelectionFilter: "620"
        Type: Any
        Vendor: Any
    
  4. To verify the changes, re-launch Zivid Studio and go to HelpAbout Zivid StudioSystem InfoCompute Device Info. The selected device can be seen under Device info.

    ../../../_images/studio-system-info-device-info-highlighted.png

Version History

SDK

Changes

2.11.0

AMD is no longer recommended. Official support has been removed in SDK, see Enable Unsupported Compute Device for Zivid Software.

Removed instructions to run SDK on CPU only.