关于GPU

Zivid SDK 需要主机上安装有 GPU 才能最佳地运行。集成 GPU 和独立 GPU 都可以与 Zivid 良好配合,其中的性能差异在于您获得的捕获时间。

GPU 的要求

Windows

For optimal performance, the dedicated or integrated GPU should have at least 3 GB of RAM available. Additionally, either a CUDA (12 or later) or an OpenCL driver (1.2 or later) for the GPU is necessary to use Zivid. An OpenGL driver (3.0 or later) for the GPU is also necessary to use Zivid Studio or visualizers in the SDK; this is usually installed with the GPU driver, but older drivers can use a version below 3.0. Follow the instructions below for your specific GPU.

Intel

OpenCL 驱动程序通常与图形驱动程序一起安装,并且应该已经安装在 Windows 上。如果您想检查您已有的 GPU 驱动程序,请使用下面的下拉列表。如果没有,请从 Intel 下载并安装最新的显卡驱动程序。

Check GPU driver

使用 Intel Driver & Support assistant 自动检测您的驱动程序版本或按照以下说明手动查找。

英特尔驱动程序和支持助手的屏幕截图 "英特尔驱动程序和支持助手" 中图形窗格的屏幕截图
  1. StartControl Panel

  2. 从列表中选择 Device Manager (如果需要,将 View 切换为 Small Icons

  3. 展开 Display Adapter 部分并右键单击 Intel® Display AdapterProperties

  4. 导航到 Driver 标签并记下显示的 Driver Version

    Windows 上 Intel 显卡的驱动程序属性的屏幕截图。

安装图形驱动程序后,打开 Zivid Studio 并验证不会发生 OpenCL 错误。

NVIDIA

备注

NVIDIA GPU 的计算能力必须高于最低要求值 3.3。如果不满足此要求,SDK将抛出异常:

The compute capability X.Y of the NVIDIA compute device is lower than the minimum required compute capability 3.3 (or The minimum required SM version is 3.3. Device has version X.Y).

有关 NVIDIA GPU 及其相应计算能力的概述,请访问 https://developer.nvidia.com/cuda-gpus

CUDA

The CUDA backend requires an NVIDIA driver that supports CUDA 12 or newer.

OpenCL

The OpenCL driver is usually installed together with the graphics driver.

警告

The OpenCL version of the SDK treats NVIDIA GPUs as an unsupported compute device. After installing the OpenCL version of the SDK, you must edit the Config.yml file to allow it, or the SDK will fail with an error. Zivid recommends installing the CUDA version instead, which requires no extra configuration.

Use the dropdown below if you want to check which GPU driver you have. If not, download and install the relevant graphics driver for your GPU from NVIDIA.

Check GPU driver

使用 NVIDIA Smart Scan 自动检测您的驱动程序版本或按照以下说明手动查找。

  1. 打开 NVIDIA Control Panel (右键单击 Desktop )。

  2. 单击 System Information (左下角)。

  3. 请记录 Driver version 中的 Details

    Windows 上 NVIDIA 系统信息的屏幕截图。

After installing the graphics drivers, open Zivid Studio and verify that no errors occur.

AMD

警告

Since SDK 2.10, support for AMD has been removed due to OpenCL stability issues in the drivers. It is possible to opt in to run the SDK with an unsupported compute device, by enabling an option in the Config.yml file. However, such a setup can give unexpected results and errors, and is not tested by Zivid.

警告

Radeon 在某些 GPU 上不再支持 SPIR,请验证您的 GPU 驱动程序是否支持 SPIR 以与 Zivid 兼容。

OpenCL 驱动程序通常与图形驱动程序一起安装。如果您想检查您已有的 GPU 驱动程序,请使用下面的下拉列表。如果没有,请从 AMD 下载并安装适用于您的 GPU 的相关显卡驱动程序。

Check GPU driver

使用 AMD Driver Auto-detect tool 自动检测您的驱动程序版本或按照以下说明手动查找。

  1. 打开 AMD Radeon Settings (右键单击 Desktop )。

  2. 单击 System 可访问系统概述、软件和硬件详细信息。

  3. 选择 Software 标签以获取有关已安装图形驱动程序的详细信息。请记录 Driver Packaging Version

Windows 上 AMD 系统信息的屏幕截图。

安装图形驱动程序后,打开 Zivid Studio 并验证不会发生 OpenCL 错误。

In addition to the OpenCL or CUDA driver above, Zivid Studio and the SDK's visualizers also need an OpenGL driver.

Check OpenGL drivers
  1. 下载 OpenGL Extensions Viewer

  2. 安装、启动并检查 OpenGL 版本:

In case the version is below 3.0, you need to install the latest GPU driver following the instructions for your GPU above.

Ubuntu

For optimal performance, the dedicated or integrated GPU should have at least 3 GB of RAM available. Additionally, either a CUDA (12 or later) or an OpenCL driver (1.2 or later) for the GPU is necessary to use Zivid. An OpenGL driver (3.0 or later) for the GPU is also necessary to use Zivid Studio or visualizers in the SDK; this is usually installed with the GPU driver, but older drivers can use a version below 3.0. Follow the instructions below for your specific GPU.

Intel

Ubuntu 上应该已经安装了 Intel 的显卡驱动程序,但不一定包含 OpenCL 驱动程序。如果您想检查您的图形驱动程序是否存在,请使用下面的下拉菜单。

Check GPU driver

按键盘上的 Ctrl + Alt + T 键打开终端窗口,并检查驱动程序是否存在。

lspci -k | grep -EA3 'VGA|3D|Display'

欲了解更多信息,请访问官方 Intel pages

  1. 按键盘上的 Ctrl + Alt + T 键打开终端窗口,然后安装 OpenCL 驱动程序。

    Ubuntu 26.04
    sudo apt update
    sudo apt install intel-opencl-icd
    
    Ubuntu 24.04
    sudo apt update
    sudo apt install intel-opencl-icd
    
    Ubuntu 22.04
    sudo apt update
    sudo apt install intel-opencl-icd
    
    Ubuntu 20.04
    sudo apt update
    sudo apt install intel-opencl-icd
    
    Ubuntu 18.04

    备注

    自 SDK 2.10 起,移除了对 Ubuntu 18.04 的支持。如需查看早期 SDK 版本的 Ubuntu 18.04 说明,请更改左上角的知识库版本。

  2. 打开 Zivid Studio 并验证不会出现 OpenCL 错误。

备注

如果您碰到 OpenCL 错误,您可能必须 将您的用户添加到视频组

NVIDIA

备注

NVIDIA GPU 的计算能力必须高于最低要求值 3.3。如果不满足此要求,SDK将抛出异常:

The compute capability X.Y of the NVIDIA compute device is lower than the minimum required compute capability 3.3 (or The minimum required SM version is 3.3. Device has version X.Y).

有关 NVIDIA GPU 及其相应计算能力的概述,请访问 https://developer.nvidia.com/cuda-gpus

CUDA

The CUDA backend requires an NVIDIA driver that supports CUDA 12 or newer.

OpenCL

The OpenCL driver for NVIDIA is installed with the graphics driver.

警告

The OpenCL version of the SDK treats NVIDIA GPUs as an unsupported compute device. After installing the OpenCL version of the SDK, you must edit the Config.yml file to allow it, or the SDK will fail with an error. Zivid recommends installing the CUDA version instead, which requires no extra configuration.

Use the dropdown below if you want to check if your graphics driver is present, or continue to install the latest driver for your system.

Check GPU driver

按键盘上的 Ctrl + Alt + T 键打开终端窗口,然后执行以下命令:

nvidia-smi

这将打印驱动程序版本。

  1. 将 NVIDIA GPU 驱动程序 PPA 添加到您的系统:

    按键盘上的 Ctrl + Alt + T 键打开终端窗口,然后添加图形驱动程序 PPA。

    sudo add-apt-repository ppa:graphics-drivers/ppa
    

    This makes the latest long-lived driver release, packaged as nvidia-xxx, available to install in the next step.

  2. 为您的系统安装最新的驱动程序:

    Ubuntu 26.04
    sudo apt update
    sudo apt install nvidia-driver-xxx
    
    Ubuntu 24.04
    sudo apt update
    sudo apt install nvidia-driver-xxx
    
    Ubuntu 22.04
    sudo apt update
    sudo apt install nvidia-driver-xxx
    
    Ubuntu 20.04
    sudo apt update
    sudo apt install nvidia-driver-xxx
    
    Ubuntu 18.04

    备注

    自 SDK 2.10 起,移除了对 Ubuntu 18.04 的支持。如需查看早期 SDK 版本的 Ubuntu 18.04 说明,请更改左上角的知识库版本。

    安装驱动程序后,重新启动系统。

    sudo reboot
    
  3. 打开 Zivid Studio 并验证不会出现 OpenCL 错误。

备注

如果您碰到 OpenCL 错误,您可能必须 将您的用户添加到视频组

AMD

警告

Since SDK 2.10, support for AMD has been removed due to OpenCL stability issues in the drivers. It is possible to opt in to run the SDK with an unsupported compute device, by enabling an option in the Config.yml file. However, such a setup can give unexpected results and errors, and is not tested by Zivid.

警告

Radeon 在某些 GPU 上不再支持 SPIR,请验证您的 GPU 驱动程序是否支持 SPIR 以与 Zivid 兼容。

  1. Download, extract, and install the correct Radeon Software for Linux:

    Ubuntu 22.04

    按键盘上的 Ctrl + Alt + T 键打开终端窗口,然后创建一个临时文件夹。

    mkdir amd && cd amd
    

    Download the driver installer package for the verified-working version, 22.20.3:

    wget --referer http://support.amd.com http://repo.radeon.com/amdgpu-install/22.20.3/ubuntu/jammy/amdgpu-install_22.20.50203-1_all.deb
    

    备注

    AMD's release notes page and its /latest path both link to a broken installer. Use the pinned version above instead, which Zivid has verified to work.

    使用 apt 安装此软件包:

    sudo apt update
    sudo apt install ./amdgpu-install_22.20.50203-1_all.deb
    

    AMD的官方说明

    amdgpu-install --usecase=graphics,opencl --no-32 --no-dkms
    

    备注

    如果您需要安全启动,则可能必须包含 DKMS(在上述命令中删除 --no-dkms )。更多相关信息,请参阅 secure-boot-support

    现在将您的用户添加为 rendervideo 组的成员。

    sudo gpasswd -a $USER render
    sudo gpasswd -a $USER video
    

    You may have to reboot for the changes to take effect.

    sudo reboot
    

    You can now try to open Zivid Studio. If it fails, follow the Secure Boot configuration step below.

    Ubuntu 20.04

    按键盘上的 Ctrl + Alt + T 键打开终端窗口,然后创建一个临时文件夹。

    mkdir amd && cd amd
    

    检查您的 Linux 内核版本:

    uname -r
    
    Kernel 5.4

    对于 Linux Kernel version 5.4 (Ubuntu LTS),请下载适用于 Ubuntu 20.04 的 Radeon Software 20.45:

    wget --referer http://support.amd.com https://drivers.amd.com/drivers/linux/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz
    

    提取内容:

    tar -Jxvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz
    cd amdgpu-pro-20.45-1188099-ubuntu-20.04
    
    Kernel 5.8

    对于 Linux Kernel version 5.8 (Ubuntu LTS HWE stacks),请下载适用于 Linux 20.04 的 Radeon Software 20.50:

    wget --referer http://support.amd.com https://drivers.amd.com/drivers/linux/amdgpu-pro-20.50-1234664-ubuntu-20.04.tar.xz
    

    提取内容:

    tar -Jxvf amdgpu-pro-20.50-1234664-ubuntu-20.04.tar.xz
    cd amdgpu-pro-20.50-1234664-ubuntu-20.04
    

    AMD 的官方说明

    ./amdgpu-pro-install --opencl=pal
    
    Ubuntu 18.04

    备注

    自 SDK 2.10 起,移除了对 Ubuntu 18.04 的支持。如需查看早期 SDK 版本的 Ubuntu 18.04 说明,请更改左上角的知识库版本。

  2. 按照步骤配置安全启动(如果出现提示):

    ../../../_images/secure_boot_1.png
    ../../../_images/secure_boot_2.png
    ../../../_images/secure_boot_3.png

    如果您无法启动,请检查 安装AMD OpenCL驱动程序后系统启动错误

  3. 打开 Zivid Studio 并验证不会出现 OpenCL 错误。

备注

如果您碰到 OpenCL 错误,您可能必须 将您的用户添加到视频组

In addition to the OpenCL or CUDA driver above, Zivid Studio and the SDK's visualizers also need an OpenGL driver.

Check OpenGL drivers

按键盘上的 Ctrl + Alt + T 键打开终端窗口,然后执行以下命令:

sudo apt install mesa-utils
glxinfo | grep "OpenGL version"

这将打印 OpenGL 版本。

../../../_images/opengl_version_ubuntu_screenshot.png

In case the version is below 3.0, you need to install the latest GPU driver following the instructions for your GPU above.

Nvidia Jetson Linux

Nvidia Jetson Orin and Thor have CUDA enabled Nvidia GPUs. All required GPU drivers are installed with the operating system.

Zivid Studio and the SDK's visualizers also need an OpenGL driver.

Check OpenGL drivers

Jetson Linux 系统自带兼容的 OpenGL 版本,因此无需执行任何操作。

性能考虑因素

Dedicated GPU

A dedicated GPU gives the best performance with Zivid. It is also the best choice if the GPU will be used for more than Zivid's computations. A medium to high-end NVIDIA GPU with at least 3 GB of memory is required for optimal performance. This is the preferred solution for Zivid.

建议:

  • NVIDIA GeForce GTX 1060 或更高配置(台式机)

  • NVIDIA GeForce MX150 或更高配置(笔记本电脑)

Integrated GPU

This is the most cost-efficient solution for Zivid. The benefit of an integrated GPU is that the data transfer from GPU to CPU is fast. It is also beneficial for applications that require low power consumption, e.g., battery-powered mobile platforms. A high-end integrated GPU with at least 3 GB of memory available is required for optimal performance.

建议:

  • 配备 HD630 或更好 GPU 的 Intel i7

Nvidia Jetson

Zivid recommends Jetson boards that have at least 16GB of RAM for running Zivid SDK and additional software.

While Zivid SDK supports Jetson Orin Nano, Orin Nano has only 4GB/8GB of total RAM, which is shared between the CPU and the GPU. 4GB is generally insufficient to run any application using Zivid SDK, while 8GB in practice is insufficient for many use cases, especially when combining longer captures, the Stripe/Omni engine, and many filters. Therefore, when using Orin Nano, RAM usage in your application must be carefully evaluated.

Jetson Thor modules (T4000/T5000) ship with 64GB or 128GB of RAM, well above the recommended minimum.

警告

Jetson boards may boot in a reduced power profile that significantly slows down Zivid SDK point cloud processing. Set the maximum power profile as described in 在 Jetson Linux 上安装 Zivid.

选择计算设备

If you have multiple GPUs and want Zivid SDK to use a specific one, you can specify the compute device in the Configuration file. You can also configure Zivid SDK to run on a CPU, but CPU is an unsupported compute device mode.

CUDA and OpenCL

Zivid SDK is available in two versions, a CUDA version and an OpenCL version. The version is selected when you install the SDK, not in the configuration file.

The CUDA version runs on NVIDIA GPUs only. The OpenCL version runs on Intel GPUs, and can run on NVIDIA GPUs as an unsupported compute device. To use an NVIDIA GPU as a supported compute device, install the CUDA version of the SDK.

Configuration file

如果该文件不存在,请下载 Config.yml 文件并将其放置在以下目录中:

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

The desired GPU is assigned by changing the ComputeDevice parameters in the configuration file.

Single vendor

如果您有来自单个供应商的多个 GPU(例如两个 Nvidia GPU), SelectionFilter 必须指定要使用哪个 GPU。我们将使用 clinfo 列出所有计算设备。请按照下面的下拉列表了解有关 clinfo 、如何安装以及如何使用它的更多信息。

clinfo
Windows
  1. 下载 clinfo Windows 二进制文件。

  2. 按键盘上的 Win + R 键启动命令提示符,然后输入 cmd 并按 Enter

  3. 导航到包含下载文件 (clinfo.exe) 的目录并执行以下命令:

    clinfo.exe -l
    

    这将打印有关系统上所有 OpenCL 平台及其公开的设备的所有可用信息。

    ../../../_images/cmd_cl_windows.png

    如果您的 GPU 未列出,您可能需要 安装 OpenCL 驱动程序和/或图形驱动程序

  4. 如需检查 OpenCL 驱动程序版本,请使用 clinfo 并搜索 OpenCL 平台版本:

    clinfo.exe | findstr "Platform\ Version"
    

    如果版本低于 OpenCL 1.2 ,则需要 更新您的图形驱动程序

Ubuntu
  1. 按键盘上的 Ctrl + Alt + T 键打开终端窗口并安装 clinfo

    sudo apt install -y clinfo
    
  2. 运行 clinfo -l 列出所有 OpenCL 平台。

    sudo /usr/bin/clinfo -l
    

    这将打印有关系统上所有 OpenCL 平台及其公开的设备的所有可用信息。

    如果您的 GPU 未列出,您可能需要 安装 OpenCL 驱动程序和/或图形驱动程序

    ../../../_images/no-platforms-ubuntu.png
  3. 如需检查 OpenCL 驱动程序版本,请使用 clinfo 并搜索 OpenCL 平台版本:

    sudo /usr/bin/clinfo | grep "Platform Version"
    

    如果版本低于 OpenCL 1.2 ,您需要 更新您的 OpenCL 驱动程序和/或图形驱动程序

如需查找特定的 GPU 名称,请运行 clinfo 来列出您的计算设备。

clinfo -l

备注

clinfo lists OpenCL devices and applies to the OpenCL version of the SDK. With the CUDA version, run nvidia-smi -L in a terminal instead, and use any unique part of the CUDA device name. Both commands run on Windows and Ubuntu. On Windows, clinfo is not installed by default and nvidia-smi is sometimes not on the PATH.

将配置文件中的 SelectionFilter 更改为所需设备名称的任何唯一部分。例如,当输入内容如下时,选择 NVIDIA GeForce RTX 3060

../../../_images/clinfo_multiple_gpu_single_vendor.png

set SelectionFilter to

ComputeDevice:
    SelectionFilter: "RTX 3060"
    Type: Any
    Vendor: Any
Multiple vendors

If you have multiple GPUs from multiple vendors (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

启用不受支持的计算设备

Enabling unsupported compute devices can be done by enabling an option in the Configuration file. However, such a setup can give unexpected results and errors, and is not tested by Zivid. Currently, the unsupported compute devices are AMD GPUs, NVIDIA GPUs on the OpenCL version of the SDK, and CPUs. Download the Config.yml file for your compute device below:

Enable AMD

Download the Config.yml file, which contains the following information, where AllowUnsupported: yes enables unsupported compute devices:

__version__:
    serializer: 1
    data: 19
Configuration:
    ComputeDevice:
        AllowUnsupported: yes
Enable NVIDIA on the OpenCL version

The OpenCL version of the SDK treats NVIDIA GPUs as unsupported compute devices. If you install the OpenCL version on an NVIDIA GPU without enabling it, the SDK will fail with an error saying that NVIDIA compute devices are not supported (see NVIDIA Compute Devices Are Not Supported by the OpenCL Version for the exact error message). Download the Config.yml file below, where Vendor is set to Nvidia and AllowUnsupported to yes. For a supported setup on NVIDIA GPUs, install the CUDA version of the SDK instead.

__version__:
    serializer: 1
    data: 19
Configuration:
    ComputeDevice:
        Type: GPU
        Vendor: Nvidia
        AllowUnsupported: yes
Enable CPU

It is possible to run the Zivid SDK on an Intel chipset using their CPU Runtime for OpenCL. Download the Config.yml file below, where the compute device Type is set to CPU, and Vendor to Intel.

__version__:
    serializer: 1
    data: 19
Configuration:
    ComputeDevice:
        Type: CPU
        Vendor: Intel
        AllowUnsupported: yes

警告

CPU is an unsupported compute device mode. Capture time will be greatly increased when using CPU and this setup is not recommended for most applications. In mixed OpenCL platform setups, CPU selection can also cause unstable behavior, including crashes.

Once downloaded, place the Config.yml file in the following directory:

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

Version History

SDK

变更

2.18.0

Added support for the CUDA compute backend for NVIDIA GPUs. Added Jetson Thor support. Added support for Ubuntu 26.04.

2.12.0

增加了 Jetson Orin 的支持。