intel / media-delivery

This collection of samples demonstrates best practices to achieve optimal video quality and performance on Intel GPUs for content delivery networks. Check out our demo, recommended command lines and quality and performance measuring tools.
MIT License
94 stars 29 forks source link

measure-perf/smt: segfault on perf. measurement via mediasdk samples on HEVC encoding #43

Closed dvrogozh closed 3 years ago

dvrogozh commented 4 years ago
$ docker build \
  $(env | grep -E '(_proxy=|_PROXY)' | sed 's/^/--build-arg /') \
  --file Dockerfile.ubuntu \
  --tag intel-media-delivery \
  .
$ docker run  -it --rm --device=/dev/dri/renderD128 --group-add=39 --cap-add SYS_ADMIN intel-media-delivery .

$ ffmpeg -an -hwaccel qsv -qsv_device /dev/dri/renderD128 \
  -c:v h264_qsv -i /opt/data/embedded/WAR_TRAILER_HiQ_10_withAudio.mp4 \
  -vf scale_qsv=w=-1:h=2160,vpp_qsv=framerate=60 \
  -c:v hevc_qsv -preset medium -profile:v main -b:v 1000000 -vframes 20 \
  -y /tmp/WAR.hevc

$ measure perf --verbose --skip-perf /tmp/WAR.hevc
#####################################################################
MSPERF (MULTI STREAMS PERFORMANCE) v0.20.06.03
#####################################################################

ACCEPTED !!! to continue with [utilization/metric/statistic] profiles

#####################################################################
 Profiling: WAR.hevc
 PASS: via FFMPEG/FFPROBE
 content_fps = 60.0 , content_height = 2160 , content_codec = hevc

#####################################################################
PNP MEDIA SMT HEVC-AVC: MULTISTREAM: 1 & ITERATION: 0 - WAR
#####################################################################
 [VERBOSE][CMD] /usr/share/mfx/samples/sample_multi_transcode -fps 60 -i::h265 /tmp/WAR.hevc -hw -async 1 -u 4 -gop_size 256 -dist 8 -num_ref 5 -vbr -b 9000 -NalHrdConformance:off -VuiNalHrdParameters:off -hrd 5000 -InitialDelayInKB 2500 -extbrc::implicit -ExtBrcAdaptiveLTR:on -o::h264 /opt/data/artifacts/measure/perf/output/WAR_hevc_0.h264  -device /dev/dri/renderD128 -p /tmp/perf/WAR_hevc_0_transcode_log.txt >> /tmp/perf/console_log.txt 2>&1

 [VERBOSE][LINUX_PERF_TOOLS] /opt/intel/samples/bin/performance/MSGo.py

 Exit early, hang/error in submitted commands: 239

NOTE: AVC looks working fine. < this was wrong, I mixed with different input stream, this seems input dependent

dvrogozh commented 4 years ago

This is related to extbrc:

# FAILS:
/usr/share/mfx/samples/sample_multi_transcode -fps 60 -i::h265 /tmp/WAR.hevc \
  -hw -async 1 -u 4 -gop_size 256 -dist 8 -num_ref 5 -vbr -b 9000 \
  -NalHrdConformance:off -VuiNalHrdParameters:off -hrd 5000 -InitialDelayInKB 2500 \
  -extbrc::implicit -ExtBrcAdaptiveLTR:on -o::h264 /opt/data/artifacts/measure/perf/output/WAR_hevc_0.h264  \
  -device /dev/dri/renderD128

# WORKS (no -extbrc::implicit):
/usr/share/mfx/samples/sample_multi_transcode -fps 60 -i::h265 /tmp/WAR.hevc \
  -hw -async 1 -u 4 -gop_size 256 -dist 8 -num_ref 5 -vbr -b 9000 \
  -NalHrdConformance:off -VuiNalHrdParameters:off -hrd 5000 -InitialDelayInKB 2500 \
   -ExtBrcAdaptiveLTR:on -o::h264 /opt/data/artifacts/measure/perf/output/WAR_hevc_0.h264 \
   -device /dev/dri/renderD128
dvrogozh commented 4 years ago

This is regression between 20.2.1 and 20.3.0 msdk releases.

dvrogozh commented 4 years ago

@jamesiwan : fyi

dvrogozh commented 3 years ago

This got fixed w/ 20.3.1 msdk release in a form of switching off MCTF. And updated package is available in the repositories.intel.com. For the sake of media-delivery this is enough to close the issue. We are awaiting for the msdk release update with re-enabled MCTF however.