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 @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
                                    • X
                                      xgaia @Retro-Dee
                                      last edited by

                                      @Retro-Dee can we have this old build ?

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        juchong
                                        last edited by

                                        Hi folks, here's the 4.5 binary: https://github.com/libretro/gpsp/issues/71#issuecomment-633748977

                                        To install, unzip the file and transfer gpsp_libretro.so to your Pi. Replace the file in /opt/retropie/libretrocores/lr-gpsp/ with the version I've posted. Be sure to set the file permissions to 755 by issuing this command: sudo chmod 755 /opt/retropie/libretrocores/lr-gpsp/gpsp_libretro.so

                                        Hope this helps!

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

                                          I did look into this btw but need to revisit. Using older GCC on buster still caused the issue so need to debug further with gdb.

                                          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

                                            I can confirm that the older working version still runs at full speed. So that's nice.

                                            I'm going to install Arch on one of my Pi 0 W's and compile the latest lr-gpsp binary, I'll post it as soon as I can.

                                            1 Reply Last reply Reply Quote 1
                                            • 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.