VkLayer_MESA_device_select can cause containers.py test failure
On my X280 running Debian testing/unstable, tests/pressure-vessel/containers.py
is currently failing as a result of upgrading Mesa to a version where VkLayer_MESA_device_select and lavapipe are included.
To reproduce
- Debian unstable, up to date as of 2021-01-05
-
mesa-vulkan-drivers:amd64
and:i386
installed - Intel iGPU (UHD Graphics 620, KBL GT2)
- lavapipe driver also enabled
- steam-runtime-tools commit cf41c83a
- Configured with
-Dtest_containers_dir=/path/to/SteamLinuxRuntime/depot
- A pressure-vessel relocatable build, done under scout, is installed in
/path/to/SteamLinuxRuntime/depot/pressure-vessel
- Command used to reproduce:
AUTOPKGTEST_ARTIFACTS=$(pwd)/_build/host/artifacts PRESSURE_VESSEL_VERBOSE=1 G_MESSAGES_DEBUG=all meson test -C _build/host
-
_build/host/artifacts/host-srsi.json
says:-
Intel(R) UHD Graphics 620 (KBL GT2)
was enumerated first by*-linux-gnu-vulkaninfo
forx11/vulkan
, in both word sizes - Order of
vulkan
->icds
:- /usr/share/vulkan/icd.d/intel_icd.x86_64.json (iGPU)
- /usr/share/vulkan/icd.d/lvp_icd.x86_64.json (lavapipe)
- /usr/share/vulkan/icd.d/radeon_icd.x86_64.json (not used)
- /usr/share/vulkan/icd.d/intel_icd.i686.json (iGPU)
- /usr/share/vulkan/icd.d/lvp_icd.i686.json (lavapipe)
- /usr/share/vulkan/icd.d/radeon_icd.i686.json (not used)
-
- In the pressure-vessel debug log, the drivers are consistently enumerated in that same order, which I assume is
readdir()
order.#0
is the 64-bit iGPU,#1
is the 64-bit lavapipe, ...,#5
is the 32-bit Radeon. - In the pressure-vessel debug log,
VK_ICD_FILENAMES
is consistently set with0-x86_64-linux-gnu.json
first, ...,5-i386-linux-gnu.json
last.
Expected result
GPUs are enumerated in the container in the same order as on the host system (whatever that is). In my case, that means *-linux-gnu-vulkaninfo
inside the container should list the iGPU before the lavapipe software renderer.
Actual result
Despite VkLayer_MESA_device_select
apparently being imported into the container successfully, *-linux-gnu-vulkaninfo
inside the container (both soldier and scout) enumerates the lavapipe software GPU first. This is a mismatch between the behaviour outside and inside the container, causing the test to fail.
Workaround
Test with NODEVICE_SELECT=1
in the environment.
Out of scope
Vulkan device enumeration is done in readdir()
order, although VkLayer_Mesa_device_select
subsequently reshuffles it. We do not attempt to change any of that: whatever arbitrary order we get from the OS, we present the same arbitrary order to the application.