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

    Emulationstation crashed and Cannot allocate memory on pi4

    Scheduled Pinned Locked Moved Help and Support
    crashpi 4es crashed
    66 Posts 10 Posters 4.9k 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.
    • quicksilverQ
      quicksilver
      last edited by quicksilver

      Pi4 using the official but unsupported retropie image Ver. 4.5.14. and it looks like Im now suddenly having the same issue as reported here: https://retropie.org.uk/forum/topic/24436/drm_ioctl_mode_create_dumb-failed-cannot-allocate-memory?_=1583298279174

      I first started to notice that ES was becoming more unstable and was crashing quite frequently (displaying the standard ES crash message screen) when either launching a game or quitting a game and returning to ES. Although I now have also gotten the "DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory" message several times now as well. These issues just started over the last few days and ES had been stable up until that point. The only things I have changed since this issue started are some small modifications to the theme Im using and some changes to the way skyscraper generates gameslists. However these were small changes and nothing out of the ordinary so Im not sure how they could contribute to this issue.

      M shavecatS 3 Replies Last reply Reply Quote 0
      • M
        mikeydoom @quicksilver
        last edited by

        @quicksilver

        What do you have gpu_mem in config set to?

        I have mine set to 256 and don't have that issue on my rpi4 with 4.5.14

        BuZzB 1 Reply Last reply Reply Quote 0
        • M
          mikeydoom @quicksilver
          last edited by

          @quicksilver

          Also set the ES VRAM in emulation station settings to 200mb or higher depending on which pi4 you have.

          I have the 4gb model so I set it to 512mb.

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

            @mikeydoom gpu_mem is not used in the same way by the rpi4. Or at least not by emulation station

            This may be useful:

            https://www.raspberrypi.org/forums/viewtopic.php?t=244531#p1491512

            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
            • BuZzB
              BuZz administrators
              last edited by BuZz

              You can experiment with the cma configuration but my rpi4 is fine without any changes from default in ES.

              Also see

              https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=234348 (although we use fkms)

              256mb is the default btw.

              More info about your set up such as es settings info and config.txt might be useful.

              Changing the ES settings as mentioned by previous reply may help.

              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

              quicksilverQ 1 Reply Last reply Reply Quote 0
              • quicksilverQ
                quicksilver @BuZz
                last edited by

                @BuZz Thanks for the reply. My current ES settings are: gameslist view is set to "video", I dont use videos but the theme Im using makes use of marquees so I have to set to video in order for them to display. I have tested multiple vram settings from 80mb-200mb and the crashing still occurs. I have tried turning screen saver off but crashing still occurs. Im currently using a customized version of the "nostalgia" theme but im going to switch back to carbon to see if the issue is related to the theme Im using. Config.txt is default settings except forcing 1080p mode.

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

                  Can you post the dmesg output on pastebin.com ? Do you have anything configured on the start/stop runcommand scripts ?

                  1 Reply Last reply Reply Quote 0
                  • V
                    VictimRLSH
                    last edited by

                    If you set the GPU mem too high, you'll never be able to boot that SD card again on a Pi 4 unless you reinstall an image OR boot the card on a Pi 3B and reset the GPU memory there. I did that to mine when I set it above 512mb.

                    System Config: Retropie 4.4 with full desktop, RPi 3B, 256gb SD, 5v 2.1A 5,200 mAH USB battery. EasyMSX controller mounted with Pimoroni Hyperpixel 4 (non touch). Also running 4.6 on a 4gb Pi 4 serving as my primary desktop computer now.

                    quicksilverQ 1 Reply Last reply Reply Quote 0
                    • quicksilverQ
                      quicksilver @VictimRLSH
                      last edited by

                      @VictimRLSH I don't have gpu mem set at all. Also, the boot partition is accessible from a Windows computer if you need to make edits to your config.txt.

                      1 Reply Last reply Reply Quote 0
                      • quicksilverQ
                        quicksilver
                        last edited by

                        I cant seem to get it to reliably crash anymore. It has been stable all day though I havent changed anything. Will post a dmesg if it crashes again.

                        1 Reply Last reply Reply Quote 0
                        • quicksilverQ
                          quicksilver
                          last edited by

                          ES crashed again today (it has done it a few times since my last post but not reliably). It always seems to occur when ES is either loading or when Im launching a game. I was able to get the dmesg output this time.

                          https://pastebin.com/mZecJWQ4

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

                            There's no driver errors in the dmesg, so it doesn't look like a kernel driver bug/error. Can you try reproducing with the stock theme or maybe uploading your modified theme somewhere so we can try and see if we get the error ?

                            EDIT: Are you using the 'normal' EmulationStation install or the emulationstation-dev package ?

                            quicksilverQ 1 Reply Last reply Reply Quote 0
                            • quicksilverQ
                              quicksilver @mitu
                              last edited by

                              @mitu I am using the standard/normal emulationstation install. I will switch to carbon for a bit and see what happens. I am using a modified version of the nostalgia theme https://github.com/supersquared/es-theme-nostalgic-neo

                              1 Reply Last reply Reply Quote 0
                              • R
                                rejesterd
                                last edited by rejesterd

                                @quicksilver Seems like it was crashing more often before you changed the vram settings and disabled the screen saver. If that's correct, I would start lowering the vram setting in ES again and see if it reproduces more consistently.

                                Also, have you run emulationstation with the --debug option? That might help clarify what's happening. But it might stop crashing if you just raise vram to 512m (which should be reasonable if you have the 4g model).

                                1 Reply Last reply Reply Quote 0
                                • quicksilverQ
                                  quicksilver
                                  last edited by quicksilver

                                  So I'm thinking the crashing is related to the theme. I installed the same theme on my previously stable pi 3 now it is crashing occasionally. I don't know much about theming so I can't tell what is wrong here. Would someone be able to take a look at the link I posted above and see if anything glaring sticks out? I have also noticed that this theme takes much longer to boot up though I can't figure out why, all of the different art file sizes seem to be roughly the same size as other themes but other themes boot much faster.

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

                                    I've installed the theme yesterday, after you posted the source, and briefly tested it, but didn't get any crash so far. I've left it active, trying to see if I get a crash.
                                    To help debug this, you can run ES through a debugger and get a crash backtrace.

                                    • install gdb with sudo apt install gdb
                                    • exit EmulationStation and start a SSH session to your PI.
                                    • run from the command line (via SSH)
                                    gdb -q /opt/retropie/supplementary/emulationstation/emulationstation -ex run
                                    

                                    this should start ES from the debugger

                                    • try and reproduce the crash. When it crashes, you should get a message in the gdb session that it did so. Run from gdb prompt
                                    bt full
                                    

                                    then get the output and post it here.

                                    • press q to exit the debugger.
                                    quicksilverQ 1 Reply Last reply Reply Quote 0
                                    • quicksilverQ
                                      quicksilver @mitu
                                      last edited by

                                      @mitu
                                      Here is the output:

                                      
                                      Thread 2 "emulationstatio" received signal SIGSEGV, Segmentation fault.
                                      [Switching to Thread 0xb4e0b160 (LWP 27358)]
                                      0x001b58dc in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .isra.                                                                                                                     11] [clone .part.12] ()
                                      (gdb) bt full
                                      #0  0x001b58dc in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #1  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #2  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #3  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #4  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #5  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #6  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      No symbol table info available.
                                      #7  0x001b58e8 in nsvg__initPaint(NSVGcachedPaint*, NSVGpaint*, float) [clone .i                                                                                                                     sra.11] [clone .part.12] ()
                                      --Type <RET> for more, q to quit, c to continue without paging--
                                      

                                      I didnt get the standard crash message though, so hopefully this is the same issue and not something else.

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

                                        @quicksilver Hm, seems we're getting somewhere, but since the output is truncated we don't see the calling site in the EmulationStation code. Do you remember what system was loaded when the crash occured ? I realized I might not have one of the systems from your install and that's why I couldn't - briefly - reproduce the crash.

                                        quicksilverQ 1 Reply Last reply Reply Quote 0
                                        • quicksilverQ
                                          quicksilver @mitu
                                          last edited by quicksilver

                                          @mitu In this particular instance I think it was PPSSPP, though it has crashed for me on multiple different systems. And the crash isnt reliably reproduced. A crash can sometimes occur on the first game I launch or I might have several crashes in a row or I might launch many games with no crashing.

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

                                            Just for comparison of systems, can your run

                                            find $HOME/RetroPie/roms/ -type d ! -empty -maxdepth 1 
                                            

                                            and post the output on pastebin.com ? Just want to see what's the difference from my system list.

                                            quicksilverQ 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.