为 Zivid 软件选择特定 GPU
This article demonstrates how to specify a computational device for Zivid Software. This is relevant if you have multiple GPUs and want to use a specific one. This can be one integrated GPU and one or more dedicated GPUs.
备注
确保满足 Zivid 的 GPU 要求 。如果您尝试使用 CPU 或 AMD GPU 运行 Zivid SDK,请查看如何 选择使用不受支持的计算设备 运行 SDK。
Specifying GPU is done by updating the Zivid Config file.
If the file already exists and it's located in %LOCALAPPDATA%ZividAPI for Windows or "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API for Ubuntu, skip ahead to editing the ComputeDevice parameters below.
如果文件不存在:
下 载
Config.yml文件。配置文件包含以下信息:
__version__: 4 Configuration: ComputeDevice: SelectionFilter: "" Type: GPU Vendor: Nvidia
将配置文件放在以下目录中:
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/
小心
任何现有的配置文件都将被覆盖。
小心
Zivid配置文件必须使用.yml文件扩展名(而不是.yaml)。
通过更改配置文件的
ComputeDevice参数来分配所需的GPU(如果已知):如果每个供应商只有一个 GPU(例如集成 Intel GPU 和专用 NVIDIA GPU),请将
Type更改为GPU,Vendor更改为NVIDIA或Intel,例如ComputeDevice: SelectionFilter: "" Type: GPU Vendor: Nvidia
If you have multiple GPUs of the same vendor (e.g. two Nvidia GPUs),
SelectionFiltermust specify which GPU to use. Find the exact device name first: with the OpenCL version of the SDK, runclinfo -lto list all compute devices; with the CUDA version, runnvidia-smi -Linstead. LeaveTypeandVendorasAny, and setSelectionFilterto any unique part of the device name, e.g. for an NVIDIA GeForce RTX 3060:ComputeDevice: SelectionFilter: "RTX 3060" Type: Any Vendor: Any
要验证设置是否成功,需要重新启动Zivid Studio,然后点击 Help → About Zivid Studio → System Info → Compute Device Info。可以 在 Device info 下看到指定的GPU设备。
Version History
SDK |
变更 |
|---|---|
2.11.0 |
不再推荐使用AMD。 SDK 中已移除官方支持,请参阅 为 Zivid 软件启用不支持的计算设备 。 移除了仅在 CPU 上运行 SDK 的说明。 |