cirosantilli/parsec-benchmark

Can anyone provide detailed steps to fix Host x264?

axiqia opened this issue · 2 comments

Hi, everyone,

The problem does not happen on Ubuntu 17.10’s x264 0.148.2795 after removing b-pyramid which is not a valid argument anymore it seems., so the easiest fix for this problem is to just take the latest x264 (as a submodule, please!!) and apply parsec roi patches to it (git grep parsec under x264/src).

I met the problem described here, but I dont know how to fix it. Can anyone provide detailed steps?

Thank you!

I was also getting *** Error in parsec-3.0/pkgs/apps/x264/inst/amd64-linux.gcc/bin/x264: double free or corruption (!prev): 0x0000000000f9ecb0*** when running x264. I tried with Parsec-2.1 as well, but it was still happening.

I believe what @************ meant is that you download a newer version of x264, like 0.148.2795, you unzip it, and you replace the version that comes with Parsec for this newer one. However, because the newer one will not have the __parsec_roi_begin() and __parsec_roi_end() calls, you'll have to add them manually, by looking at where were they placed in the older version, and placing them in the same place as the new one. This is why @************ maybe recommended to use git grep parsec in the older x264/src, so that it's easier to locate those lines. Personally, I downloaded this newer version, compiled it, and did a quick test to see if it worked using the same command and input that Parsec uses for x264. It did. However, I did not try to add the ROI patches yet.

Alternatively, instead of using a newer version of x264, you can still use the version that comes with Parsec, as long as you decrease the optimization of the compiler from O3 to O2. This solved it for me.

A quick way to do this:

  1. Edit parsec-3.0/config/gcc.bldconf and change O3 to O2 in lines:
export CFLAGS=" -O3 -g ..."
export CXXFLAGS="-O3 -g ..."
  1. After saving the edits, remove all previously compiled files of x264 with parsecmgmt -a fulluninstall -p x264 (don't forget that in order to use parsecmgmt you need to do source env.sh in the main parsec folder)
  2. Recompile x264 with parsecmgmt -a build -p x264
  3. Make sure that it works by doing a test run with parsecmgmt -a run -p x264
  4. Revert the changes made in step 1, so that you compile the rest of benchmarks with O3 optimization, as I assume it was meant to be.

With this you should see the following output:

[PARSEC] Benchmarks to run:  parsec.x264

[PARSEC] [========== Running benchmark parsec.x264 [1] ==========]
[PARSEC] Deleting old run directory.
[PARSEC] Setting up run directory.
[PARSEC] Unpacking benchmark input 'test'.
eledream_32x18_1.y4m
[PARSEC] Running 'time parsec-3.0/pkgs/apps/x264/inst/amd64-linux.gcc/bin/x264 --quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto --b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7 --analyse b8x8,i4x4 --threads 1 -o eledream.264 eledream_32x18_1.y4m':
[PARSEC] [---------- Beginning of output ----------]
PARSEC Benchmark Suite Version 3.0-beta-20150206
yuv4mpeg: 32x18@25/1fps, 0:0

encoded 1 frames, 1992.03 fps, 165.00 kb/s

real	0m0.006s
user	0m0.000s
sys	0m0.003s
[PARSEC] [----------    End of output    ----------]
[PARSEC]
[PARSEC] BIBLIOGRAPHY
[PARSEC]
[PARSEC] [1] Bienia. Benchmarking Modern Multiprocessors. Ph.D. Thesis, 2011.
[PARSEC]
[PARSEC] Done.

Thanks,
Antonio

If someone sends a patch with newer x264 with ROIs (I'd rather not reduce optimization levels as that can make architecture research less relevand) I'll merge it BTW.