FS#74211 - [vulkan-icd-loader] Update 1.3.207-1 and above break NvFBC

Attached to Project: Arch Linux
Opened by Mal Haak (insanemal) - Wednesday, 23 March 2022, 15:58 GMT
Last edited by Laurent Carlier (lordheavy) - Wednesday, 28 June 2023, 11:57 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Laurent Carlier (lordheavy)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
After updating vulkan-icd-loader and vulkan-tools to update 1.3.207 or above NvFBC support is totally broken. With Tesla cards or patched drivers on GTX cards.


Steps to reproduce:
Have NVIDIA driver installed
Have OBS/Sunshine installed
Try and use NvFBC
Get "invalid external buffer capabilities" errors
This task depends upon

Closed by  Laurent Carlier (lordheavy)
Wednesday, 28 June 2023, 11:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  Since Nvidia-510.68.02-1
Comment by Dmitry Skvortsov (Iglu47) - Friday, 25 March 2022, 16:17 GMT
I also met this problem.
It occurs between versions 1.2.203 and 1.3.204 of vulkan-icd-loader.
So I made bisecting test.
first bad commit: https://github.com/KhronosGroup/Vulkan-Loader/commit/232c6977d2017442dec6abe78fd62222f8d0a333
(part of: https://github.com/KhronosGroup/Vulkan-Loader/pull/779)
Comment by Dmitry Skvortsov (Iglu47) - Friday, 25 March 2022, 16:43 GMT
I went ahead and made the patch for vulkan-icd-loader-1.3.208 (helps on my local machine at least)
Comment by Dmitry Skvortsov (Iglu47) - Friday, 25 March 2022, 17:57 GMT Comment by Dmitry Skvortsov (Iglu47) - Thursday, 31 March 2022, 15:19 GMT
So, after some research, we managed to fully understand what the problem is.
As far as I understand, the problem is that libnvidia-fbc during initialization reports the minimum vulkan api 1.0.0, but after that it requests layers, which are supported starting only from vulkan api 1.1. And the issue only became known when vk-loader made some checks more precise (probably to properly match the vulkan api spec). Apparently there will be some more similar cases with the minimum apiVersion.
But a fix on the application side (driver in this case) would be more preferable, since more strict compliance with the requirements of the vulkan api specifications.

For now, the better solution is to increase the apiVersion that libnvidia-fbc tells vulkan on initialization.
In theory, changing to 1.1 should be safe since 510 versions of the driver should already support vulkan 1.3 (but for obvious reasons, only the nvidia developers can guarantee that this change alone is enough, besides, a similar situation may be in some other files)
This fix should be enough (I tested it on version 510.60.02, but libnvidia-fbc.so doesn't seem to change that often, so it might work on some previous versions as well.):
sudo sed -i 's/\xc7\x84\x24\xfc\x01\x00\x00\x00\x00\x40\x00/\xc7\x84\x24\xfc\x01\x00\x00\x00\x10\x40\x00/' "/usr/lib/libnvidia-fbc.so"

more info: https://github.com/KhronosGroup/Vulkan-Loader/issues/894

looks like some fixes for linux will be in 1.3.210 version, but the problem described above is related to nvidia-utils (or other packages with libnvidia-fbc.so file)
Comment by Dmitry Skvortsov (Iglu47) - Tuesday, 26 April 2022, 16:07 GMT
Fixed an issue where NvFBC was requesting Vulkan 1.0 while using Vulkan 1.1 core features. This caused NvFBC to fail to initialize with Vulkan loader versions 1.3.204 or newer.
https://www.nvidia.com/Download/driverResults.aspx/187526/en-us

fixed in 510.68.02

Loading...