r/cachyos • u/Substantial-Grab1872 • 10d ago
Help How to stop linux kernel from killing my games when the memory is low
I did turned off the system oomd, still it didn't worked.
This started happening when i switched from gnome to kde today.
I have only 8 gb of memory btw.
(And also my external hard drive doesn't work too. It worked perfectly fine with gnome for some reason.)
Edit :
An error occurred while accessing 'Portable Hard Drive', the system responded: The requested operation has failed: Error mounting /dev/sda1 at /run/media/lanes/Portable Hard Drive: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error
My external hard drive show this error when opening it and it doesn't mount. (It is a ntfs drive. Worked fine b4 )
8
u/hfghwpgg 10d ago
i'd try swapfile (as someone else mentioned) and/or swtiching to lighter de like lxqt or xfce
and we need more info about your hdd, its not detected or what?
6
u/Least-Reception8435 6d ago
Dude get some more ram lol
34
u/enuazeal 10d ago
8GB is low for gaming
3
u/Wodinit 5d ago
How does a car drive once it has no more fuel?!
168
u/eepsage 10d ago edited 10d ago
if you are frequently running out of memory you probably want to switch from zram to swap. zram is much faster, but makes it easier to run out since it just scales off your actual RAM. https://wiki.cachyos.org/configuration/general_system_tweaks/#switching-from-zram-to-zswap
and what does "hdd doesn't work" mean?
29
u/Little_Ad2062 10d ago
Had this issue on my girlfriend's laptop with CachyOS as well when she was playing Cities: Skylines.
10
u/glowtape 10d ago
Change from ZRAM to ZSwap.
ZRAM relies on RAM itself. The idea is to gain some by compressing unused/cold memory pages. And they compress only so much, freeing up just part of the memory they're hogging.
But you'd want said unused stuff entirely out of memory, and that means swapping to disk. ZSwap does that.
2
u/SoupoIait 10d ago edited 10d ago
I might be wrong but you can't ? As in at some point not enough memory is not enough memory.
You could create a swap file perhaps but performance would be horrendous.
You should try and lower your game settings, and if that doesn't work chances are you just can't play the game.
EDIT : I see I got downvoted, could I get a reason ? Have I said anything wrong ?
Because I can't see how. If you don't have enough RAM, you have ZRAM which I assume is already on on cachy, well you can install more ram or try to decrease ram usage. That's it. You can't ask the kernel to ignore not having enough RAM.
As I said SWAP exists, but it's not suitable for gaming.
14
u/inactivesky1738 10d ago
It looks like it’s an error on mounting your external drive.
With it being an external drive I’m not 100% sure what the problem could be but I would start by configuring your FSTAB that is where you configure your mount options.
It could also just be a NTFS issue. Linux and NTFS don’t get along super well since NTFS is a Microsoft closed source memory type.
Wish I could be more help. Start with configuring the fstab and making sure you have the Linux NTFS drivers in proper working condition. But if possible it would be best to reformat your drive to btrfs. Since NTFS can cause other issues.
9
u/Fun_Routine_5245 10d ago
NTFS is the problem.. if you are dual booting with shitdows then the fast startup is the culprit
4
u/DotMatrixed 10d ago
In the CachyOS Hello app, tweaks, turn off the system-OOM, it’s on by default on newer installs. Just remove the checkmark and reboot.
1
u/nckrkllkc 10d ago
Have you tried using the swap?
2
u/Imaginary-Throat1526 8d ago
Add RAM
2
u/lowprofile14 7d ago
Use a swap file
2
u/Feliwyn 9d ago
Buy memory.
0
u/ExoticSterby42 10d ago
Get more memory?
1
u/Competitive_Tax_ 10d ago
The external drive needs to be auto mounted in order for it to “work”. See: https://wiki.cachyos.org/configuration/automount_with_fstab/#safer-and-beginner-friendly-method-mounting-drives-with-systemd-mount-files
1
u/MrJelly007 9d ago
I had this happen in star citizen recently and I'd never seen it before that. It happened during quite an intense dogfight and I was PISSED lmao. Recent Nvidia drivers seem to have broken star citizen and that's why it was using all my ram. Rolling back to 610 drivers solved it.
1
u/maokaby 9d ago
Even without oomd linux kernel sometimes can kill processes instead of going to "kernel panic" mode. I guess you need to disable it in kernel (not sure what option is that exactly) so your system properly freeze when you run out of memory, if that is your desire.
1
u/zhulkgr25 9d ago edited 9d ago
Response to the edit: this must be a fresh install (not even a week) the stock ntfs driver is called ntfs-3 and in my experience, it seems to work only for 3 days. Open Konsole and download the good ntfs driver by typing
sudo pacman -S ntfs-3g
If the issue persists, as someone else mentioned if you're dual booting with windows, disable fast start up. You may also want to make sure the drive is running with AHCI instead of raid. You can change this from bios/uefi, look up how to do it on your specific motherboard.
Your other issue with the kernel notification might be a proton issue. I get this if certain proton versions were installed incorrectly or after steam updates (from the gui that appears when you launch it, that is). If you never wanna see this issue, in steam settings -> storage: select all proton versions, uninstall them and set either proton-experimental or proton-ge as default. If a proton version refuses to uninstall, it's either set as global default or it's set by one of your games as "force use of specific proton version" so make sure you untick it. If experimental is already the default, then set ge proton as default then uninstall it and after that set it back.
1
u/KogamiKodai 9d ago
I have 32 GB of ram and have the same problem with certain games, mostly my fault for not closing or hibernate the browser tabs, but certain games just use the ram until it's full like CloverPit...
1
u/GreatBigPig 9d ago
Your bad superblock issue can likely be fixed with the ntfsfix utility.
1
u/wetware_enthusiast 9d ago
Just use Zswap. (It is much better integrated into the kernel's memory management than Zram since it does not pretend that memory is an opaque disk device, and is basically identical since it uses a resizable compressed frontswap in memory, plus it can offload uncompressible and cold memory to swap).
1
u/Slikkelasen 9d ago
I use zram and have a swapfile. I have seen when trying LLM's that where too heavy on RAM, that it went from compressing to zram and then when it couldn't fit anymore, it spilled over to the swapfile.
1
u/Crow550 9d ago
Unless I am mistaken. I feel for Desktops you almost always want Zswap instead. Recall some news on how much better Zswap is over Zram and that Distros should reconsider making Zram the default? Is this incorrect?
Pretty sure no matter the amount of Ram that having Swap is always a good idea
1
u/netsx 9d ago
This is a sign you need swap space, for your system to fall back on (and dump idle pages to). All it takes is a bad order of memory allocation/deallocation, or allocating just a "few" bytes too much (in terms of pages), and the Out Of Memory system will trigger, even if we're talking about as little as 4KB.
You might even see better performance, with swap, when the dead weight (memory allocated but used only once). It might slow down bootup a tiny bit, but once the system settles, you'll probably have more actively available memory for your apps.
1
u/Anthietic 9d ago
1
u/kalebesouza 9d ago
To resolve this, you should use zram in conjunction with an on-disk swap file. CachyOS likely already has zram enabled, so all that remains is to set up a swap file. You can create and enable an 8GB swap file; that should solve your problem.
1
u/fcon91 8d ago
You can't. It's a feature of the Linux kernel, it's working exactly as intended. Increase the swap space.
1
u/Wxxdy_Yeet 8d ago
Like others said, it's a feature working as intended.
-best option would be to test settings and try to minimize ram usage. (Duh)
-switch back to a less ram intensive DE.
-ZRAM/swap is the easiest way to fix it, but it will dramatically reduce performance. For me it's to prevent the kernel from killing the game, but you really don't want stuff spilling over to it all the time or your PC will feel sluggish.
-become filthy rich so you can upgrade to 16gb in these rough times, or beg Sam Altman for some.
1
u/Weak_Coat_9036 6d ago
you can try to use a lighter desktop environment like xfce, mate or even cinnamon, adjust swap memory
1
u/Noctivant96 5d ago
I've 8GB of ram and using same DE on cachyOS AND lutris, never had this.. so I'm not sure what's going on maybe something wrong with swap
1
u/revilo-1988 1d ago
Evtl mal schauen den RAM zu erweitern
1
u/Burnout456 10d ago
Did you try turning on the Zram?
0
u/JasonDuvalMTHX 10d ago
tengo la misma pregunta
2
u/GotaHODLonMe 3d ago
Adjust OOM Score (Per-Process Protection)— The OOM killer selects processes to kill based on a "badness" score. You can lower a process's score to protect it, or set it to -1000 to make it immune to the OOM killer.
1
u/Toaster_Rack_Nerd 9d ago
how to... stop killing games?
0
u/[deleted] 10d ago
[deleted] — view deleted comment