Crusader Kings III

Crusader Kings III

View Stats:
N00byEdge Sep 2, 2020 @ 9:48am
Read this if you're getting lag spikes on linux
I started getting lag spikes when playing ck3 on linux, I was getting a ~3 second freeze every ~5 seconds, so the game was pretty much unplayable

I started debugging it during the spikes and it seemed to be taking a while to poll my input devices (I don't know for what). A few minutes later I managed to get rid of the spikes. Let's keep it short:
Write the byte 0xC3 (x86 ret) at ck3 executable file offset 0x20F069A, to stop the input polling function from doing anything. The game still plays just fine without this function.
Last edited by N00byEdge; Sep 2, 2020 @ 9:58am
< >
Showing 1-15 of 19 comments
Messsucher Sep 2, 2020 @ 12:03pm 
Cool beans, thanks of this information, but haven't had any problems on Linux.
mega Sep 2, 2020 @ 9:37pm 
Will this trigger any kind of cheat detection? I want this problem gone but I'm not willing to get banned from anything.
Bordric Sep 2, 2020 @ 9:38pm 
Windows 10, never a pause or spike.
N00byEdge Sep 2, 2020 @ 9:49pm 
@Mega I don't think there is any on CK3.
helle Sep 3, 2020 @ 10:57am 
I have this problem but your fix just makes the game crash right away. Has there been an update to the binary in the meantime?
ElricleNecro Sep 3, 2020 @ 11:21am 
The binary was updated by steam today for me.
A workaround was proposed on the paradox forum : run the following command before you run the game :
sudo chmod o-rx /dev/input
It prevent the game to scan all device you have on your computer, since this is apparently the cause of those lags.

Edit: if your user is in the group input, you may also need to remove the right for the group, so :
sudo chmod g-rx,o-rx /dev/input
Last edited by ElricleNecro; Sep 3, 2020 @ 11:23am
helle Sep 3, 2020 @ 3:04pm 
@ElricleNecro that worked for me, thank you!
ElricleNecro Sep 3, 2020 @ 3:05pm 
You're welcome!
mega Sep 3, 2020 @ 9:08pm 
Originally posted by ElricleNecro:
A workaround was proposed on the paradox forum

Was it proposed by the devs? Knowing that the devs know about the problem would be reassuring.
Last edited by mega; Sep 3, 2020 @ 9:08pm
ElricleNecro Sep 4, 2020 @ 1:40am 
The workaround was found by players. The dev know about the problem, but they can't reproduce it apparently.
You can find the discussion here (with what the community found) : https://forum.paradoxplaza.com/forum/threads/ck-iii-stutting-performance.1414739/
mega Sep 4, 2020 @ 4:22am 
Cool, thanks for that.
DoctorZeus Sep 7, 2020 @ 4:34am 
Originally posted by ElricleNecro:
The binary was updated by steam today for me.
A workaround was proposed on the paradox forum : run the following command before you run the game :
sudo chmod o-rx /dev/input
It prevent the game to scan all device you have on your computer, since this is apparently the cause of those lags.

Edit: if your user is in the group input, you may also need to remove the right for the group, so :
sudo chmod g-rx,o-rx /dev/input

Thanks for the fix! :)

However surely this could potentially cause problems with other applications by denying them access to available input devices in /dev/input?

Why not isolate Crusader Kings 3 itself instead (I am using firejail in this example):

From the CK3 "Crusader Kings III/binaries" directory:
firejail --noprofile --blacklist="/dev/input" ./ck3

I did however occasionally get audio crackling with this one for some reason (not entirely sure why) so you can also just exit steam or the paradox launcher and do this to the entire application:

e.g:

If you have the paradox launcher directly (from the launcher directory):
firejail --noprofile --blacklist="/dev/input" ./dowser

EDIT (thanks to comment by MEGA):

If you have the steam version simply add the following to the CK3 launch options:

PULSE_LATENCY_MSEC=60 firejail --noprofile --blacklist="/dev/input" %command%

UPDATE: Adding "PULSE_LATENCY_MSEC=60" before command should solve audio issues.
Last edited by DoctorZeus; Sep 18, 2020 @ 12:05am
mega Sep 7, 2020 @ 4:48am 
Couldn't you just put this in the launch options?
firejail --noprofile --blacklist="/dev/input" %command%
DoctorZeus Sep 7, 2020 @ 7:40am 
Originally posted by Mega:
Couldn't you just put this in the launch options?
firejail --noprofile --blacklist="/dev/input" %command%

Or that would be easier yes! :steamhappy:
mega Sep 7, 2020 @ 7:10pm 
Originally posted by DoctorZeus:
Originally posted by Mega:
Couldn't you just put this in the launch options?
firejail --noprofile --blacklist="/dev/input" %command%

Or that would be easier yes! :steamhappy:
It actually doesn't work well. The Paradox launcher doesn't seem to be able to launch the game and load the last save correctly(the "resume" button). This has wiped out my save from when I last closed the game so do not do this.
< >
Showing 1-15 of 19 comments
Per page: 1530 50

Date Posted: Sep 2, 2020 @ 9:48am
Posts: 19