GTA5 on Linux (Ubuntu 24.04 + Preempt Boost)

https://www.youtube.com/watch?v=KSNSCprz2Rg

GTA5 on Ubuntu 24.04 + Preempt Full ends up achieving the maximum FPS cap of 188 FPS. The cap gets hit multiple times as a matter of fact.

Compared to the previous video where Ubuntu 24.04 ended up adding 50+ FPS to the game, this one ends up adding the maximum allowed FPS to the game.

Obviously I gotta do a video about this game and about 10 more because Ubuntu is turning 2024 into the year of gaming on Linux (No joke here). I tested and compared even 8 of the games yesterday to their counterparts on Windows 11. On Ubuntu I was getting with the same hardware (or even less) better FPS and performance than on Windows.

3 Likes

It’s funny you mention this. Just yesterday I upgraded my son’s Edubuntu laptop from 23.10 to 24.04 and I made sure to enable preempt=full in the boot parameters. We have a Steam installation via the Steam snap with several games. His computer runs Intel Iris XE graphics, so we don’t expect much out of it, but we were super surprised at the performance with what it has!

Recently he’s become a fan of the game “Hollow Knight” which runs natively. Upon playing it, we both noticed that it was running smoother and with no crashes unlike under Windows where it would crash randomly.

We also installed the game “My Singing Monsters” which is a game he enjoys on touch screen platforms (free to play), but has to run via Proton. Seems to run without a hitch here as well.

I’m having him experiment some more as well. For context, my son is Jonathan Eickmeyer, and is a major contributor on an advisory and testing basis to Edubuntu. As a 12-year-old and entering seventh grade this year, and as an online school student, he is perfectly positioned to advise on what students need in an educational operating system from a student’s perspective. He’s also been the youngest registered attendee of Ubuntu Summit for two years in a row (2022 and 2023).

Edit: As for my own experiments, I’ve been doing the same under Ubuntu Studio 24.04. I switched to the generic kernel from the lowlatency kernel and am using preempt=full nohz_full=all threadirqs as my boot parameters and have added them as checkboxes to “Ubuntu Studio Audio Configuration” to automatically add to the kernel boot parameters via GUI for users of Ubuntu Studio in 24.10 coming out in October.

So far, I’ve seen exactly what you’re seeing: tremendous performance improvements on the gaming side, especially in terms of framerate, mostly playing “Euro Truck Simulator” and “American Truck Simulator” which run natively but can be hit/miss on framerate since the last update (1.50). That said, in my last session since making the changes, it ran much smoother than before I made the switchover to the generic kernel with the kernel parameters mentioned and after the 1.50 update.

For audio production, I’ve noticed some decent performance as well, but I’m going to have to jump into the deep end there with some production level mixing and mastering to know how it’ll turn out for sure.

1 Like

It appears in new enough kernels you can just

echo full > /sys/kernel/debug/sched/preempt

as root.

If full performs dramatically better than the default voluntary mode then it suggests at least one place exists that could do with explicit preemption. Because in an ideal world, voluntary shouldn’t perform that much worse than full.

I also wonder if that place is in the kernel or if user space can do something about it.

WOW!. You have to be super proud as a dad right there. I am also introducing both of my kids (6 and 8) to Linux via Ubuntu. Right now they do play Goat Similator 3, Minecraft and some math games.

For this part:

nohz_full=all threadirqs

What is going on there. What are those 2 parameters used for?

My whole paramater list is this:

GRUB_CMDLINE_LINUX_DEFAULT=“mitigations=off nvidia-drm.modeset=1 ibt=off split_lock_detect=off split_lock_mitigate=0 nokaslr”

GRUB_CMDLINE_LINUX=“vdso=0 ignore_rlimit_data nvidia-drm.modeset=1 sched_migration_cost=512 pci=nommconf preempt=full”

Some because I hate garbage on dmesg, others because Asus has not yet fix some z790 stuff 100%. Almost there but not 100%.

1 Like

Thank you boss!. If there is anything I can test let me know.

Well, you can see right from the screenshot I posted what they do.

xruns = buffer over/under runs. causes crackling/skipping.

Omggg that’s a very small image on my screen for some reason. I actually thought it was like 3 terminal lines of some code.

That’s pretty COOL something that shows parameters like that. Thank you.

If you click on it, it will zoom in.

Well, you were TOTALLY right as always. The boost was visibly noticeable.

Hogwarts Normal - Average FPS of 63 FPS for a 10 Second scene.

Hogwarts Tweaked - Average FPS of 69 FPS for a 10 Second scene. A 9% FPS Increase.

God Of War Normal - Average FPS of 100 FPS for a 10 Second scene.

God Of War Tweaked - Average FPS of 130 FPS for a 10 Second scene. A 30% FPS Increase.

So CPU bound games or games that rely more on CPU will benefit even more. Of course the test was simple, just the loading scene when cutting down the tree on GoW (I waited 10 seconds to notice an average), and just outside the first town in Hogwarts Legacy, same thing. Waited 10 seconds to notice an average.

Also tested Cyberpunk and it had 2 FPS more as an average on a specific place I always use to test the FPS performance. Basically depends on what the engine requires the most and where in the game we are.

2 Likes

Hey Daniel! Good to read you!

These parameters were suggested by @arighi in Fine-Tuning the Ubuntu 24.04 Kernel for low latency, throughput, and power efficiency, so they weren’t without forethought or previous discussion. Additionally, other discussions took place in Ubuntu 24.04 Boosts Gaming Performance.

For audio production, I’d absolutely prefer full over voluntary, but for gaming, as you can see, @luisalvarado is seeing some minor increases which, while minor, every little bit helps.

The other noteworthy piece was the power consumption decrease he noted in the previous post, so there’s definitely something to this beyond performance increase.

Either way, your echo full > /sys/kernel/debug/sched/preempt is something I’m going to be integrating into the Ubuntu Studio Audio Configuration wizard so that users don’t have to reboot for the command parameters to take effect, but can make the changes on-the-fly. I’m not sure if the other parameters can be done in a similar manner, but more research needs to be done on that front.

Thanks @eeickmeyer. That article was posted just as I started a month of travel, so it makes sense I missed it.