Ryzen 3900x performance issue

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Ryzen 3900x performance issue

Post by unknown User »

Description of problem or question:
Hi, I found a strange behavior relating to the max usage of the referred CPU. Im running Kernel 5.3 and the system works absolutely smooth at all points. But enforcing the max CPU-load by ripping via handbrake leads to a short waved up and down of the load-graph. The average usage dangles approximatlely at 65%. Can somebody confirm this behavior? Is that just a graphical issue, do I miss to set something special or is the 3000 serial just too new and will perform normally due to the next updates?



Steps to reproduce the problem (If Applicable):




HandBrake version (e.g., 1.0.0):
1.2.2-2



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Manjaro x64 GNOME, Kernel 5.3



HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

Please replace this text with the contents of your log file between the two code tags - OR -  provide a pastebin URL in place of these 3 lines.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Ryzen 3900x performance issue

Post by Woodstock »

Without a log, we can't help much. Settings influence speed, especially filters selected. Some filters can bottle-neck an encode.

Also, where you obtain your handbrake version can affect things, because distro packagers often produce known-broken versions of handbrake, to satisfy their particular software preferences.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

https://pastebin.com/G7e6FTpt
I hope this log is useful
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Ryzen 3900x performance issue

Post by Woodstock »

Is the 65% you're seeing across all cores, or just the active ones? With 12 cores/24 available threads, this configuration is not going to involves all available cores. Depending on how you're viewing the processor load, you might have half the cores at 100%, and the rest idling along with nothing to do.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

The GNOME System Monitor shows every core waving up and down together. Psensor shows just one zig zag line with an average usage nearly at 60 - 65%.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Ryzen 3900x performance issue

Post by Ritsuka »

Disable the Decomb and Comb Detect filter, if your source is progressive you don't need them.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

Ok I'll give it a try. But in the past I'd never to disable anything special for full CPU usage. I'm just a little confused about what "Woodstock" wrote.
..."this configuration is not going to involves all available cores." Why not?? And how can I manage to "convince"^^ Handbrake to use every available core? Do I have to disable SMT?
tlindgren
Bright Spark User
Posts: 260
Joined: Sun May 03, 2009 2:14 pm

Re: Ryzen 3900x performance issue

Post by tlindgren »

unknown User wrote: Thu Oct 17, 2019 8:37 am Ok I'll give it a try. But in the past I'd never to disable anything special for full CPU usage. I'm just a little confused about what "Woodstock" wrote.
..."this configuration is not going to involves all available cores." Why not?? And how can I manage to "convince"^^ Handbrake to use every available core? Do I have to disable SMT?
Scaling almost anything to use many cores is hard and most algorithms tend to stop scaling to more cores at some point. How many cores Handbrake can effectively utilize depending encoder (x264 vs x265), resolution, input type and which filters you use (if any).

IE, the encoder pipeline can't go faster than the slowest stage in it, and some filters are slow and will only use one cpu so if you use them on a many-core machine it can severely limit encoding speed. So always test without any filters to see if that's the cause.

But the reality is that 24 threads is usually more than any common video encoder is going to be able to use right now so for maximum throughput/cpu utilization you'll likely need to run more than one encoding at the same time, the drawbacks is that each individual encode would take longer.

Disabling SMT (so the machine only see 12 threads instead of 24) would increase the CPU utilization percentages but... it would likely run slower or at best very slightly faster with likely less nice experience if you used the machine at the same time.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

Ok! First, thank you guys for your quick response and effort. A few things I can understand, a few not. But before going for the details I'll check your suggestions and report back afterwards.
So long!
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

So here is a log of h.264 encoding: https://pastebin.com/CKC4h5p7
Maximum CPU utilization is given and the encoding speed is simply awesome. I didn't disable any filter and it runs like the devil despite. So there must be something dishamonious between h.265 my settings or/and my CPU.
Any ideas?
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Ryzen 3900x performance issue

Post by s55 »

That log is for h.265

Your also not running any filters.

CPU scaling varies wildly depending on source, settings and hardware chosen. So, what your seeing is perfectly normal.
HandBrake will always try use as much as possible for a given input, but in some instances, there are bottlenecks. That's just how the process works.

Higher Resolution source content, no filters and x264/5 will generally do quite well. 5 might scale a bit better than 4.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

Oops, sorry.. I copied it from the activity window and there seem to appear every log from the beginning. The last one down below is the h.264 log.
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Ryzen 3900x performance issue

Post by s55 »

Your using Placebo preset a lot in there. Not a good idea. You probably don't need to go past "Slow". Probably quite a bit faster with no real human noticeable difference. In the case of x265, some versions actually produce worse results using placebo

Also note, x265 is orders of magnitude slower than x264 anyway since it's a much more complex process to encode into h265
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

Ok, your last point is what I expected. That's why I bought this monster of CPU. What I don't really get is why h.264 is using the entire CPU power with every core at nearly 100% and h.265 lets the load swing in a sinus curve. Although it needs much more resources to encode it uses just the half. For me as a layman it seems h.264 is using the CPU right and h.265 doesn't recognize there still is more power to use.

That placebo isn't a good idea is new for me. I always thought it's the compression level at given quality defined by the RF slider.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Ryzen 3900x performance issue

Post by mduell »

Some of the ways H.265 achieves better efficiency also limit the opportunities for encode parallelism.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

Following the instructions of "s55" switching to slow increases the encoding speed immense of course. Now the load graph does not swning with such a big amplitude from 15% to 95% but a bit more eqaualized from 40% to 60%.
My last question related to this topic is, why is the tech focused press using handbrake and h.265 for benchmarking and CPU comparisons when the load can not reach the maximum?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Ryzen 3900x performance issue

Post by mduell »

HB/H.265 is a common compute intensive task a lot of people do, and the new super-high-core-count CPUs are not particularly well suited for it.

Or journalists are idiots.
Deleted User 11865

Re: Ryzen 3900x performance issue

Post by Deleted User 11865 »

Or people simply want to know how a given encoder is going to perform on a given CPU. Whether it reaches 100% CPU usage is not necessarily relevant.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

mduell wrote: Fri Oct 18, 2019 8:29 pm HB/H.265 is a common compute intensive task a lot of people do, and the new super-high-core-count CPUs are not particularly well suited for it.

Or journalists are idiots.
Well, idiots really seem to be around.
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

Rodeo wrote: Fri Oct 18, 2019 8:34 pm Or people simply want to know how a given encoder is going to perform on a given CPU. Whether it reaches 100% CPU usage is not necessarily relevant.
Strange but maybe. Thank you ;-)
Deleted User 13735

Re: Ryzen 3900x performance issue

Post by Deleted User 13735 »

Your Ryzen runs 12 cores and 24 threads, which I consider "hyperoptimal" for video rendering. It's the law of diminishing returns from distributed rendering.

See if you can run six or eight logical processes in the Affinity setting for Handbrake.exe
You may be mildly surprised if there is an effect on CPU and render times.
Deleted User 11865

Re: Ryzen 3900x performance issue

Post by Deleted User 11865 »

Not sure how much difference it would make, but you could try adding additional threads to the x265 pool in the advanced options text box.

Code: Select all

strong-intra-smoothing=0:rect=0
to

Code: Select all

strong-intra-smoothing=0:rect=0:pools=36
unknown User
Posts: 33
Joined: Sat Mar 18, 2017 10:28 am

Re: Ryzen 3900x performance issue

Post by unknown User »

I tested it, thank you, but it has no effect. In the meantime I'm fine with using two instances of handbrake at the same time. Simultaneous encoding is a pretty thing that was never a question due to the lack of CPU power. This way the load is nearly at 100%.
There still is another matter I don't understand.
A few lines above "s55" wrote placebo isn't a good idea. Even very slow and slower producing lager files than slow. Is that intended? I thought the slower the preset the better the compression.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Ryzen 3900x performance issue

Post by mduell »

The constant quality scale isn't the same across different speed presets, only across different sources.
Post Reply