[Tool] Core Switcher - Force GD to use all cores equally!

So basically it’s behaving the same in Linux as most people’s on WIndows. Always heavy on Core 0. Does Linux have a tool in its “Task Manager” like in Windows that lets you manually turn cores on/off for your processes (in this case for the Grim Dawn.exe process)?

You might be able to do it manually and improve your situation at least until I can look into figuring out a script for you.

edit: I found this…
https://www.howtoforge.com/linux-taskset-command/

Which lets you do this thru the console. You’d want to figure out how to simply disable Core 0 and then reenable it for Grim Dawn.exe. I’ll keep looking to see if it can be done with a GUI-friendly app at all.

1 Like

I have an i7-6700K. First of all, the cores 0 and 1 are off for some reason every time the game starts. I might have done something in the past to cause this, but I don’t remember exactly.

Anyway, core 2 is the one getting most of the load, so I shut it off. But all it does is put the load on core 3. After turning core 2 back, the load is still on only one core. I tried turning on all cores, but whatever I do, the majority of the load is always on one core.

Ouch. The fact that your first 2 cores are always disabled on startup is a little concerning - and might have something to do with why it’s not playing ball with you. Do you have some app installed that meddles with your cores that you maybe set to do that? Or maybe you did something weird in the BIOS?

It’s only Grim Dawn. All of my other applications don’t have the first two shut off. I think I did something in the past when there was a suggestion to turn core 0 off in order to improve performance. My “cpus” go from 0-7, btw.

Could you try to use my 8core hotkey tool above and see if it maybe makes it behave better? Not saying it will but who knows, maybe.


@H_T_C

Found this if it’s any use…
http://linuxblog.darkduck.com/2012/12/how-to-change-cpu-affinity-of-cpu.html

1 Like

I’ve done the manual turning off / switching on Core 0 and now the processor load is more evenly distributed across its 4 cores. I have i9 9300f. Seems like GD can’t determine the number of cores in system on its own.

1 Like

Not that i’m aware: i just changed the colors a bit to better help read which “CPUs” were the more heavily utilized, but that’s pretty much all i can do.

Forgot to mention this before but i had 5 firefox tabs open while i was playing the game, and had them open when i took the pic.

That may be “a bit too much sand for my wee bit truck”: i ditched Windows permanently and moved to Linux not because i knew how to use it but rather because i got pissed off with Windows and had literally zero experience with Linux when i made the move.

Though i have some experience with Linux now, i think i’m still too much of a newb to mess around with stuff like that.

1 Like

Lol, fair enough. I’ll keep looking to see if someone out there made something noobie friendly. From what I’ve read so far it doesn’t seem that you can set core affinity out of the box in a GUI in Linux - which is a bit of damned shame if true.

1 Like

I tried your tool, but the same thing happens. Thanks for trying, though.

1 Like

If you figure out what the issue with the cores is let me know. If I come across anything or think of anything I’ll ping ya - I’m a bit stumped as to what could have happened to make it permanently behave that way.

@H_T_C

Could you open a terminal and put this command in: top -d 1

It should display a command line “task manager” that looks like this…

image

Do this after you have Grim Dawn running and then pop in that command and find Grim Dawn in the list (hopefully it shows there). I need the PID number for the GD process. If you get me that I can give you the terminal commands you need to disable and reenable the cores.

Hopefully these commands still work. The article I am reading them from dates to 2012 and sometimes they phase certain commands and stuff out in the Linux world.

1 Like

Is the info you seek in the pic above?

It is indeed. Now this is what you want to do:

After GD is running go to your terminal and put in this command:
taskset -pac 1,2,3,4,5 14889
That disables the first core (aka Core 0).

Maybe tab back into gd and run around for about 10 seconds to make sure it sets in then go back to the terminal and now enable all your cores with:
taskset -pac 0,1,2,3,4,5 14889

Then play the game for a minute or two and check your resource monitor to see if things are behaving better.

I should note that I don’t know if this command requires sudo first. It’s a possibility that if it denies you that you will have to type in sudo at the start of that command, and then enter your password when it prompts you.

1 Like

Before your reply, i had tested “top -d 1” again and it produced a different number for GrimDawn.

It doesn’t require sudo, btw.

After your latest reply, i entered the game again then checked “top -d 1” while in the game’s menu screen, then used the 1st command you posted, with the new number “top -d 1” gave me and the system manager changed to the following:

You can see how “CPU1” dropped from nearly 100% to almost nothing and the others became more “diverse”

I waited a bit then used your 2nd command with the proper number @ the end and got this, after about 10 or so seconds:

It most definitely has an effect but i’ll have to play a while with only the 1st command, and then with both to see if there are any differences that i can feel while gaming.

Many thanks, dude!

1 Like

@Anonymous918

An idea: you could possibly try using Process Lasso: https://bitsum.com

If you do - install it then start up GD. Tab over to Process Lasso. Find GD in its task list and right-click on it and select CPU Affinity > Always and then set it for ALL of your cores. Now whenever Process Lasso detects GD start up it will automatically switch it to all cores.

Then shut the game down and restart it to make Process Lasso do exactly that. Once that happens try disabling Core 0 and reenabling it (in Process Lasso) as discussed earlier. It’s a bit of a workaround and attempt to force your CPU to behave itself but maybe doing it this way will get it acting more normally for you.

I tried it out,I use afterburner to monitor cpu usage.

I disabled core 0, turned it back on 5~10 seconds later.

I tried the method with process lasso(disabled SMT).

The load shifted from core 0 to core 2, but it’s still overloaded (94-100%) in both scenarios.

The game still use very little resource from other cores(5~14%).

So the cpu usage with respect to cores is by no means a discrete uniform distribution.

What happens with SMT enabled?

It’s skipping Core 1 to Core 2 when you disable just Core 0?

Oh and welcome to the GD forums :slight_smile:

1 Like

Same thing.

The load shifted from core 0 to core 2, but it’s still overloaded (94-100%).

Yes, because I use afterburner and cpu usages are printed on screen,

so I’m pretty sure that’s the case.

What kinda CPU do you have? That’s some odd behavior.