Bug#983390: mesa-vulkan-drivers: bad interactions between VkLayer_MESA_device_select and other layers

2021-07-22 Thread googlemail
Recently, Mesa 20.3.5-1 was unblocked for Bullseye, and has resolved 
most issues I had encountered since upgrading from Buster on a test setup.


The notable exception is MangoHud on 32 bit Windows applications in 
Wine, which still dies rather silently on launch. Although not in all 
cases, since for example very old games that won't touch Vulkan at all 
and run completely through OpenGL work fine.


This still needs the workaround of either setting VK_ICD_FILENAMES 
appropriately, or making /usr/share/vulkan/icd.d/lvp_icd.i686.json 
unavailable.


I tested this with both MangoHud 0.6.1 (i386) from current Bullseye, and 
the upstream binary 0.6.5 release, same behaviour respectively.


But I'm unqualified to tell if this is still a Mesa issue, or needs to 
be resolved in MangoHud.


Still a massive improvement from 20.3.4-1, so big thanks anyway :-)



Bug#983390: mesa-vulkan-drivers: bad interactions between VkLayer_MESA_device_select and other layers

2021-06-11 Thread kolafl...@kolahilft.de
On Thu, 25 Mar 2021 11:51:22 + Simon McVittie  
wrote:

Version: 21.0.0-1

On Thu, 25 Mar 2021 at 11:46:36 +, Simon McVittie wrote:
> This appears to be fixed in the new upstream 20.3.5 release (and also
> in 21.0.0).


This might be related.
https://bugs.winehq.org/show_bug.cgi?id=51081#c8

In any case it's also fixed by upstream 20.3.5-1
So it would be helpful to include Mesa-20.3.5-1 into Bullseye.


Regards,
kolAflash



OpenPGP_signature
Description: OpenPGP digital signature


Bug#983390: mesa-vulkan-drivers: bad interactions between VkLayer_MESA_device_select and other layers

2021-03-09 Thread Simon McVittie
On Tue, 23 Feb 2021 at 12:20:08 +, Simon McVittie wrote:
> The device selection layer in Mesa 20.3.x >= 20.3.4 and 21.0.x >= 21.0.0~rc2
> has problematic interactions with other Vulkan layers, in particular
> MangoHUD. The bad interactions seem to be relatively complicated (dependent
> on other components), and particularly likely to be triggered when using
> Wine with DXVK.
...
> The attached patch from upstream appears to resolve this. I'm talking to
> an upstream Mesa maintainer about getting this into point releases, but
> it would also be great if you could make sure this gets into Debian 11.0.

A follow-up fix for this seems to be needed to avoid regressions:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9462

smcv



Bug#983390: mesa-vulkan-drivers: bad interactions between VkLayer_MESA_device_select and other layers

2021-02-23 Thread Simon McVittie
Package: mesa-vulkan-drivers
Version: 20.3.4-1
Severity: important
Tags: patch fixed-upstream
Forwarded: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3801
Control: found -1 21.0.0~rc2-1

The device selection layer in Mesa 20.3.x >= 20.3.4 and 21.0.x >= 21.0.0~rc2
has problematic interactions with other Vulkan layers, in particular
MangoHUD. The bad interactions seem to be relatively complicated (dependent
on other components), and particularly likely to be triggered when using
Wine with DXVK.

In Steam's Proton compatibility tool (Wine + DXVK) this seems to manifest
as a game not starting, rather than as a crash - although maybe this is
really a behind-the-scenes component like winedevice.exe crashing.

The attached patch from upstream appears to resolve this. I'm talking to
an upstream Mesa maintainer about getting this into point releases, but
it would also be great if you could make sure this gets into Debian 11.0.

I can reproduce this with 20.3.4-1, and it can be resolved by rebuilding
20.3.4 with this patch and overwriting both word-sizes' versions of
/usr/lib/*-linux-gnu/libVkLayer_MESA_device_select.so. Unfortunately, my
only reliable reproducer is far from minimal:

* Debian testing
* Install mesa-vulkan-drivers:amd64, mesa-vulkan-drivers:i386,
  mangohud:amd64, mangohud:i386 and Steam
* In Steam, install some games, and force them to use the Proton 5.13
  compatibility tool so that you get the Windows version instead of any
  native Linux version that might exist.
  I used Life Is Strange (32-bit) and Life Is Strange 2 (64-bit) which
  are available at no cost.
* Opt in to the beta branch of the "Steam Linux Runtime - soldier"
  container tool. This fixes a bug that hid this one by not always
  enabling MangoHUD successfully.
* Run Steam with MANGOHUD=1 in the environment
* Launch each game in turn
* Good result: The games launch, and have the MangoHUD fps display showing
* Bad result: The games don't start; `top` shows intermittent activity
  from winedevice.exe

I haven't yet verified that the Mesa in experimental also has this bug,
but from the git history, versions >= 21.0.0~rc2-1 are likely to have it,
and I've had reports of the same issue in 21.0.0~rc4 and ~rc5 in
non-Debian distros.

Thanks,
smcv
From: Bas Nieuwenhuizen 
Date: Mon, 11 Jan 2021 15:20:40 +0100
Subject: vulkan/device_select: Stop using device properties 2.

We have to choose between:
1) Stop handling two identical GPUs
2) Stop having crashes with other layers active.
3) Fix the Vulkan Loader.

Since nobody seems to want to spend enough effort to do 3 the
effective choice is between 1 and 2. This is choosing 2, as
two identical GPUs is pretty uncommon since crossfire doesn't
work on Linux anyway.

(And it would only work sporadically as the game needs to enable the
 extension)

CC: mesa-stable
Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3801
Reviewed-by: Dave Airlie 
Part-of: 
Origin: upstream, 21.1, commit:38ce8d4d00c2b0e567b6dd36876cf171acb1dbc7
---
 .../device-select-layer/device_select_layer.c  | 30 +-
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/vulkan/device-select-layer/device_select_layer.c b/src/vulkan/device-select-layer/device_select_layer.c
index c381ac3..134a3bd 100644
--- a/src/vulkan/device-select-layer/device_select_layer.c
+++ b/src/vulkan/device-select-layer/device_select_layer.c
@@ -51,8 +51,8 @@ struct instance_info {
PFN_GetPhysicalDeviceProcAddr  GetPhysicalDeviceProcAddr;
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
-   PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR;
-   bool has_props2, has_pci_bus;
+   PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
+   bool has_pci_bus, has_vulkan11;
bool has_wayland, has_xcb;
 };
 
@@ -150,8 +150,6 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate
}
 
for (unsigned i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
-  if (!strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME))
- info->has_props2 = true;
 #ifdef VK_USE_PLATFORM_WAYLAND_KHR
   if (!strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME))
  info->has_wayland = true;
@@ -162,6 +160,14 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate
 #endif
}
 
+   /*
+* The loader is currently not able to handle GetPhysicalDeviceProperties2KHR calls in
+* EnumeratePhysicalDevices when there are other layers present. To avoid mysterious crashes
+* for users just use only the vulkan version for now.
+*/
+   info->has_vulkan11 = pCreateInfo->pApplicationInfo &&
+pCreateInfo->pApplicationInfo->apiVersion >=