OpenVisualCloud / SVT-HEVC

SVT HEVC encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
516 stars 172 forks source link

Got "Killed" when executed SvtHevcEncApp #542

Closed peipeiguo closed 4 years ago

peipeiguo commented 4 years ago

Hi all,

I got "killed" problem when executed SvtHevcEncApp to encode 8K yuv with tile. Does anyone know the reason? command line:

guopeipei@ubuntu:/mnt/hgfs/8K_Girl$ SvtHevcEncApp -i 2_1min.yuv -w 7680 -h 3840 -fps 30 -base-layer-switch-mode 1 -intra-period 4 -irefresh-type 0 -vid-info 1 -rc 1 -tbr 62914560 -umv 0 -tile_slice_mode 1 -tile_row_cnt 12 -tile_col_cnt 12 -b 2_1min_hd.hevc
-------------------------------------------
SVT-HEVC Encoder
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 7.5.0    64 bit
LIB Build date: Jun 17 2020 23:49:20
-------------------------------------------
Number of logical cores available: 2
Number of PPCS 71
------------------------------------------- 
SVT [config]: Main Profile  Tier (auto) Level (auto)    
SVT [config]: EncoderMode / Tune                            : 7 / 1 
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat         : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo              : 7680 / 3840 / 0
SVT [config]: FrameRate / Gop Size                          : 30 / 5 
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure          : 3 / 1 / 2 
SVT [config]: RCMode / TargetBitrate / LAD / SceneChange / QP Range [10 ~ 48]       : VBR / 62914560 / 4 / 1 
SVT [config]: BitRateReduction / ImproveSharpness                   : 0 / 0 
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV        : 12 / 12 / 1 / 1
SVT [config]: De-blocking Filter / SAO Filter                       : 1 / 1 
SVT [config]: HME / UseDefaultHME                           : 1 / 1 
SVT [config]: MV Search Area Width / Height                         : 16 / 7 
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                 : 0 / 0 / 0 / 90
------------------------------------------- 
Killed
guopeipei@ubuntu:/mnt/hgfs/8K_Girl$ 

My env is:

guopeipei@ubuntu:/mnt/hgfs/8K_Girl$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
guopeipei@ubuntu:/mnt/hgfs/8K_Girl$ 

I built SVT-HEVC with ./build.sh release shared install and today's master.

Thanks.

peipeiguo commented 4 years ago

Checked the /var/log/syslog, it shows below: image

tianjunwork commented 4 years ago

Hi @peipeiguo , there is nothing wrong with your svt build and os. What happened here is memory needed by svt 8k encoding exceeds the available memory on your system. Similar issue can be found here: https://github.com/OpenVisualCloud/SVT-HEVC/issues/221

peipeiguo commented 4 years ago

Hi @tianjunwork ,

Thanks for your kindly reply. I have checked that issue. The difference is I just run one 8K encoding task, but it still out of memory. For 8K, does svt must need 64G memory to work? Why svt need so much memory?

Thanks.

tianjunwork commented 4 years ago

Yeah, #221 the encoder runs on Xeon 8180 112 logical cores, usually with very large RAM. I assume your platform is client pc with 2 logical cores, the RAM may not be very large?

Below shows the memory increase on my system when running 8K encode with SVT-HEVC. Around 24G usage.

 $ free -m
              total        used        free      shared  buff/cache   available
Mem:         159880        2435      149910         145        7534      155027
Swap:        162520        1131      161389

 $ free -m
              total        used        free      shared  buff/cache   available
Mem:         159880       26942      125402         145        7535      130519
Swap:        162520        1131      161389

The high speed encoding doesn't come for free. Encoder reads frames in and processes them in parallel. Since the input is 8k, it may drain memory on your system.

tianjunwork commented 4 years ago

Hi @peipeiguo , anything else to discuss on this topic?

peipeiguo commented 4 years ago

Hi @tianjunwork ,

I see, thanks for your detailed reply. I use VM on my PC, so the memory is not enough. By the way, is there any way to set the some options/parameters or change code to make SVT work on my VM? Of cource, I can accept the encoding speed goes down.

Thanks.

tianjunwork commented 4 years ago

Yes, you can try -lp 1 which reduces the memory allocation and pins all processes on 1st logical core. You may also experiment with -lp 2(since you have 2 logical cores on the platform).

peipeiguo commented 4 years ago

I tried with -lp 1 and -thread-count 1, it still got "killed". Command line: SvtHevcEncApp -i 5_30.yuv -w 7680 -h 3840 -fps 30 -lp 1 -thread-count 1 -hierarchical-levels 0 -pred-struct 0 -intra-period 4 -irefresh-type 0 -vid-info 1 -rc 1 -tbr 62914560 -umv 0 -tile_slice_mode 1 -tile_row_cnt 12 -tile_col_cnt 12 -b 5_30.hevc

Maybe I can only expand My PC's memory...

tianjunwork commented 4 years ago

Using -lp 1, your command line takes about 16Gb memory, if it still got killed, you do need larger RAM. Also, encoder can't fully perform its scalability with only two logical cores, You may consider upgrade to multi-core CPU also for speed critical task.

peipeiguo commented 4 years ago

OK, will do that. Thank you :)