rigaya / QSVEnc

QSVによる高速エンコードの性能実験
http://rigaya34589.blog135.fc2.com/blog-category-10.html
Other
304 stars 29 forks source link

Encoding slows down #188

Open MrWGT opened 5 months ago

MrWGT commented 5 months ago

Most of the time encoding 4k works flawless. But sometimes it slows down:

PG is not supported on this platform, switched to FF mode. adaptiveRef is not supported on current platform, disabled. cop.SingleSeiNalUnit value changed off -> auto by driver cop3.AdaptiveCQM value changed on -> auto by driver QSVEncC (x64) 7.58 (r3219) by rigaya, Jan 4 2024 01:08:43 (VC 1937/Win) OS Windows 11 x64 (22631) [UTF-8] CPU Info 13th Gen Intel Core i9-13900K [4.01GHz] (8P+16E,24C/32T) GPU Info Intel Arc A380 Graphics (128EU) 300-2450MHz (31.0.101.5186) Media SDK QuickSyncVideo (hardware encoder) FF, 1st GPU, API v2.10 Async Depth 3 frames Hyper Mode off Buffer Memory d3d11, 184 work buffer Input Info avqsv: H.265/HEVC, 3840x2160, 24000/1001 fps VPP Denoise pre, strength 10 cspconv(p010 -> yv12(16bit)) edgelevel: strength 3.0, threshold 20.0, black 0.0, white 0.0 cspconv(yv12(16bit) -> p010) Detail Enhancer, strength 20 AVSync cfr Output H.265/HEVC(yuv420 10bit) main10 @ Level 5 (high tier) 3840x1604p 1:1 23.976fps (24000/1001fps) avwriter: hevc, #1:ac3/5.1(side) -> eac3/5.1(side)/384kbps, subtitle#1, subtitle#2, subtitle#3, chap => matroska Target usage 1 - best Encode Mode ICQ (Intelligent Const. Quality) ICQ Quality 13 QP Limit min: 22, max: 63 Ref frames 6 frames Bframes 15 frames, B-pyramid: on Max GOP Length 144 frames Slices 8 VUI matrix:bt2020nc,colorprim:bt2020,transfer:smpte2084,range:limited,chromaloc:topleft MasteringDisp G(0.265000 0.690000) B(0.150000 0.060000) R(0.680000 0.320000) WP(0.312700 0.329000) L(4000.000000 0.005000) MaxCLL/MaxFALL 1000/419 Ext. Features PerMBRC RepeatPPS WeightP WeightB GPB AdaptiveLTR tskip ctu:64 sao:all [0.2%] 79 frames: 67.81 fps, 7181 kb/s, remain 0:11:31, GPU 94%, VD 98%, est out size 1676.1MB [0.2%] 154 frames: 78.01 fps, 8289 kb/s, remain 0:15:53, GPU 91%, VD 100%, est out size 3071.6MB [0.2%] 227 frames: 81.83 fps, 9921 kb/s, remain 0:19:26, GPU 91%, VD 99%, est out size 4718.1MB [0.3%] 303 frames: 84.57 fps, 9980 kb/s, remain 0:21:36, GPU 92%, VD 100%, est out size 5453.5MB [0.3%] 380 frames: 86.60 fps, 9698 kb/s, remain 0:23:13, GPU 94%, VD 100%, est out size 5834.4MB [0.3%] 455 frames: 87.65 fps, 10184 kb/s, remain 0:25:01, GPU 92%, VD 100%, est out size 6682.8MB [0.4%] 529 frames: 88.23 fps, 9711 kb/s, remain 0:25:59, GPU 92%, VD 99%, est out size 6667.4MB [0.4%] 604 frames: 88.82 fps, 9334 kb/s, remain 0:26:47, GPU 91%, VD 99%, est out size 6651.0MB [0.5%] 669 frames: 87.96 fps, 12958 kb/s, remain 0:27:55, GPU 74%, VD 82%, est out size 9532.7MB [0.5%] 745 frames: 88.52 fps, 16243 kb/s, remain 0:28:27, GPU 93%, VD 100%, est out size 12266.2MB [0.5%] 819 frames: 88.84 fps, 18593 kb/s, remain 0:29:20, GPU 92%, VD 99%, est out size 14526.3MB [0.6%] 894 frames: 89.17 fps, 22743 kb/s, remain 0:29:42, GPU 95%, VD 100%, est out size 18066.3MB [0.6%] 971 frames: 89.66 fps, 25889 kb/s, remain 0:30:00, GPU 95%, VD 100%, est out size 20903.5MB [0.6%] 1049 frames: 90.14 fps, 25791 kb/s, remain 0:30:17, GPU 96%, VD 97%, est out size 21141.0MB [0.7%] 1127 frames: 90.59 fps, 25359 kb/s, remain 0:30:53, GPU 97%, VD 98%, est out size 21305.0MB [0.7%] 1205 frames: 91.01 fps, 25719 kb/s, remain 0:31:04, GPU 96%, VD 99%, est out size 21846.3MB [0.7%] 1278 frames: 91.00 fps, 27356 kb/s, remain 0:31:14, GPU 92%, VD 100%, est out size 23373.4MB ... [5.8%] 11815 frames: 85.47 fps, 24909 kb/s, remain 0:37:28, GPU 73%, VD 77%, est out size 25263.5MB [5.8%] 11880 frames: 85.44 fps, 24921 kb/s, remain 0:37:29, GPU 80%, VD 84%, est out size 25280.5MB [5.9%] 11943 frames: 85.40 fps, 24937 kb/s, remain 0:37:29, GPU 74%, VD 79%, est out size 25296.9MB ... [10.4%] 21432 frames: 75.74 fps, 21729 kb/s, remain 0:40:37, GPU 66%, VD 55%, est out size 22257.3MB [10.4%] 21477 frames: 75.69 fps, 21737 kb/s, remain 0:40:38, GPU 52%, VD 55%, est out size 22262.7MB [10.4%] 21522 frames: 75.62 fps, 21724 kb/s, remain 0:40:39, GPU 57%, VD 61%, est out size 22246.5MB ... [18.8%] 39002 frames: 54.29 fps, 20317 kb/s, remain 0:51:36, GPU 31%, VD 32%, est out size 20918.0MB [18.8%] 39028 frames: 54.26 fps, 20321 kb/s, remain 0:51:38, GPU 30%, VD 32%, est out size 20927.0MB [18.9%] 39053 frames: 54.23 fps, 20318 kb/s, remain 0:51:38, GPU 38%, VD 35%, est out size 20920.2MB ... [26.3%] 54557 frames: 41.06 fps, 20389 kb/s, remain 1:02:04, GPU 21%, VD 22%, est out size 21035.4MB [26.3%] 54575 frames: 41.05 fps, 20387 kb/s, remain 1:02:05, GPU 22%, VD 23%, est out size 21034.3MB [26.3%] 54593 frames: 41.04 fps, 20387 kb/s, remain 1:02:06, GPU 22%, VD 22%, est out size 21034.5MB ... [34.4%] 71520 frames: 31.70 fps, 20474 kb/s, remain 1:11:37, GPU 15%, VD 17%, est out size 21148.7MB [34.4%] 71533 frames: 31.70 fps, 20473 kb/s, remain 1:11:37, GPU 16%, VD 17%, est out size 21147.3MB [34.4%] 71547 frames: 31.69 fps, 20473 kb/s, remain 1:11:37, GPU 16%, VD 18%, est out size 21146.1MB ... 40.6%] 84456 frames: 27.02 fps, 20710 kb/s, remain 1:16:08, GPU 14%, VD 16%, est out size 21407.4MB [40.6%] 84467 frames: 27.02 fps, 20713 kb/s, remain 1:16:08, GPU 12%, VD 12%, est out size 21408.6MB [40.6%] 84479 frames: 27.01 fps, 20712 kb/s, remain 1:16:08, GPU 13%, VD 12%, est out size 21406.7MB

As you can see the VD and GPU utilization drops down a lot. At the end of the encoding i'll get 8..12fps. My ARC A380 is nearly idling.

What could be the reason?

rigaya commented 5 months ago

Would you please have a check if Resizabe BAR is enabled? It can be check using GPU-Z.

GPUZ_resizable_bar_on_20240124_text

I've seen GPU clock and encoding speed dropping myself when Resizabe BAR was disabled.

If Resizabe BAR is enabled, I'm sorry but I currently don't have a idea now.

MrWGT commented 5 months ago

Resizable Bar is enabled and i've just a few movies with that behavior - maybe 5-10 out of 500. Don't know why. Other UHD movies are between ~70 to 100 fps.

rigaya commented 5 months ago

Unfortunately, I also have no idea, without filters I've faced that kind of issue, but not with filter enabled.

If GPU clock is falling down to 600MHz(= idle clock), --avoid-idle-clock on in QSVEnc 7.61 might help but I'm not sure.

pengu1981 commented 2 months ago

If GPU clock is falling down to 600MHz(= idle clock), --avoid-idle-clock on in QSVEnc 7.61 might help but I'm not sure.

This fixes the issue for me. I also experienced slowdowns while encoding (mostly 4k but also 1080p) on Intel Arc A380 (Resizabe BAR on).