[FIX] Lua Panic, Linux PulseAudio Configurations, Memory errors, and GMod

Discussion in 'Help & Support' started by Durruti, Apr 9, 2018.

  1. Durruti

    Durruti Member

    United States
    Mar 18, 2018
    So, I don't know how many folks we have that run Linux to play Garry's Mod here, and while there are benefits that come with it, there are a shitload of drawbacks too, so I decided to make a thread about my experiences with it, and "fixes" to a lot of the issues with it, just in case someone might need it for the future.

    I run Gmod on Debian 9 "Stretch." Basically, I had been getting almost consistent errors with the server at random times, such as Vertex Buffer Overflows, and Lua Panic (Typically when trying to connect to the server.)

    I'd initially figured this was something to do with my drivers, since I'm not using normal Nvidia drivers on my GTX 1060.

    My first thought was to set the heapsize (-heapsize xxxx in launch options) to something that would reflect my amount of physical RAM installed on my box, 16 gigabytes. That actually did absolutely nothing, and turned out to be a major contributor to Lua Panic issues on my client.

    After a week or so of researching, trying everything I humanly possibly could to fix the issue, I managed to figure out that on Linux GMod, PulseAudio (The system that handles audio output/input and HDMI audio), actually tends to use a *shitload* of memory that typically gets allocated for Garry's Mod itself.

    I'd actually noticed that turned my volume up past 100% on my Firefox output stream (for listening to music while RPing), was actually causing my game to stutter, but not actually "Lag" FPS wise. I was still able to render all the maps we're on at around 90-120 FPS, but the stutter was absolutely fucking unbearable. I noted that actually turning the volume down stopped the stutter.

    A guy named Slarer from FacePunch actually shared this interesting tidbit, that turned out to be one of the major contributing factors to this fix I'd found.

    "gmod has like 6-16 pulseaudio pages either mapped from memfds or systemv shared memory, and they take up 64mb a pop.

    /etc/pulse/daemon.conf and /etc/pulse/client.conf need to have shm-size-bytes set to something lower than 64 mebibytes, i set it to 8 (meb).

    i don't know if it is of any detriment to pulseaudio's performance or sound quality, but they used up nearly a gigabyte of gmod's limited 32-bit memory space.

    the game is entirely unplayable on 2017's fine darkrps unless you do this."

    Figuring this out, here's what I did to solve this issue by directly editing the configuration files of PulseAudio (Both the daemon and the client)

    ; shm-size-bytes = 8 # setting this 0 will use the system-default, usually 64 MiB

    Typically this is set to 0, and will use 64 MiB per stream(?) and given with how much audio-processing source handles at any given time, this typically sets it over the tipping point to cause major crashing and Lua Panic. Setting it to 8 solves the problem immediately.

    Other changes made: Turned my graphical settings down just a tad, went from 8x to 4x MSAA.

    Still was having issues with crashing, so I took the -heapsize launch option out of my personal client, and I haven't had an issue since.

    Edit: Gmod runs at a comfortable 2.2 GiB after these fixes.


    https://gmod.facepunch.com/f/gmodhe...-panic-ONLY-in-Linux-works-on-windows-fine/1/ (Fix source as of October 19th)

    https://github.com/Facepunch/garrysmod-issues/issues/3019 (Further info on documented Git entry in regards to rendering Gmod on OpenGL)
    • Winner Winner x 2
    #1 Durruti, Apr 9, 2018
    Last edited: Apr 9, 2018
  2. toastmatic

    Paroxysm Admin Moderator

    Oct 26, 2014
    • Agree Agree x 5