Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retroarch AppImage does not start with video driver set to vulkan on Linux/mesa/RADV #13714

Open
ghost opened this issue Mar 8, 2022 · 14 comments

Comments

@ghost
Copy link

ghost commented Mar 8, 2022

Description

With video_driver = "vulkan" set Retroarch immediately crashes, it does not even start.

Vulkan works with literally everything else on my system.

Expected behavior

Retroarch starts.

Actual behavior

It crashes.

Steps to reproduce the bug

  1. Be running a Linux system, possibly specific to AMD GPUs and mesa
  2. Run the AppImage
  3. Set video driver to vulkan
  4. Try running Retroarch again

Bisect Results

Version/Commit

This happens on latest 2022-03-08 nightly and 1.9.14 stable, I have not tried any older.

Environment information

  • OS: Arch Linux x86_64
  • GPU: 5500XT
  • Driver: Mesa 22.1.0
[INFO] RetroArch 1.10.1 (Git 9bcee06)
[INFO] === Build =======================================
[INFO] CPU Model Name: AMD Ryzen 5 3600 6-Core Processor              
[INFO] Capabilities:  MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX
[INFO] Built: Mar  8 2022
[INFO] Version: 1.10.1
[INFO] Git: 9bcee06
[INFO] =================================================
[INFO] [Input]: Found input driver: "x".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [Video]: Set video size to: 960x720.
[ERROR] [Wayland/Vulkan]: Failed to connect to Wayland server.
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[ERROR] [Vulkan]: Could not find instance extensions. Will attempt without them.
[ERROR] Failed to create Vulkan instance (-9).
[INFO] [Vulkan]: Vulkan dynamic library loaded.
[ERROR] [Vulkan]: Could not find instance extensions. Will attempt without them.
[ERROR] Failed to create Vulkan instance (-9).
[ERROR] [Vulkan]: Failed to create Vulkan context.
[WARN] Failed to bind API (#9, version 1.0) on context driver "wayland".
[WARN] Failed to bind API (#9, version 1.0) on context driver "x".
[WARN] Failed to bind API (#9, version 1.0) on context driver "egl_x".
[WARN] Failed to bind API (#9, version 1.0) on context driver "kms".
[WARN] Failed to bind API (#9, version 1.0) on context driver "gl_sdl".
[INFO] [Vulkan]: Found vulkan context: "null".
[INFO] [Vulkan]: Detecting screen resolution: 320x240.
[INFO] [Vulkan]: Using resolution 320x240.
[ERROR] [Vulkan]: Failed to get context data.
[ERROR] [Video]: Cannot open video driver ... Exiting ...
[ERROR] Fatal error received in: "video_driver_init_internal()"
[INFO] [Core]: Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[INFO] [Core]: Unloading core..
[INFO] [Core]: Unloading core symbols..
@ghost
Copy link
Author

ghost commented Mar 8, 2022

Also retroarch works fine with video_driver = "vulkan" by simply compiling and running it myself, also works in Steam version.

@ndarilek
Copy link

I hit either this or a similar issue packaging a vulkan-based game, and found this issue when searching for a solution.

One of my players figured out that removing libwayland-client.so.0 from the appimage for my game got it working. I can't easily test this myself, but if there is in fact a libwayland-client.so.0 in this RetroArch build, and if removing/repacking the image fixes this, it might be worth following AppImageCommunity/pkg2appimage#510.

@stuken
Copy link

stuken commented Apr 18, 2022

I've extracted the appimage, dumped the binary into the lib dir and removed libwayland-client.so.0 and retroarch boots correctly under vulkan just as it does from the flatpack and steam builds.

@ruanformigoni
Copy link

Here is a script to re-create the AppImage without the problematic file:

#!/usr/bin/env bash

set -e

mkdir -p workdir

cd workdir

# Get AppImage of retroarch
wget -q --show-progress --progress=bar:noscroll -O retroarch.AppImage "https://github.com/hizzlekizzle/RetroArch-AppImage/releases/download/Linux_LTS_Nightlies/RetroArch-Linux-x86_64-Nightly.AppImage"

chmod +x ./retroarch.AppImage

# Extract
./retroarch.AppImage --appimage-extract

# Erase downloaded appimage
rm retroarch.AppImage

# Erase problematic file
rm squashfs-root/usr/lib/libwayland-client.so.0

# Create AppDir
mv squashfs-root AppDir

# Get appimagetool
wget -q --show-progress --progress=bar:noscroll -O appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage

chmod +x appimagetool

# Create new fixed appimage
./appimagetool AppDir

mv ./*.AppImage ..

cd ..

rm -rf workdir

@ghost
Copy link
Author

ghost commented Sep 22, 2022

wget -q --show-progress --progress=bar:noscroll -O retroarch.AppImage "https://github.com/hizzlekizzle/RetroArch-AppImage/releases/download/Linux_LTS_Nightlies/RetroArch-Linux-x86_64-Nightly.AppImage"

Sus, why are you getting this old AppImage from some random person.

Official is https://buildbot.libretro.com/nightly/linux/x86_64/RetroArch.7z

@Sanaki
Copy link
Contributor

Sanaki commented Sep 22, 2022

That random person is the guy who set up the appimage builds in the first place.

@ruanformigoni
Copy link

wget -q --show-progress --progress=bar:noscroll -O retroarch.AppImage "https://github.com/hizzlekizzle/RetroArch-AppImage/releases/download/Linux_LTS_Nightlies/RetroArch-Linux-x86_64-Nightly.AppImage"

Sus, why are you getting this old AppImage from some random person.

Official is https://buildbot.libretro.com/nightly/linux/x86_64/RetroArch.7z

Hi, this is the first link that appears when you search for retroarch appimages, I didn't know that there were more recent builds. Thanks for pointing this out :)

@casasfernando
Copy link

This is still a problem with version 1.14.0.

Thanks

@gytdoo
Copy link

gytdoo commented Jan 1, 2024

Here is a script to re-create the AppImage without the problematic file:

Still experiencing this issue specifically on the steam deck, so I updated the script to work with the latest nightly build. For some reason this doesn't work with the QT version, but the regular download works fine on vulkan after libwayland-client.so.0 is removed.

#!/usr/bin/env bash

set -e

mkdir -p workdir

cd workdir

# Get AppImage of retroarch
wget -q --show-progress --progress=bar:noscroll "https://buildbot.libretro.com/nightly/linux/x86_64/RetroArch.7z"

7z x RetroArch.7z

mv RetroArch-Linux-x86_64/RetroArch-Linux-x86_64.AppImage RetroArch-Linux-x86_64/RetroArch-Linux-x86_64.AppImage.home/ .

chmod +x ./RetroArch-Linux-x86_64.AppImage

# Extract
./RetroArch-Linux-x86_64.AppImage --appimage-extract

# Erase downloaded appimage
rm RetroArch-Linux-x86_64.AppImage

# Erase problematic file
rm squashfs-root/usr/lib/libwayland-client.so.0

# Create AppDir
mv squashfs-root AppDir

# Get appimagetool
wget -q --show-progress --progress=bar:noscroll -O appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage

chmod +x appimagetool

# Create new fixed appimage
./appimagetool AppDir

mv RetroArch-Linux-x86_64.AppImage.home RetroArch-x86_64.AppImage.home

mv ./*.AppImage RetroArch-x86_64.AppImage.home ..

cd ..

rm -rf workdir

And I've been using the lower script to update. Just run it from the same directory the AppImage is in. Conveniently they have an update 7z file available, so this doesn't overwrite any configs. All it does is extract the archive, patch the new AppImage, and overwrite it on top of old files in the retroarch directory with any new ones.

#!/usr/bin/env bash

set -e

mkdir -p workdir

cd workdir

# Get AppImage of retroarch
wget -q --show-progress --progress=bar:noscroll "https://buildbot.libretro.com/nightly/linux/x86_64/RetroArch_update.7z"

7z x RetroArch_update.7z

mv RetroArch-Linux-x86_64/RetroArch-Linux-x86_64.AppImage RetroArch-Linux-x86_64/RetroArch-Linux-x86_64.AppImage.home/ .

chmod +x ./RetroArch-Linux-x86_64.AppImage

# Extract
./RetroArch-Linux-x86_64.AppImage --appimage-extract

# Erase downloaded appimage
rm RetroArch-Linux-x86_64.AppImage

# Erase problematic file
rm squashfs-root/usr/lib/libwayland-client.so.0

# Create AppDir
mv squashfs-root AppDir

# Get appimagetool
wget -q --show-progress --progress=bar:noscroll -O appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage

chmod +x appimagetool

# Create new fixed appimage
./appimagetool AppDir

mv RetroArch-Linux-x86_64.AppImage.home RetroArch-x86_64.AppImage.home

cd ..

cp -R workdir/RetroArch-x86_64.AppImage.home/ .

mv workdir/*.AppImage .

rm -rf workdir

@trotsky40
Copy link

The scripts work for me on the Steam Deck.

@hizzlekizzle Any possibility that this can be done upstream so the user doesn't have to?

@hizzlekizzle
Copy link
Contributor

I believe the problem is that without that file, the appimage won't work on other distros/devices.

@odditude42
Copy link

is it worth simply building two appimages (one with the file, one without), and on the download page indicate which distros each is known to work with?

@miwagner1
Copy link

This is still an issue with the beta steamOS 3.6 for Steam Deck.

@new-penguin
Copy link

Do you have both amdvlk and vulkan-radeon packages installed? That caused issue with me on Arch, even though the Steam version worked, so I had to uninstall amdvlk for RA to work with vulkan enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests