Updating My Linux Kernel for Gaming

The average computer user is most likely a Windows or Mac person, at least that is what I have observed. Tech folk might use Linux for servers, especially with the advent of cloud services like AWS etc but Linux Desktop users are few and far between mostly. Main reason is Gaming. Linux Gaming support has been limited in the past.

Now that Valve’s Steam Deck is out and arriving with users, people are considering Linux as a valid option. Linux Desktop market it share is only around 2% and it has approximately 13.6% of the ‘Server’ market.

I had been toying with the idea of moving to Linux for some time. I have a distaste for Apple just from brand perspective, although have used them in my professional career as Software Engineer. As I grew up building my own Desktop machines I naturally went with back then Windows, given it’s market share.

But modern Windows, as with many applications/systems, seems to be going down the route of lack of control/tinkering, too much advertising and unintelligible UI’s. Maybe I’m just showing my age but I find them getting worse and in Windows the whole system is cluttered and horrible to find anything you need. Also they seem to be adding lots of security that is pointless, in the sense that it can be easily disabled, more on this in a further down.

Anyway I decided to dip my toe first and try the most easy/common Linux distribution, Ubuntu. I had used this via AWS as an Engineer to had some familiarity with it. I installed on a secondary older laptop I had and found it easy to get setup and easy to use.

Obviously as one who games quite a bit I wanted to test out running Steam and see if I could play the majority of my games. It was again easy to deploy and managed to run a good few test games. As I became more enamoured with Linux as a whole I decided to look around at other distros. My other half had been using the Mint distribution and I liked the look and feel, plus seeing it use I knew it would be easy to get along with. It has an style of old windows, logical, organised and streamlined in a way that was familiar.

So I took the plunge and decide I would go with Mint and put it on my main laptop and run it via dual boot. It took a bit longer to setup due to security items. Firstly I wanted to run a backup/snapshot before any install attempt, so should anything go wrong I could ‘reset’ back to what I originally had. Next I had to partition my drive appropriately and with the correct format. This was a little finickity at first due to Windows having hard drive encryption ‘Bitlocker’ and I ended up needing to disable it. Once both those items were complete I was able to download and create boot media, then I installed Mint and never looked back.

Fast forward now and to play games I have always used more than Steam, I use GOG and EPIC as well. I installed these early on but they don’t have ‘native’ support like Steam. ProtonDB https://www.protondb.com/ also has loads of really useful information about running games via Steam on Linux.

To run EPIC/GOG though you need WINE a piece of Windows Emulation software which allows using Windows written applications in Linux. https://www.winehq.org/

On top of this I chose to use Lutris which is ‘a video game preservation platform aiming to keep your video game collection up and running for the years to come‘. https://lutris.net/

It supports Steam/GOG/EPIC and Humble Bundle libraries. This had been working reasonably well for some time but I recently encountered an issue which meant my GOG/EPIC applications were not working.

So here comes to the main reason for the blog title. I had been getting errors messages relating to FSYNC not being supported on my kernel when trying to run these launchers. Now this can be disabled so the applications use other means, but FSYNC is the preferred usage.

So what is FYSNC in Linux?

In Linux, Write system call is performed asynchrously for the sake of the performance. We call it buffered write. First, kernel write the data to page cache in DRAM, and flush the data to the storage later peoridically or by synchrous operations. However, if a system crash occurs before the data is flushed, the data can be lost or corrupted. To make data durable, applications can explicitly call the fsync system call. On Fsync, kernel flush the corresponding data on the page cache to the storage so that the data won’t be lost after a system crash.

source: Quora

So after some investigation I chose to update my Linux Kernel. I was on 5.13 and FSYNC is only 5.16 onwards. Linux Mint uses Ubuntu as a base, so I chose to get a new kernel from the Ubuntu Mainline repository. There are many different Linux Distros and some are more difficult to get on with others if you are less tech savy. Mint I have found easy to adapt to yet was still surprised how easy it was to download, update and boot the new kernel. Now if you’re not familiar with Linux as a whole and how there are many different distributions etc, this might seem a little confusing needing to update a kernel manually of sorts. Normally I would get the latest from the Software Updater in Linux Mint (like Windows Update) but an version newer than 5.13 has yet to become available.

So I did some googling about the kernel versions available and settled on the version 5.17 and set out to install/update to that version. I did encounter some problems which I will explain shortly but I found and followed a good resource here:

https://www.linuxcapable.com/how-to-install-linux-kernel-5-17-on-linux-mint-20-lts/

I did run the Timeshift backup first as instructed, and followed the instructions for Ubuntu Mainline repository NOT the TuxInvader PPA.

I only encountered on minor issue, which was again a security problem. When I hit reboot and launched Linux (I have a choice screen for dual boot), it wouldn’t launch as it had a problem because the kernel is unsigned. This is because most modern machines have some form of Secure Boot setup. Now you can get around this by creating a certificate of your own to sign it but it’s long and complicated and not for your average computer literature user, even as a Software Engineer I thought better of it. However if you wish to give it a go, check out this resource here:

https://ubuntu.com/blog/how-to-sign-things-for-secure-boot

The other alternative is to disable Secure Boot, which is the route I chose.

The whole concept of Secure Boot requires that there exists a trust chain, from the very first thing loaded by the hardware (the firmware code), all the way through to the last things loaded by the operating system as part of the kernel: the modules.

source: ubuntu.com

This is a security feature and my other half put this is context quite well with an example, ‘It’s all very well having a high security lock on you front door but if there is button to the right that says Disable Lock, what is the point’. As he said it was relatively easy to disable secure boot on my machine, just pop into bios on launch as switch it off on the toggle switch. Given it’s easy to switch off some security items as shown it’s probably best to put a password lock on the bios, but the average user probably doesn’t.

After I updated the bios, I then rebooted and it ran like a charm. Brought up the CMD once it had loaded the OS and called uname -a and it showed it was now running the 5.17 Linux Kernel. I then tried both my GOG/EPIC launchers and they ran too.

Hurrah I can now play ALL my games again.

So when I switched to Linux a year ago never did I think I would be doing what seemed like complex tasks so easily and working around problems which not everyone would be able to deal with quickly. It’s taken longer to write this post than it has to complete the job at hand. The other half joked after I was complete: ‘You’ll be writing your own kernels next’. Maybe, but I’m not there yet haha, one day?

Next Post

Previous Post

Leave a Reply

© 2024 ELE-WEB MULTIMEDIA