canonical / steam-snap

Steam as a snap
75 stars 9 forks source link

`snap run steam.vulkaninfo` fails #246

Open techtonik opened 1 year ago

techtonik commented 1 year ago
$ snap run steam.vulkaninfo
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /var/lib/snapd/lib/vulkan/icd.d/nvidia_icd.json
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
ERROR at ./vulkaninfo/vulkaninfo.h:230:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED

Environment

snap run steam.report

os_release: 
    name:               "Ubuntu"
    version:            "23.04 (Lunar Lobster)"
snap_info: 
    steam_revision:     154
    snapd_revision:     
lspci: 
    01:00.0:            NVIDIA Corporation GK106 [GeForce GTX 650 OEM] (rev a1)
glxinfo: 
    gpu:                NVE6
    gpu_version:        4.3 (Core Profile) Mesa 23.1.1 - kisak-mesa PPA
lscpu: 
    model_name:         AMD Athlon(tm) X4 740 Quad Core Processor
xdg_current_desktop:    i3
desktop_session:        i3
ashuntu commented 1 year ago

This should have been fixed by https://github.com/canonical/steam-snap/pull/242

Do you have hardware-observe and system-observe connected? snap connections steam

(also, in the future, please reopen the original issue (#241) instead of creating a brand new issue)

techtonik commented 1 year ago

@ashuntu #242 fixes #241. Now the error message is different and it's not fixed.

$ snap info steam
name:      steam
summary:   Launcher for the Steam software distribution service
publisher: Canonical✓
store-url: https://snapcraft.io/steam
contact:   https://github.com/canonical/steam-snap
license:   unset
description: |
  Steam is a software distribution service with an online store, automated
  installation, automatic updates, achievements, SteamCloud synchronized
  savegame and screenshot functionality, and many social features.
commands:
  - steam.glxgears
  - steam.glxinfo
  - steam.report
  - steam
  - steam.test
  - steam.vkcube
  - steam.vulkaninfo
snap-id:      NeoQngJVBf2wKC48bxnF2xqmfEFGdVnx
tracking:     latest/edge
refresh-date: 9 days ago, at 00:59 +03
channels:
  latest/stable:    1.0.0.76 2023-06-01 (146) 188MB -
  latest/candidate: 1.0.0.76 2023-06-01 (150) 191MB -
  latest/beta:      1.0.0.75 2022-12-05  (83) 388MB -
  latest/edge:      1.0.0.76 2023-06-09 (154) 191MB -
installed:          1.0.0.76            (154) 191MB -
$ snap connections steam
Interface               Plug                          Slot                                Notes
audio-playback          steam:audio-playback          :audio-playback                     -
audio-record            steam:audio-record            -                                   -
bluez                   steam:bluez                   -                                   -
content[gaming-mesa]    steam:gaming-mesa             gaming-graphics-core22:gaming-mesa  -
content[gtk-3-themes]   steam:gtk-3-themes            gtk-common-themes:gtk-3-themes      -
content[icon-themes]    steam:icon-themes             gtk-common-themes:icon-themes       -
content[sound-themes]   steam:sound-themes            gtk-common-themes:sound-themes      -
desktop                 steam:desktop                 :desktop                            -
desktop-legacy          steam:desktop-legacy          :desktop-legacy                     -
fuse-support            steam:fuse-support            -                                   -
gsettings               steam:gsettings               :gsettings                          -
hardware-observe        steam:hardware-observe        :hardware-observe                   manual
home                    steam:home                    :home                               -
joystick                steam:joystick                :joystick                           -
mount-observe           steam:mount-observe           -                                   -
network                 steam:network                 :network                            -
network-bind            steam:network-bind            :network-bind                       -
network-control         steam:network-control         -                                   -
opengl                  steam:opengl                  :opengl                             -
personal-files          steam:dot-local-share-steam   -                                   -
process-control         steam:process-control         -                                   -
removable-media         steam:removable-media         :removable-media                    -
screen-inhibit-control  steam:screen-inhibit-control  :screen-inhibit-control             -
shared-memory           steam:shmem                   :shared-memory                      -
steam-support           steam:steam-support           :steam-support                      -
system-observe          steam:system-observe          :system-observe                     manual
uinput                  steam:uinput                  :uinput                             -
upower-observe          steam:upower-observe          :upower-observe                     -
wayland                 steam:wayland                 :wayland                            -
x11                     steam:x11                     :x11                                -
techtonik commented 1 year ago

@ashuntu any news about malfunctioning vulcan with latest edge?

ashuntu commented 1 year ago

vulkaninfo still runs on my machine just fine it seems. I wonder if switching gaming-graphics-core22 channels changes your output at all? snap refresh gaming-graphics-core22 --channel <oibaf-latest|kisak-fresh|kisak-turtle> (make sure you use the stable versions of each channel, candidate is for testing new builds).

techtonik commented 1 year ago

kisak-fresh/stable doesn't work (output is above).

kisak-turtle/stable doesn't work.

❯ sudo snap refresh gaming-graphics-core22 --channel kisak-turtle/stable
gaming-graphics-core22 (kisak-turtle/stable) 23.0.4~kisak1~j from Canonical✓ refreshed

~ 21m 1s
❯ snap run steam.vulkaninfo
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /var/lib/snapd/lib/vulkan/icd.d/nvidia_icd.json
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
ERROR at ./vulkaninfo/vulkaninfo.h:230:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED

oibaf-latest/stable doesn't work.

❯ sudo snap refresh gaming-graphics-core22 --channel oibaf-latest/stable
gaming-graphics-core22 (oibaf-latest/stable) 23.2~git2306120600.926e97~oibaf~ from Canonical✓ refreshed

~ 1m 43s
❯ snap run steam.vulkaninfo
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /var/lib/snapd/lib/vulkan/icd.d/nvidia_icd.json
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
ERROR at ./vulkaninfo/vulkaninfo.h:230:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED

vulkaninfo without snap works.

❯ vulkaninfo
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.239

Instance Extensions: count = 21
===============================
    VK_EXT_acquire_drm_display             : extension revision 1
    VK_EXT_acquire_xlib_display            : extension revision 1
...

@ashuntu

techtonik commented 1 year ago

@ashuntu any hints on how to troubleshoot this further?

techtonik commented 1 year ago

Current latest/edge gives this.

Traceback (most recent call last):
  File "/snap/steam/160/bin/nvidia32", line 3, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /var/lib/snapd/lib/vulkan/icd.d/nvidia_icd.json
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
ERROR at ./vulkaninfo/vulkaninfo.h:230:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED
hifron commented 1 year ago

I think that correct approach should be for Steam to report any errors with drivers it find(currently only on Help->Steam Client Runtime Diagnostic) and report to user via some Warning Message or Signage that something is broken with its drivers.

It could be on main Steam interface or maybe on System Information that something System Wide has problems and maybe only on Steam Linux(but may be present also on Linux Steam non-snap that something like x11/vaapi missing)...

But snap version is just for that and there are LTS or one non-LTS supported...

hifron commented 1 year ago

Steam is also Chrome based and Chrome currently under Linux has hw accel problems which also some advanced WebGPU progress on Chrome Linux could be tested on webgpu.io.

Steam snap file also has a lot of dependencies and I think that 1:1 relationship in .deb for snapfile and maybe 24.04 Wayland progress with automatic X11/Wayland like ozoneplatform, but this is longer game.

Binding for graphic drivers when there could be other possible packages with problems like Chrome/Chromium(there are also private Github repos making Snapcraft push build a possible or there could be some API push :-), but making a script which fills required deps into deb and then maybe also write it for snap spec(think human copy/paste robot :-) and also automatically write those binding graphic file libs specs(maybe from gaming-graphics-22 snap) or somehow uses it with snapcraft build support(like now Intel offloading for NVidia possible)?

Thinking that manually writing all those missing libs in snap config is too silly, but could be also done by Steam and tested by Canonical and steam meanwhile be present only via beta flag if is not prepared and so well tested which is maybe problem, but those graphic problems should not be so huge only for Snap package...

shadywack commented 11 months ago

[Edit] Rolling back to 535 drivers corrected this for me.

Showstopper for me on this issue when running nVidia 545 drivers, for some reason Steam can't see my vulkan infrastructure and I get the exact behavior listed above.

Ubuntu 23.10 nVidia 545 drivers from the graphics team PPA Steam installed from app center, snap version.

Ryzen 5800X3D nVidia 3080 10GB

No games run.

techtonik commented 11 months ago

I believe Steam needs i386 libs, which I don't have. It probably tries to give a proper error message, but the check is not properly implements, so newer snap fails with this.

$ snap run steam.vulkaninfo
update.go:85: cannot change mount namespace according to change mount (/var/lib/snapd/hostfs/boot /boot none bind,ro 0 0): permission denied
Traceback (most recent call last):
  File "/snap/steam/171/bin/nvidia32", line 3, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'
ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file /var/lib/snapd/lib/vulkan/icd.d/nvidia_icd.json
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs:  Failed to detect any valid GPUs in the current config
ERROR: [Loader Message] Code 0 : setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
ERROR at ./vulkaninfo/vulkaninfo.h:230:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED
steam-runtime-launcher-service: no process found
hifron commented 11 months ago

Upgrading to edge steam and snapd may solve this due some weird bugs, but that's not for me. Steam on edge may not be so problem when there are a lot of ongoing fixes from various games, but unstable snapd on edge channel? Maybe they are waiting for 24.04 or something but I think that making Steam more stable when fixes are awaited and broking something seems not so big problem currently...

ashuntu commented 2 months ago

Errors like ModuleNotFoundError: No module named 'gi' are generally red herrings and can usually be resolved with sudo /usr/lib/snapd/snap-discard-ns steam or a reboot.

As for the actual issue, make sure you have both 64 and 32 bit graphics drivers installed. For example on NVIDIA, you may need to manually install 32-bit graphics drivers alongside your 64-bit drivers (this is the same requirement the Steam deb has). Failing that, if not already, this may work now with 2.64 snapd. You can try by refreshing snapd with snap refresh snapd --edge (and restarting). Make sure to go back to stable after testing with snap refresh snapd --stable.