Script to help with cross compiling

Announcements made by users.
hydra3333
Posts: 111
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Sat Jan 21, 2017 1:45 pm

I got excited when I saw your post on npp, for the same reason - speedy gpu resizing.

I did get 64bit DGDecodeNV to work in vapoursynth, which does do GPU deinterlacing and re-sizing. I found that where I needed to do both of these things, eg 1080i -> 576p (lesser storage space for lesser valued videos) plus ffmpeg's unsharp, all using GPU, then piping vapoursynth/DGDecodeNV results into ffmpeg sped up the end-to-end transforming/encoding process immensley as compared to native ffmpeg alone.

I did then start to go looking for GPU based filters including sharpeners however was advised this http://forum.doom9.org/showthread.php?p ... ost1793683
I believe that my filter is the exception, not the rule.
Do not focus yourself on gpu based filters.
after looking at KNLMeansCL as a GPU denoiser.

BiDouiLle
Posts: 42
Joined: Wed Oct 17, 2012 7:45 am
Location: Corsica

Re: Script to help with cross compiling

Post by BiDouiLle » Sun Jan 22, 2017 3:13 pm

For the de-interlacing part I know we can use the ones integrated in the hardware decoders like qsv and cuvid, but dunno if it's enough quality driven to use it.

hydra3333
Posts: 111
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Sun Jan 22, 2017 3:17 pm

BiDouiLle wrote:For the de-interlacing part I know we can use ... cuvid ...
For me, cuvid yields heaps of error messages and then mostly crashes (mpeg2 input).

Do you have an example commandline which does those things and works for you, so I can try it out ?

hydra3333
Posts: 111
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Fri Jan 27, 2017 10:02 am

hydra3333 wrote:I wouldn't pin any hope on using npp for GPU scaling, from the looks of this thread; these are links to a couple of posts in it, alluding to bugs nvidia doesn't seem to want to address, as at Sept 2016:
http://ffmpeg.org/pipermail/ffmpeg-trac ... 36160.html
http://ffmpeg.org/pipermail/ffmpeg-trac ... 36609.html
The npp_scale filter may need to be declared as deprecated.
It may only be the filter will get removed due to this lack of
support, for having a low image quality and being bound to a specific
hardware and an external library.
It's then better to give users a "heads up" by declaring it as deprecated,
not to make it a secret, and to hope it's going to change in the future.
I'm giving up on npp now
That may be out of date advice ? per http://forum.videohelp.com/threads/3821 ... ost2475277
rigaya has a website about the tool NVEncC as you know, http://rigaya34589.blog135.fc2.com/blog-entry-739.html
and that makes no bones about using nvidia's npp facilities based on nvidia cuda toolkit v8 at http://docs.nvidia.com/cuda/index.html#axzz4WxBhA7k1 and http://docs.nvidia.com/cuda/npp/index.h ... z4WxBhA7k1
which may well be about or after the date of complaints about npp in http://ffmpeg.org/pipermail/ffmpeg-trac ... 36160.html and http://ffmpeg.org/pipermail/ffmpeg-trac ... 36609.html
... so nvidia cuda toolkit v8 may have addressed those issues and npp may be "ok" after all ?

I also see you can build NVEncC yourself from code at github https://github.com/rigaya/NVEnc which seems attractive.

hydra3333
Posts: 111
Joined: Sun Apr 28, 2013 1:03 pm
Contact:

Re: Script to help with cross compiling

Post by hydra3333 » Mon Aug 14, 2017 11:44 pm

ok, having another go at trying npp with sdk 8.0.61 in x64 ffmpeg static, using a hack of rdp's wonderful script. Need your thoughts though.

So, put the npp/cuda sdk headers and whatnot in the right places and created some variables

Code: Select all

which_cuda="cuda_8.0.61"
npp_config_libs=" --extra-cflags=-I/usr/${which_cuda}/cuda/include --extra-ldflags=-L/usr/${which_cuda}/cuda/lib/x64 --extra-cflags=-I/usr/${which_cuda}/npp/include --extra-ldflags=-L/usr/${which_cuda}/npp/lib/x64 --extra-libs=-lnppi --extra-libs=-lnppc " 
npp_config_options=" --enable-libnpp ${npp_config_libs} " 
npp_config_libs_lsw=" --extra-cflags=-I/usr/${which_cuda}/cuda/include --extra-ldflags=-L/usr/${which_cuda}/cuda/lib/x64 --extra-cflags=-I/usr/${which_cuda}/npp/include --extra-ldflags=-L/usr/${which_cuda}/npp/lib/x64 --extra-libs=-lnppi --extra-libs=-lnppc " 
echo "npp_config_options=${npp_config_options}"
echo "npp_config_libs=${npp_config_libs}"
echo "npp_config_libs_lsw=${npp_config_libs_lsw}"
hacked a couple of things to see what happens eg

Code: Select all

build_lsmash() { # an MP4 library
echo "---------------------------------------------------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
echo "build_lsmash \"${1}\""
echo "---------------------------------------------------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
  do_git_checkout https://github.com/l-smash/l-smash.git l-smash
  cd l-smash
    #generic_configure "--prefix=$mingw_w64_x86_64_prefix --cross-prefix=$cross_prefix ${npp_config_libs_lsw} "
    ./configure --prefix=$mingw_w64_x86_64_prefix --cross-prefix=$cross_prefix ${npp_config_libs_lsw} || exit 1 # rebuilding needs it
    do_make_and_make_install
  cd ..
  #read -p "after build_lsmash - Press Enter to continue... or control-C if not happy"
}

Code: Select all

build_lsw() {
echo "---------------------------------------------------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
echo "build_lsw \"${1}\""
echo "---------------------------------------------------------------------------------------------------"
echo "---------------------------------------------------------------------------------------------------"
   # Build L-Smash-Works, which are plugins based on lsmash
   #build_ffmpeg static # dependency, assume already built
   build_lsmash # dependency
   do_git_checkout https://github.com/VFR-maniac/L-SMASH-Works.git lsw
   cd lsw/VapourSynth
     #generic_configure "--prefix=$mingw_w64_x86_64_prefix --cross-prefix=$cross_prefix ${npp_config_libs_lsw} "
     ./configure --prefix=$mingw_w64_x86_64_prefix --cross-prefix=$cross_prefix --target-os=mingw ${npp_config_libs_lsw}  || exit 1
     do_make_and_make_install
     # AviUtl is 32bit-only
     if [ "$bits_target" = "32" ]; then
       cd ../AviUtl
       #generic_configure "--prefix=$mingw_w64_x86_64_prefix --cross-prefix=$cross_prefix ${npp_config_libs_lsw} "
       ./configure --prefix=$mingw_w64_x86_64_prefix --cross-prefix=$cross_prefix ${npp_config_libs_lsw} || exit 1
       do_make
     fi
   cd ../..
   #read -p "after build_lsw - Press Enter to continue... or control-C if not happy"
}

Code: Select all

    if [[ $enable_opencl == 'y' ]]; then
      config_options+=" --enable-opencl "
      # Here's where we try to build nvidia's NPP 
      if [ "$bits_target" = "64" ]; then # is 64 bit
        config_options+=" ${npp_config_options} "
        # and then we consider  what ffmpeg has called "--enable-cuda-sdk"
        echo "Unfortunately trying to build with cuda_sdk invokes the nvidia compiler nvcc which requires an OLD version of gcc to build a .cu and thus kills the build process. So not building with ffmpeg's cuda_sdk"
        echo "it may have been like --enable-cuda-sdk --enable-filter=scale_cuda --extra-cflags=-I/usr/cuda_8.0.61/cuda/include --extra-ldflags=-L/usr/cuda_8.0.61/cuda/lib/x64  "
      else # must be 32 bit whcih doesn't build :(
        echo "Not building ffmpeg with nvidia 32bit NPP (cuda) since the cuda toolkit it only comes with 64bit NPP stuff"
        # and then we consider what ffmpeg has called "--enable-cuda-sdk"
        echo "Unfortunately trying to build with cuda_sdk invokes the nvidia compiler nvcc which requires an OLD version of gcc to build a .cu and thus kills the build process. So not building with ffmpeg's cuda_sdk"
      fi
    fi    
It builds.
However - when run it aborts with "nppi64_80.dll is missing from your computer".
Hence, has anyone managed to build it static and can share the method ?

Post Reply