The Linux graphics stack in a nutshell, part 1
The Linux graphics stack in a nutshell, part 1
Posted Dec 20, 2023 14:42 UTC (Wed) by makendo (guest, #168314)In reply to: The Linux graphics stack in a nutshell, part 1 by adobriyan
Parent article: The Linux graphics stack in a nutshell, part 1
Lavapipe should identify itself as a software renderer (VK_PHYSICAL_DEVICE_TYPE_CPU), which can help a lot in kicking it away.
Posted Dec 23, 2023 13:39 UTC (Sat)
by adobriyan (subscriber, #30858)
[Link] (2 responses)
Enumerate queue family properties, at least one of them will be able to present to the window surface
All other GPUs driving or not driving other X servers will not be able to Present to the surface.
Which is good enough.
qfp 0 G 1, P 0 <= no cookie
qfp 0 G 1, P 1 <= GPU which shows the window
I must say, this is simple and not simple at the same time. Every single tutorial assumes 1 GPU.
Posted Dec 23, 2023 13:52 UTC (Sat)
by adobriyan (subscriber, #30858)
[Link] (1 responses)
# 1070 (active)
# 1030 (passive)
(lavapipe)
Enumeration order varies by distro too!
Posted Feb 2, 2024 8:34 UTC (Fri)
by daenzer (subscriber, #7050)
[Link]
The enumeration order isn't well-defined, and in practice partially depends on the order in which the filesystem enumerates the corresponding *_icd.*.json files (which isn't well-defined either). So the order may differ between otherwise mostly identical systems with the same set of VkPhysicalDevices, and may change after modifications to the *_icd.*.json files.
Unfortunately, many (most?) Vulkan applications just use the first enumerated device by default. To prevent such apps from accidentally using an undesirable device such as a lavapipe one, Mesa ships a device selection layer which moves the "default" device to be enumerated first.
The Linux graphics stack in a nutshell, part 1
(vkGetPhysicalDeviceSurfaceSupportKHR will report Supported == VK_TRUE).
qfp 1 G 0, P 0
qfp 2 G 0, P 0
qfp 3 G 0, P 0
qfp 1 G 0, P 0
qfp 2 G 0, P 1
qfp 3 G 0, P 0
The Linux graphics stack in a nutshell, part 1
qfp 0 G 1, P 1 ***
qfp 1 G 0, P 0
qfp 2 G 0, P 1
qfp 3 G 0, P 0
qfp 0 G 1, P 0
qfp 1 G 0, P 0
qfp 2 G 0, P 0
qfp 3 G 0, P 0
qfp 0 G 1, P 1 *** # P=1 !!!
-p 0 NVIDIA GeForce GTX 1070
-p 1 NVIDIA GeForce GT 1030
-p 2 llvmpipe (LLVM 16.0.6, 256 bits)
The Linux graphics stack in a nutshell, part 1
