The Vulkan ICD provided by Nvidia’s driver always wakes up the dgpu on hybrid graphic systems, even if the gpu chosen by the program is not the Nvidia dgpu.
When running a Vulkan program, its launch will be delayed for several seconds, while the card is resumed. Once the program launches, the card goes back to sleep after a while:
It currently isn’t that big of a deal, as most Vulkan programs desire to run in the dgpu anyways…
However, it will be extremely important in the near future as Vulkan starts being adopted by programs and libraries which value power efficiency over performance.
For example, GTK4 has started using its Vulkan renderer by default with v4.15 (testing), in order to determine if it’s ready for the next production version, v4.16.
WIth this bug, all GTK4 programs wake up the nvidia dgpu during their initialization. This causes several seconds of delay before a window appears and reduces battery life on laptops.
GTK’s developers will likely not hold off on migrating to the Vulkan renderer because of nvidia driver bugs, so fixing this issue should be considered a priority.
Running the program with nvidia_icd disabled works as expected. vkCreateInstance returns near-instantly.
Running the program normally adds a delay of around 2 seconds to vkCreateinstance. This is consistent with the time it takes for the dgpu to go into D0.
Some of the IOCTLs sent by nvidia’s userspace appear to wake up the dgpu. The first three IOCTLs do not wake up the gpu, however, the fourth (and some after) do.
Hi @jrelvas
I performed tests on couple of notebooks, but it doesn’t seem like I am having exact repro locally.
Could you please help to share repro videos and nvidia bug report for my reference.
Here’s a screen recording of the issue in question:
Left terminal shows the repro program’s output, while the right terminal shows the power state of the nvidia gpu. You’ll notice that the dgpu wakes up as soon as a Vulkan instance is created and that there’s an associated delay.
Make sure to perform this test when the GPU’s already at d3cold, otherwise you won’t be able to see it in effect.
Most Vulkan applications begin by enumerating all devices in the system and selecting one or more based on their capabilities. Currently, the NVIDIA driver must power on GPUs to discover their capabilities during this enumeration phase. The engineering team is investigating methods to perform these operations without powering on the GPU, but we cannot commit to an ETA for such a solution at this time.