LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How To Make Ryzen 5600X Run Full Speed Compiling? (https://www.linuxquestions.org/questions/slackware-14/how-to-make-ryzen-5600x-run-full-speed-compiling-4175717728/)

SlackIT 10-13-2022 07:10 PM

How To Make Ryzen 5600X Run Full Speed Compiling?
 
Hello,

Since getting a Ryzen 5600X, I've noticed in Slack it doesn't compile at full speed.

For the most part, it's compiling on average at only 2.2ghz, but of course I do see the speeds fluctuating up and down, sometimes, for a brief moment it will hit full speed.

I really don't want this conversative/performace approach the cpu takes when compiling, only using what it thinks it needs, I just want it rulling at full clock speeds, when I compile.

The governor is onedemand, so I'm assuming this is the issue.

But is it possible to have it run full clock when compiling, and not fluctuate, with ondemand?

THANKS

marav 10-13-2022 07:34 PM

https://www.phoronix.com/review/amd-renoir-cpufreq
https://www.phoronix.com/review/amd-ryzen-cpufreq

Code:

Ondemand - Commonly the default, it scales the the driver based on current load and will
usually go to the highest state then dropping back as deemed appropriate.

Performance - Aiming for running the CPU at its maximum frequency.

Schedutil - Schedutil is the newest governor and it's about making use of information from
the Linux kernel's scheduler to try to better change the CPU frequency in a timely manner
based on the scheduler utilization metrics.

Powersave - Powersave is a common governor for those looking to extend their battery life or
 reduce power consumption by running at the lowest frequency state for longer periods of time.

Conservative - This is similar to powersave in its approach and prefers running at lower
frequencies for longer periods of time.


SlackIT 10-13-2022 07:50 PM

Quote:

Originally Posted by marav (Post 6386226)
https://www.phoronix.com/review/amd-renoir-cpufreq
https://www.phoronix.com/review/amd-ryzen-cpufreq

Code:

Ondemand - Commonly the default, it scales the the driver based on current load and will
usually go to the highest state then dropping back as deemed appropriate.

Performance - Aiming for running the CPU at its maximum frequency.

Schedutil - Schedutil is the newest governor and it's about making use of information from
the Linux kernel's scheduler to try to better change the CPU frequency in a timely manner
based on the scheduler utilization metrics.

Powersave - Powersave is a common governor for those looking to extend their battery life or
 reduce power consumption by running at the lowest frequency state for longer periods of time.

Conservative - This is similar to powersave in its approach and prefers running at lower
frequencies for longer periods of time.



Not sure why you are posting all this, that I already know.

Please read my post again, I'm looking for a solution here, on how to use ondemand, but have compiling at full speed. :)

Daedra 10-13-2022 09:17 PM

What is your motherboard? It might be worth looking at what your PBO is set to.

pan64 10-14-2022 12:30 AM

Compiling can be slow for example when the storage device is slow. The compiler need to write a lot of files during compilation.
From my side I would increase the number of parallel threads at least to 2xN or 3xN (N is the number of cores). And you will see if that will make any difference.

SlackIT 10-14-2022 01:11 AM

It's an Asus B550-F Gaming mobo, PBO is all default, except I put a Negative 28 to slighty undervolt it. But I still see that it will hit the Boost speeds of 4x

Not sure as an example for N, how you'd apply that to compiling the kernel...

I don't think what I am seeing is about storage dragging it down, I'm using a Samsung 860 SSD.

marav 10-14-2022 01:19 AM

Quote:

Originally Posted by SlackIT (Post 6386228)
Not sure why you are posting all this, that I already know.

Please read my post again, I'm looking for a solution here, on how to use ondemand, but have compiling at full speed. :)

Oups
Sorry, I don't do magic

SlackIT 10-14-2022 01:52 AM

I went back and put the BIOS on all default settings, so now PBO is at AUTO.

Coming from the Intel world, of course on an i7 it has boost freq. too, but for some reason, when I compiled before on my i7 box, it would always stay at the max turbo boost clocks.

But this 5600x only boosts up to it for a brief moment, then clocks down, my understanding, from what I've read, because the CPU is supposedly designed to be more efficent, and only uses what it needs, but then that doesn't make sense when compiling, that it won't hit the max boost clocks and just stay there for the entire compiling. I mean, what the flip, max clocks speeds equals faster compile times, so I don't get the design thinking here. hmm :/

elcore 10-14-2022 01:59 AM

1. TMP in RAM (tmpfs), there were talks over the last couple of years where tmpfs outperforms any filesystem.
2. cpufreq-set -g performance should be enough (or -g userspace and manually specify the freq, see man cpufreq-set and cpufreq-info).
3. make -j12 is the most I used on dual core amd, requires a bit more RAM but works well until it starts to swap.

I'd generally use number of physical cores X 2 at minimum, X 6 at maximum
BIOS default for virtual cores is usually physical X 2, but for make jobs you could use physical X4 if there's enough RAM.

SlackIT 10-14-2022 02:03 AM

cpufreq-set -g performance is on the fly settings?

For the kernel CPU options for the Ryzen 5600x, is it better to use Opteron/Athlon64/Hammer/K8?

schedutil is listed as the default in the kernel, but in /etc/default/cpufreq it has; SCALING_GOVERNOR=ondemand so I don't get why schedutil isn't listed in /etc/default/cpufreq?

pan64 10-14-2022 02:16 AM

Quote:

Originally Posted by SlackIT (Post 6386262)

I don't think what I am seeing is about storage dragging it down, I'm using a Samsung 860 SSD.

Do not think or assume anything. Just try it. And you will definitely know the answer.

marav 10-14-2022 02:25 AM

Quote:

Originally Posted by SlackIT (Post 6386269)
cpufreq-set -g performance is on the fly settings?

I use this:
Code:

for (( c=0 ; c<=$(expr $(nproc) - 1) ; c++ )) ; do cpufreq-set -c$c -g <SCALING GOVERNOR> ; done
Quote:

Originally Posted by SlackIT (Post 6386269)
For the kernel CPU options for the Ryzen 5600x, is it better to use Opteron/Athlon64/Hammer/K8?

Don't know if it's better
Gentoo recommend it as an optimization for AMD processor
https://wiki.gentoo.org/wiki/Handboo..._configuration

SlackIT 10-14-2022 02:27 AM

Quote:

Originally Posted by pan64 (Post 6386272)
Do not think or assume anything. Just try it. And you will definitely know the answer.


I have increased the parallel threads before, it doesn't do anything, the CPU still runs the way it wants to run, that's the design of this thing.

Also cpufreq-set -g performance doesn't do anything, that just has it run at the full Base Clock Speed, I'm talking about having it run at the full Boost/Turbo Speed.

Do any of you actually own a 5600x?

I am talking about running it at Full Turbo/Boost speeds, and I don't remember if Intel acts the same way too, but as I mentioned, my i7 would run at and stay at full turbo speeds when compiling.

SlackIT 10-14-2022 02:47 AM

Quote:

Originally Posted by elcore (Post 6386268)
1. TMP in RAM (tmpfs), there were talks over the last couple of years where tmpfs outperforms any filesystem.
2. cpufreq-set -g performance should be enough (or -g userspace and manually specify the freq, see man cpufreq-set and cpufreq-info).
3. make -j12 is the most I used on dual core amd, requires a bit more RAM but works well until it starts to swap.

I'd generally use number of physical cores X 2 at minimum, X 6 at maximum
BIOS default for virtual cores is usually physical X 2, but for make jobs you could use physical X4 if there's enough RAM.

make -j12 is working the best, but the Boost Clock on these things is 4.7ghz and I'll see mine hit this, but for some reason make -j12 has it sitting the entire time at 4.4ghz, not sure why it's not going all the way to 4.7ghz... hmm

THANKS

P.S. Compiling 5.19.15 with make -j12 was only 4 mins! HOLY CRAP, this thing blazes, I've never compiled a kernel that fast before... LOL

pan64 10-14-2022 03:31 AM

Quote:

Originally Posted by SlackIT (Post 6386277)
I have increased the parallel threads before, it doesn't do anything, the CPU still runs the way it wants to run, that's the design of this thing.

Quote:

Originally Posted by SlackIT (Post 6386281)
Compiling 5.19.15 with make -j12 was only 4 mins! HOLY CRAP, this thing blazes, I've never compiled a kernel that fast before... LOL

So what is the design?
Never mind, just do not assume anything....
And you can also try -j100. That will definitely use the full power of your system.


All times are GMT -5. The time now is 10:56 AM.