Tuesday, December 18, 2018

Vulkan vkEnumeratePhysicalDevices Returning Unexpected Device Count


In the machine I'm running I have two GTX 980 Tis. When I query the physical device count with vkEnumeratePhysicalDevices it always returns 1 despite having 2 physical discrete graphics cards. When I use vulkaninfo the only device listed is GPU0 which is a DISCRETE_GPU / GTX 980 Ti.


This happens in Windows 10 as well as GNU/Linux 4.5 using Vulkan API 1.0.11 with proprietary Nvidia drivers.


Is this normal behavior and I'm not using the API correctly or is this a bug? I feel like I've made a glaring obvious mistake but I can't find anything in the Vulkan specification about it.


For clarity, this is exactly how I query physical device count:


auto deviceCount = uint32_t{0};
instance.enumeratePhysicalDevices(&deviceCount, nullptr);
// At this point deviceCount is 1

Also, to confirm that the OS sees the cards:



Windows 10:


C:\Users\matt>wmic path win32_VideoController get name
Name
NVIDIA GeForce GTX 980 Ti
NVIDIA GeForce GTX 980 Ti

GPUs in Nvidia Driver Settings


Linux 4.5:


+------------------------------------------------------+                       
| NVIDIA-SMI 364.19 Driver Version: 364.19 |

|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 980 Ti Off | 0000:01:00.0 On | N/A |
| 0% 56C P8 34W / 300W | 444MiB / 6140MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 980 Ti Off | 0000:02:00.0 Off | N/A |
| 0% 43C P8 25W / 300W | 22MiB / 6143MiB | 0% Default |
+-------------------------------+----------------------+----------------------+


GPUs in Nvidia XServer Settings



Answer



From the LunarG FAQ:



There is no multiple GPU support in version 1.0. That was unfortunately a feature Khronos had to cut in order to preserve schedule. It is expected to be near the top of the list for Vulkan 1.1. It is perfectly possible for a Vulkan implementation to expose multiple GPUs. What Vulkan currently can’t do is allow resource sharing between them. So from a point of view of, for example, a Windows system manager, its possible to recognize multiple ways to render to a surface and then use operating system hooks to transfer that to the screen. What Vulkan doesn’t have is the ability to share a texture or a render target between multiple GPUs.



I'd write this issue off as being something that wasn't implemented because it wasn't required that they implement it yet. When Vulkan adds better multi-GPU support to be required in their spec these issues will most likely be fixed. It is odd that it still won't expose the GPUs available, but even if it did, Vulkan 1.0.x isn't ready for utilizing multiple GPUs in a way that would benefit games.


Update as of 7/23/2016: With Nvidia GeForce driver v368.69 multiple GPUs are visible to Vulkan.


Without changing anything (still using Vulkan API v1.0.11) and updating to Nvidia's latest driver, I have full access to both physical devices on my machine, this doesn't mean that Multi-GPU support is quite here, but it's the first step in Vulkan even being a viable choice when developing a game.



No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...