|
|
Subscribe / Log in / New account

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

> There is fake Mesa llvmpipe device lying around too.

Lavapipe should identify itself as a software renderer (VK_PHYSICAL_DEVICE_TYPE_CPU), which can help a lot in kicking it away.


to post comments

The Linux graphics stack in a nutshell, part 1

Posted Dec 23, 2023 13:39 UTC (Sat) by adobriyan (subscriber, #30858) [Link] (2 responses)

The answer seems to be:

Enumerate queue family properties, at least one of them will be able to present to the window surface
(vkGetPhysicalDeviceSurfaceSupportKHR will report Supported == VK_TRUE).

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 1 G 0, P 0
qfp 2 G 0, P 0
qfp 3 G 0, P 0

qfp 0 G 1, P 1 <= GPU which shows the window
qfp 1 G 0, P 0
qfp 2 G 0, P 1
qfp 3 G 0, P 0

I must say, this is simple and not simple at the same time. Every single tutorial assumes 1 GPU.

The Linux graphics stack in a nutshell, part 1

Posted Dec 23, 2023 13:52 UTC (Sat) by adobriyan (subscriber, #30858) [Link] (1 responses)

OK, this is funny. lavapipe is here, ready to help. Filtering by GPU type is required apparently:

# 1070 (active)
qfp 0 G 1, P 1 ***
qfp 1 G 0, P 0
qfp 2 G 0, P 1
qfp 3 G 0, P 0

# 1030 (passive)
qfp 0 G 1, P 0
qfp 1 G 0, P 0
qfp 2 G 0, P 0
qfp 3 G 0, P 0

(lavapipe)
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)

Enumeration order varies by distro too!

The Linux graphics stack in a nutshell, part 1

Posted Feb 2, 2024 8:34 UTC (Fri) by daenzer (subscriber, #7050) [Link]

> Enumeration order varies by distro too!

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.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds