Repository navigation
Closed
Labels
Description
Checklist
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
- If this is an issue with a particular app, I have tried filing it in the appropriate issue tracker for the app (e.g. under https://github.com/flathub/) and determined that it is an issue with Flatpak itself.
- This issue is not a report of a security vulnerability (see here if you need to report a security issue).
Flatpak version
1.12.7
What Linux distribution are you using?
Ubuntu
Linux distribution version
22.04.1 LTS
What architecture are you using?
x86_64
How to reproduce
I can not get Vulkan to work under flatpak. This affects Steam, and the VulkanInfo tool.
This is obviously a problem with how flatpak handles system files, and does not expose them to the sandbox environment.
$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json flatpak run org.freedesktop.Platform.VulkanInfo
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /usr/share/vulkan/icd.d/radeon_icd.i686.json
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /usr/share/vulkan/icd.d/radeon_icd.x86_64.json
ERROR: [Loader Message] Code 0 : vkCreateInstance: Found no drivers!
Cannot create Vulkan instance.
This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
ERROR at /buildstream/freedesktop-sdk/extensions/vulkaninfo/vulkan-tools.bst/vulkaninfo/vulkaninfo.h:672:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVE
Even trying to expose the host files does not work.
$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json flatpak run --filesystem=host org.freedesktop.Platform.VulkanInfo
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /usr/share/vulkan/icd.d/radeon_icd.x86_64.json
ERROR: [Loader Message] Code 0 : vkCreateInstance: Found no drivers!
Cannot create Vulkan instance.
This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
ERROR at /buildstream/freedesktop-sdk/extensions/vulkaninfo/vulkan-tools.bst/vulkaninfo/vulkaninfo.h:672:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER
$ cat /usr/share/vulkan/icd.d/radeon_icd.x86_64.json
{
"ICD": {
"api_version": "1.3.204",
"library_path": "/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so"
},
"file_format_version": "1.0.0"
}
$ ls -las /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so
6764 -rw-r--r-- 1 root root 6924848 jul 6 08:37 /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so
Expected Behavior
Having VulkanInfo actually work, showing something like this:
$ vulkaninfo
==========
VULKANINFO
==========
Vulkan Instance Version: 1.3.204
Instance Extensions: count = 19
===============================
VK_EXT_acquire_drm_display : extension revision 1
VK_EXT_acquire_xlib_display : extension revision 1
VK_EXT_debug_report : extension revision 10
VK_EXT_debug_utils : extension revision 2
VK_EXT_direct_mode_display : extension revision 1
VK_EXT_display_surface_counter : extension revision 1
VK_KHR_device_group_creation : extension revision 1
VK_KHR_display : extension revision 23
VK_KHR_external_fence_capabilities : extension revision 1
VK_KHR_external_memory_capabilities : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
\/\/\/\/\/\/\/\/\/\/\/\/\/\
vulkanMemoryModel = true
vulkanMemoryModelDeviceScope = true
vulkanMemoryModelAvailabilityVisibilityChains = false
VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR:
---------------------------------------------------------
workgroupMemoryExplicitLayout = true
workgroupMemoryExplicitLayoutScalarBlockLayout = true
workgroupMemoryExplicitLayout8BitAccess = true
workgroupMemoryExplicitLayout16BitAccess = true
VkPhysicalDeviceYcbcrImageArraysFeaturesEXT:
--------------------------------------------
ycbcrImageArrays = true
VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures:
------------------------------------------------------
shaderZeroInitializeWorkgroupMemory = true
Actual Behavior
VulkanInfo does not work.
Additional Information
I have even tried to unset the VK_ICD_FILENAMES variable, and then running VulkanInfo, but to the same result.
Any help would be appreciated, Workarounds or otherwise.
Activity
okseb commentedon Oct 7, 2022
It seems like this issue is affecting the Unreal Engine install within the Epic Asset Manager Flatpak it was telling me it couldn't find Vulkan drivers on my system even though it worked before.
gegoxaren commentedon Oct 7, 2022
Seems a reboot and unset:ing the
VK_ICD_FILENAMESnow works. Don't know why.I'm sorry for making you read all that.
Sincerely,
Gustav.
ninja- commentedon Feb 15, 2024
Maybe we can reopen? Looks like FlatPak, or the freedesktop SDK is not compliant in some way with the default Vulkan loader, for example shipped by Chrome.
None of these directories are valid, however /usr/lib/x86_64-linux-gnu/GL/vulkan/implicit_layer.d is...
Allows Chrome to see vulkan (within it's capability, which is limited for now to X11 without Wayland)
smcv commentedon Feb 15, 2024
This is a Chrome issue or a freedesktop SDK issue, depending how you look at it. Either way, it is not a Flatpak bug.
Flatpak doesn't know anything about Vulkan: all it knows are runtimes and extensions. The structure of the specific extensions used for Vulkan is a freedesktop SDK thing.
The freedesktop SDK assumes that the Vulkan-Loader has had https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/patches/vulkan/vulkan-libdir-path.patch?ref_type=heads applied to it. This is true for the Vulkan-Loader shipped in the freedesktop SDK itself.
If Chrome is shipping its own vendored copy of Vulkan-Loader that does not have that patch, then there are four possible resolutions:
VK_DRIVER_FILES(the replacement for the deprecatedVK_ICD_FILENAMES) to point to/usr/lib/x86_64-linux-gnu/GL/vulkan/icd.dso that files in that directory will be foundVK_DRIVER_FILESorXDG_DATA_HOMEso that files in that directory will be foundNone of these are Flatpak changes. If Flatpak made similar changes, it would break runtimes that do not have the same structure as the freedesktop SDK.