From e7d78a7b8763a807beba4709804c2fa97d39ec72 Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Thu, 29 Feb 2024 21:09:04 +0100 Subject: [PATCH] vulkan/runtime: Allow more than 8 DRM devices Some people seem to have systems with more than 8 GPUs installed at once. 256 is the maximum number of devices returned by libdrm, so using this seems like a good choice for now. Part-of: --- src/vulkan/runtime/vk_instance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vulkan/runtime/vk_instance.c b/src/vulkan/runtime/vk_instance.c index f375c16f365..4ed52d3ac44 100644 --- a/src/vulkan/runtime/vk_instance.c +++ b/src/vulkan/runtime/vk_instance.c @@ -389,8 +389,8 @@ vk_instance_add_driver_trace_modes(struct vk_instance *instance, static VkResult enumerate_drm_physical_devices_locked(struct vk_instance *instance) { - /* TODO: Check for more devices ? */ - drmDevicePtr devices[8]; + /* libdrm returns a maximum of 256 devices (see MAX_DRM_NODES in libdrm) */ + drmDevicePtr devices[256]; int max_devices = drmGetDevices2(0, devices, ARRAY_SIZE(devices)); if (max_devices < 1)