Vulkan application freezes on Ubuntu 18 when multiple GPU devices are found
On my laptop as well as on my colleague's laptop we experience a freeze running a Vulkan application on Ubuntu 18. The freeze happens when the system discovers 2 GPU devices (NVidia and Intel) and selects Intel. If the NVidia device is selected explicitly, everything works fine. If the Intel device is selected as prime and is a single visible device in the system everything works fine.
I was able to reproduce the freeze with our application as well as with vkcube
. With the API Dump validation layer, I can track the call where the freeze happens:
Thread 0, Frame 3, Time 59493 us:
vkAcquireNextImageKHR(device, swapchain, timeout, semaphore, fence, pImageIndex) returns VkResult
As you can see, it happens in the 4th frame. The previous 3 acquire and present return VK_SUCCESS
. I believe the number 4 is bound with the number of swapchain images. For my GPU (Intel(R) UHD Graphics 630 (CFL GT2)
) VkSurfaceCapabilitiesKHR::minImageCount
is 3 and VkSurfaceCapabilitiesKHR::maxImageCount
is 0.
System information
System: Host: nc-ThinkPad-P1 Kernel: 5.4.0-70-generic x86_64
bits: 64 gcc: 7.5.0
Desktop: Gnome 3.28.4 (Gtk 3.22.30-1ubuntu4) dm: lightdm
Distro: Ubuntu 18.04.5 LTS
CPU: 6 core Intel Core i7-8850H (-MT-MCP-)
arch: Skylake rev.10 cache: 9216 KB
flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 31199
clock speeds: min/max: 800/4300 MHz 1: 800 MHz 2: 800 MHz
3: 800 MHz 4: 800 MHz 5: 800 MHz 6: 800 MHz 7: 800 MHz 8: 800 MHz
9: 800 MHz 10: 800 MHz 11: 800 MHz 12: 800 MHz
Graphics: Card-1: Intel Device 3e9b bus-ID: 00:02.0 chip-ID: 8086:3e9b
Card-2: NVIDIA GP107GLM [Quadro P1000 Mobile]
bus-ID: 01:00.0 chip-ID: 10de:1cbb
Display Server: x11 (X.Org 1.19.6 )
drivers: modesetting,nvidia (unloaded: fbdev,vesa,nouveau)
Resolution: 1920x1080@60.03hz
OpenGL: renderer: Quadro P1000/PCIe/SSE2
version: 4.6.0 NVIDIA 460.67 Direct Render: Yes
API dump for vkcube
Any extra information would be greatly appreciated
The NVidia driver was selected through Ubuntu's UI tool Software & Updates -> Additional Drivers
.
The Mesa driver was installed with sudo apt install mesa-vulkan-drivers