Prácticas recomendadas
Vulkan
30/07/202682832 vistas
If you cannot find a GPU device when using Vulkan (or other software that relies on Vulkan, such as Omnigibson), follow these steps to resolve the issue:
Step 1: Write to the ICD file
mkdir -p /etc/vulkan/icd.d
cat >> /etc/vulkan/icd.d/my_nvidia_icd.json <<EOF
{
"file_format_version" : "1.0.0",
"ICD": {
"library_path": "/lib/x86_64-linux-gnu/libEGL_nvidia.so.0",
"api_version" : "1.3.277"
}
}
EOF
The library specified in library\_path must be libEGL_nvidia and not libGLX_nvidia, because the server does not have a desktop; the former is required when using headless mode. For details, see the documentation.
Step 2: Verification
Install required dependencies
apt update && apt install -y vulkan-tools libvulkan1 libsm6 libegl1
Finally, run vulkaninfo --summary to verify:
$ export VK_ICD_FILENAMES=/etc/vulkan/icd.d/my_nvidia_icd.json # 显式指定ICD文件路径
$ vulkaninfo --summary
...
Devices:
========
GPU0:
apiVersion = 4206869 (1.3.277)
driverVersion = 2308620416 (0x899ac080)
vendorID = 0x10de
deviceID = 0x2684
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU <--- 这里设备类型是GPU,说明正确。如果没有识别到GPU则是: PHYSICAL_DEVICE_TYPE_CPU
deviceName = NVIDIA GeForce RTX 4090 <--- 这里可以看出正确识别了GPU型号
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
driverInfo = 550.107.02
conformanceVersion = 1.3.7.2
deviceUUID = 75219daa-2fe9-cefe-4994-1a598657b01f
driverUUID = 12adfef6-a92a-528b-8610-45df7fa0a5b8
...
