felixdoerre / primus_vk

Vulkan GPU-offloading layer
BSD 2-Clause "Simplified" License
230 stars 17 forks source link

vkmark fails with primusvk, runs fine without #66

Closed arcivanov closed 4 years ago

arcivanov commented 4 years ago

Fedora 32.

bash-5.0$ vkmark
=======================================================
    vkmark 2017.08
=======================================================
    Vendor ID:      0x8086
    Device ID:      0x3E9B
    Device Name:    Intel(R) UHD Graphics 630 (CFL GT2)
    Driver Version: 83886087
=======================================================
[vertex] device-local=true: FPS: 7807 FrameTime: 0.128 ms
[vertex] device-local=false: FPS: 7771 FrameTime: 0.129 ms
=======================================================
                                   vkmark Score: 7789
=======================================================
bash-5.0$ ENABLE_PRIMUS_LAYER=1 optirun vkmark
PrimusVK: Searching for display GPU:
PrimusVK: 0x55dc8cc45e90: 
PrimusVK: 0x55dc8cc45ec0: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) UHD Graphics 630 (CFL GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x55dc8cc45e90.
PrimusVK: Got discrete gpu!
PrimusVK: Device: Quadro T2000
PrimusVK:   Type: 2
PrimusVK: fetching dispatch for 0x55dc8ce6fe40
PrimusVK: Creating display device finished!: 0
PrimusVK: fetching dispatch for 0x55dc8cdabdb0
PrimusVK: CreateDevice done
PrimusVK: Application requested 3 images.
PrimusVK: Creating Swapchain for size: 800x600
PrimusVK: MinImageCount: 3
PrimusVK: fetching device for: 0x55dc8cdabdb0
PrimusVK: FamilyIndexCount: 1
PrimusVK: Dev: 0x55dc8ce6fe40
PrimusVK: Swapchainfunc: 0x7fe0a04c9f90
PrimusVK: >> Swapchain create done 0;0x55dc8ce68a70
PrimusVK: Image aquiring: 5
PrimusVK: Selected render mem: 9;7 display: 0
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating image: 800x600
PrimusVK: Creating a Swapchain thread.
PrimusVK: Count: 3
=======================================================
    vkmark 2017.08
=======================================================
    Vendor ID:      0x10DE
    Device ID:      0x1FB8
    Device Name:    Quadro T2000
    Driver Version: 1846837248
=======================================================
[vertex] device-local=true:/usr/include/c++/10/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = vk::Image; _Alloc = std::allocator<vk::Image>; std::vector<_Tp, _Alloc>::reference = vk::Image&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
arcivanov commented 4 years ago

vkcube/pp run fine:

bash-5.0$ ENABLE_PRIMUS_LAYER=1 optirun vkcube
PrimusVK: Searching for display GPU:
PrimusVK: 0x562a943061c0: 
PrimusVK: 0x562a943061f0: 
PrimusVK: Got integrated gpu!
PrimusVK: Device: Intel(R) UHD Graphics 630 (CFL GT2)
PrimusVK:   Type: 1
PrimusVK: Searching for render GPU:
PrimusVK: 0x562a943061c0.
PrimusVK: Got discrete gpu!
PrimusVK: Device: Quadro T2000
PrimusVK:   Type: 2
PrimusVK: fetching dispatch for 0x562a944ed080
PrimusVK: Creating display device finished!: 0
PrimusVK: fetching dispatch for 0x562a94428ff0
PrimusVK: CreateDevice done
PrimusVK: Application requested 3 images.
PrimusVK: Creating Swapchain for size: 500x500
PrimusVK: MinImageCount: 3
PrimusVK: fetching device for: 0x562a94428ff0
PrimusVK: FamilyIndexCount: 0
PrimusVK: Dev: 0x562a944ed080
PrimusVK: Swapchainfunc: 0x7f3bd26f6f90
PrimusVK: >> Swapchain create done 0;0x562a944212b0
PrimusVK: Image aquiring: 3
PrimusVK: Selected render mem: 9;7 display: 0
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating image: 500x500
PrimusVK: Creating a Swapchain thread.
PrimusVK: Count: 3
PrimusVK: >> Destroy swapchain: 0x562a944212b0
felixdoerre commented 4 years ago

Hi, I've checked vkmark and tried this locally and yes, this is a bug in primus_vk. I corrected it in the current master. The bug was triggered by the mailbox presentation mode that is selected by vkmark and is probably not that often selected by games and other applications. With the corrected version vkmark works on my system. Does it work for you now?

arcivanov commented 4 years ago

Works for me, thanks!