RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    lr-gpsp giving "Illegal Instruction" on Raspberry Pi models 0W, 3B and 4.

    Scheduled Pinned Locked Moved Help and Support
    lr-gpspraspberry pi 0wraspberry pi 3braspberry pi 4
    36 Posts 12 Posters 4.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      corezon
      last edited by corezon

      runcommand.log shows

      Parameters:
      Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-gpsp/gpsp_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Advance Wars 2 - Black Hole Rising (USA).zip" --verbose --appendconfig /dev/shm/retroarch.cfg
      [INFO] RetroArch 1.8.4 (Git 9e25601)
      [INFO] Redirecting save file to "/home/pi/RetroPie/roms/gba/Advance Wars 2 - Black Hole Rising (USA).srm".
      [INFO] Redirecting savestate to "/home/pi/RetroPie/roms/gba/Advance Wars 2 - Black Hole Rising (USA).state".
      [INFO] === Build =======================================
      [INFO] Capabilities:  NEON VFPv3 VFPv4
      [INFO] Built: Feb 18 2020
      [INFO] Version: 1.8.4
      [INFO] Git: 9e25601
      [INFO] =================================================
      [INFO] Loading dynamic libretro core from: "/opt/retropie/libretrocores/lr-gpsp/gpsp_libretro.so"
      [INFO] [Overrides] no core-specific overrides found at /home/pi/.config/retroarch/config/gpSP/gpSP.cfg.
      [INFO] [Overrides] no content-dir-specific overrides found at /home/pi/.config/retroarch/config/gpSP/gba.cfg.
      [INFO] [Overrides] no game-specific overrides found at /home/pi/.config/retroarch/config/gpSP/Advance Wars 2 - Black Hole Rising (USA).cfg.
      [INFO] [Environ]: GET_LOG_INTERFACE.
      [INFO] [Environ]: GET_PERF_INTERFACE.
      [INFO] [Environ]: SET_VARIABLES.
      [INFO] [Remaps]: remap directory: /opt/retropie/configs/gba/
      [INFO] Redirecting save file to "/home/pi/RetroPie/roms/gba/Advance Wars 2 - Black Hole Rising (USA).srm".
      [INFO] Redirecting savestate to "/home/pi/RetroPie/roms/gba/Advance Wars 2 - Black Hole Rising (USA).state".
      [INFO] Content loading skipped. Implementation will load it on its own.
      [INFO] [Environ]: SET_INPUT_DESCRIPTORS:
      [INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
      [INFO] [Environ]: SYSTEM_DIRECTORY: "/home/pi/RetroPie/BIOS".
      [INFO] [RCHEEVOS]: ext_hash 0b88760f ('gba')
      [INFO] Skipping SRAM load..
      [INFO] Version of libretro API: 1
      [INFO] Compiled against API: 1
      [INFO] [RCHEEVOS]: no method for file extension, trying core supported extensions: gba|bin|agb|gbz
      [INFO] [RCHEEVOS]: testing Generic (plain content)
      [INFO] [Cheats]: Load game-specific cheatfile: /home/pi/.config/retroarch/cheats/gpSP/Advance Wars 2 - Black Hole Rising (USA).cht
      [INFO] [Audio]: Set audio input rate to: 65835.00 Hz.
      [INFO] [Video]: Video @ 1280x720
      [INFO] [Video]: Starting threaded video driver ...
      [WARN] [DRM]: Couldn't get device resources.
      [WARN] [DRM]: Couldn't get device resources.
      [INFO] [DRM]: Found 1 connectors.
      [INFO] [DRM]: Connector 0 connected: yes
      [INFO] [DRM]: Connector 0 has 17 modes.
      [INFO] [DRM]: Connector 0 assigned to monitor index: #1.
      [INFO] [DRM]: Mode 0: (1280x720) 1280 x 720, 60 Hz
      [INFO] [DRM]: Mode 1: (1920x1080) 1920 x 1080, 60 Hz
      [INFO] [DRM]: Mode 2: (1920x1080) 1920 x 1080, 60 Hz
      [INFO] [DRM]: Mode 3: (1920x1080) 1920 x 1080, 60 Hz
      [INFO] [DRM]: Mode 4: (1920x1080) 1920 x 1080, 60 Hz
      [INFO] [DRM]: Mode 5: (1920x1080) 1920 x 1080, 30 Hz
      [INFO] [DRM]: Mode 6: (1920x1080) 1920 x 1080, 30 Hz
      [INFO] [DRM]: Mode 7: (1920x1080) 1920 x 1080, 24 Hz
      [INFO] [DRM]: Mode 8: (1920x1080) 1920 x 1080, 24 Hz
      [INFO] [DRM]: Mode 9: (1280x720) 1280 x 720, 60 Hz
      [INFO] [DRM]: Mode 10: (1024x768) 1024 x 768, 60 Hz
      [INFO] [DRM]: Mode 11: (800x600) 800 x 600, 60 Hz
      [INFO] [DRM]: Mode 12: (720x480) 720 x 480, 60 Hz
      [INFO] [DRM]: Mode 13: (720x480) 720 x 480, 60 Hz
      [INFO] [DRM]: Mode 14: (640x480) 640 x 480, 60 Hz
      [INFO] [DRM]: Mode 15: (640x480) 640 x 480, 60 Hz
      [INFO] [DRM]: Mode 16: (720x400) 720 x 400, 70 Hz
      [INFO] [RCHEEVOS]: checking 46599031ef71117c587bd3666c326c07
      [INFO] [GL]: Found GL context: kms
      [INFO] [GL]: Detecting screen resolution 1280x720.
      [INFO] [EGL] Found EGL client version >= 1.5, trying eglGetPlatformDisplay
      [INFO] [EGL]: EGL version: 1.4
      [INFO] [EGL]: Current context: 0xaba015a8.
      [INFO] [KMS]: New FB: 1280x720 (stride: 5120).
      [INFO] [GL]: Vendor: Broadcom, Renderer: V3D 4.2.
      [INFO] [GL]: Version: OpenGL ES 3.1 Mesa 19.3.2.
      [INFO] [GL]: Using resolution 1280x720
      [INFO] [GL]: Default shader backend found: glsl.
      [INFO] [Shaders]: preset directory: /home/pi/.config/retroarch/shaders/presets
      [INFO] [Shader driver]: Using GLSL shader backend.
      [WARN] [GL]: Stock GLSL shaders will be used.
      [INFO] [GLSL]: Found GLSL vertex shader.
      [INFO] [RCHEEVOS]: got game id 2593
      [INFO] [GLSL]: Found GLSL fragment shader.
      [INFO] [GLSL]: Linking GLSL program.
      [INFO] [GLSL]: Found GLSL vertex shader.
      [INFO] [GLSL]: Found GLSL fragment shader.
      [INFO] [GLSL]: Linking GLSL program.
      [INFO] [GLSL]: Found GLSL vertex shader.
      [INFO] [GLSL]: Found GLSL fragment shader.
      [INFO] [GLSL]: Linking GLSL program.
      [INFO] [GL]: Using 4 textures.
      [INFO] [GL]: Loaded 1 program(s).
      [WARN] [udev]: Couldn't open any keyboard, mouse or touchpad. Are permissions set correctly for /dev/input/event*?     [INFO] [udev]: Plugged pad: RetroFlag Wired Controller (1411:8288) on port #0.
      [INFO] [udev]: Pad #0 (/dev/input/event0) supports 0 force feedback effects.
      [INFO] [Autoconf]: 7 profiles found.
      [INFO] [Autoconf]: selected configuration: /home/pi/.config/retroarch/autoconfig/RetroFlag Wired Controller.cfg        [INFO] [Joypad]: Found joypad driver: "udev".
      [INFO] [Font]: Using font rendering backend: stb-unicode.
      [INFO] [Video]: Found display server: null
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/2xsal-level2-crt.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/2xsal.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/2xScaleHQ.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion_lanczos4.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion_phosphor.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/barrel-distortion_snes.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/Brighter-with_Contrast.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/bsnes_gamma_ramp.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/crt-pi-curvature-vertical.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/crt-pi-curvature.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/crt-pi-vertical.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/crt-pi.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/gameboy-screen-grid.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/gameboy.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/gameboy2.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/gba-color.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2x&lcd3x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2x2.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2x_lcd3x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2x_phosphor.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2xwaterpaint.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq2xwaterpaintscanline.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq4x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/hq4x_lcd3x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/nds-color.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/nds.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/nedi.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/palm-color.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/phosphor.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/psp-color.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/sharp-bilinear-2x-prescale.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/sharp-bilinear-scanlines.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/sharp-bilinear-simple.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes2.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_hq2x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_hq2xwaterpaint.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_hq2xwaterpainthicontrast.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_hq2xwaterpaintscanline.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_lcd3x.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_phosphor.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_scanline.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/snes_waterpaint.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/stock.glsl"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/super-2xsai.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/super-eagle.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/vba-color.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/xbr-lv1-noblend.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/zfast_crt_curve.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/zfast_crt_curve_vertical.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/zfast_crt_standard.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/zfast_crt_standard_vertical.glslp"
      [INFO] Found shader "/home/pi/.config/retroarch/shaders/zfast_lcd_standard.glslp"
      [INFO] [ALSA]: Using signed 16-bit format.
      [INFO] [ALSA]: Period size: 768 frames
      [INFO] [ALSA]: Buffer size: 3072 frames
      [INFO] [ALSA]: Can pause: no.
      [INFO] [Menu]: Found menu display driver: "gl".
      [INFO] [Font]: Using font rendering backend: stb-unicode.
      [INFO] [Font]: Using font rendering backend: stb-unicode.
      [INFO] [Menu]: Found menu display driver: "gl".
      romtitle     : Advance Wars 2: Black Hole Rising (U)
      gamepak title: ADVANCEWARS2
      gamepak code : AW2E
      gamepak maker: 01
      INPUT gamepak title: ADVANCEWARS2
      INPUT gamepak code : AW2E
      INPUT gamepak maker: 01
      found entry in over ini file.
      [CDROM] Could not open /dev/sg1, please check permissions.
      [CDROM] Could not open /dev/sg0, please check permissions.
      [INFO] [LED]: LED driver = 'null' 0x4bce28
      [INFO] [MIDI]: Initializing ...
      [INFO] [MIDI]: Input disabled.
      [INFO] [MIDI]: Output disabled.
      [INFO] [MIDI]: Initialized "alsa" driver.
      [INFO] Loading history file: [/opt/retropie/configs/gba/content_history.lpl].
      [INFO] Loading history file: [/opt/retropie/configs/gba/content_music_history.lpl].
      [INFO] Loading history file: [/opt/retropie/configs/gba/content_video_history.lpl].
      [INFO] Loading history file: [/opt/retropie/configs/gba/content_image_history.lpl].
      [INFO] Loading favorites file: [/opt/retropie/configs/gba/content_favorites.lpl].
      [INFO] Written to playlist file: /opt/retropie/configs/gba/content_history.lpl
      /opt/retropie/supplementary/runcommand/runcommand.sh: line 1255: 14874 Illegal instruction     /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-gpsp/gpsp_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Advance Wars 2 - Black Hole Rising (USA).zip" --verbose --appendconfig /dev/shm/retroarch.cfg
      

      gba_bios.bin is correct and in ~/RetroPie/BIOS/:

      pi@rpi4-retropie:~/RetroPie/BIOS $ md5sum gba_bios.bin
      a860e8c0b6d573d191e4ec7db1b1e4f6  gba_bios.bin
      pi@rpi4-retropie:~/RetroPie/BIOS $ crc32 gba_bios.bin
      81977335
      

      On the Pi 3 & 4, this isn't an issue because I can just use lr-mgba but on the 0W it's a big issue as it means that the only emulator that can run GBA games at full speed is the non-libretro version of gpsp.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Yes, it looks reproducible, it's probably an overly aggressive compiler optimization flag. We'll test more to find a solution.
        NOTE: for large text pastes/logs, please use pastebin.com, it's easier to read and search.

        1 Reply Last reply Reply Quote 0
        • C
          corezon
          last edited by

          @mitu said in lr-gpsp giving "Illegal Instruction" on Raspberry Pi models 0W, 3B and 4.:

          NOTE: for large text pastes/logs, please use pastebin.com, it's easier to read and search.

          Will do. Thanks for looking into this. 😁

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            I tested this with a couple of version and although it crashes on the PI4, it doesn't crash on a RetroPie Pi3B installation (latest update). I don't have a PI Zero installed, so I can't test with that.
            Which image did you use to test on Pi3B ?

            C 1 Reply Last reply Reply Quote 0
            • C
              corezon @mitu
              last edited by

              @mitu I'm running 4.5.15 on the Pi 4 and 0w. I stand corrected. The Pi 3 is running 4.5.2... just checked again and turns out it was a BIOS error on my part. 😞

              I have double checked the 0w and it had the correct BIOS and gives the Illegal Instruction. I have no idea how I managed to get a bad BIOS file on one Pi but not the others.

              1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator
                last edited by

                I've tested a few more scenarios and it looks like an issue with the DynaRec (dynamic recompiler) - a feature that speeds up emulation taking advantage of the ARM CPU's specific instruction set. Compiling the core without this feature doesn't show the crash, but the emulation will be slower.
                It looks like compiling the core with a newer GCC available in Raspbian Buster makes the DynaRec crash, but the same code compiled with the GCC available in Stretch produces correct code (core copied from a 3B install works on a Pi4 with Buster). Doesn't seem to be optimization related, but it's difficult to find a fix in RetroPie.

                1 Reply Last reply Reply Quote 0
                • C
                  corezon
                  last edited by

                  So this is a gpsp problem and not a RetroPie issue? Does that mean that the issue would also be present in the non-libretro version?

                  mituM 1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator @corezon
                    last edited by

                    @corezon said in lr-gpsp giving "Illegal Instruction" on Raspberry Pi models 0W, 3B and 4.:

                    So this is a gpsp problem and not a RetroPie issue? Does that mean that the issue would also be present in the non-libretro version?

                    Possibly, but that won't run on the Pi4 so I didn't test it.

                    C 1 Reply Last reply Reply Quote 0
                    • C
                      corezon @mitu
                      last edited by

                      @mitu gpsp (non-libretro) gives me a SegFault on the 0w when installed from binary. I'm compiling from source now to see if that makes a difference.

                      1 Reply Last reply Reply Quote 0
                      • C
                        corezon
                        last edited by

                        gpsp SegFaults even if compiled from source.

                        1 Reply Last reply Reply Quote 0
                        • M
                          masterjule
                          last edited by

                          Hi,

                          I've got the same error on my Pi0. Is there any solution for now?
                          I'm looked forward to play some GBA games and setup retropie today and then this.

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @masterjule
                            last edited by

                            @masterjule said in lr-gpsp giving "Illegal Instruction" on Raspberry Pi models 0W, 3B and 4.:

                            I've got the same error on my Pi0. Is there any solution for now?

                            Install another GBA emulator and use it instead - https://retropie.org.uk/docs/Game-Boy-Advance/.

                            1 Reply Last reply Reply Quote 0
                            • M
                              masterjule
                              last edited by

                              Thank you, I installed the gpsp, but got a segmentation fault error.
                              lr-vba-next ist not available and lr-mgba ist starting, so the rom is ok, but very poor performance

                              BuZzB 1 Reply Last reply Reply Quote 0
                              • BuZzB
                                BuZz administrators @masterjule
                                last edited by BuZz

                                @masterjule I don't think gpsp will be fast enough on your system anyway. I will look into it when I have a chance but I think you need at least an rpi2 for GBA.

                                To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                1 Reply Last reply Reply Quote 0
                                • T
                                  TechieAndroid
                                  last edited by TechieAndroid

                                  I also have started having this problem since I updated. Maybe a previous package version for lr-gpsp would work if there is one. I'll be looking into a workaround until an actual fix is found.

                                  @BuZz said in lr-gpsp giving "Illegal Instruction" on Raspberry Pi models 0W, 3B and 4.:

                                  @masterjule I don't think gpsp will be fast enough on your system anyway. I will look into it when I have a chance but I think you need at least an rpi2 for GBA.

                                  I know for a fact that before, it would run gba games at full speed. I tested it myself.

                                  mituM 1 Reply Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator @TechieAndroid
                                    last edited by

                                    @TechieAndroid What system are you running ? From what I've tested, it's not the emulator version that's the problem, but the compiler used to produce the binary - the one distributed with Raspbian Buster.

                                    T 1 Reply Last reply Reply Quote 0
                                    • BuZzB
                                      BuZz administrators
                                      last edited by

                                      I'm currently looking into this btw (to avoid duplicate efforts)

                                      To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        TechieAndroid @mitu
                                        last edited by

                                        @mitu Pi 0 W with the latest version of RetroArch.

                                        1 Reply Last reply Reply Quote 0
                                        • T
                                          TechieAndroid
                                          last edited by

                                          @mitu said in lr-gpsp giving "Illegal Instruction" on Raspberry Pi models 0W, 3B and 4.:

                                          @TechieAndroid From what I've tested, it's not the emulator version that's the problem, but the compiler used to produce the binary - the one distributed with Raspbian Buster.

                                          I see. So when I tried compiling it I ran out of memory on my Pi 0 W. Then I tried compiling it in Arch with make TARGET=PI1 and then I replaced the binary with the one in /opt/retropie/libretrocores/lr-gpsp/ however it didn't change anything either.

                                          So I've been looking over the GitHub page and the maintainer hasn't provided much detail for compilation on various hardware. Do you know what compilation flags I might try on my computer to make it work on the Pi? I was basically guessing earlier.

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            Retro-Dee
                                            last edited by

                                            Compiling the code with the mentioned methods doesn't work in any way, you end up receiving "Illegal Instruction".
                                            What I did to temporarily solve this problem is to use a previous build of the gpsp_libretro.so binary and just as expected, it works!

                                            X 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.