Skip to content

Instantly share code, notes, and snippets.

@lu-zero
Last active September 2, 2015 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lu-zero/938ec4d343a9bf4d7289 to your computer and use it in GitHub Desktop.
Save lu-zero/938ec4d343a9bf4d7289 to your computer and use it in GitHub Desktop.
Playing with a Tesla K20m

Step 1: install cuda & nvenc

e.g. emerge nvidia-cuda-sdk

Step 2: build libav

git clone git://github.com/libav/libav
cd libav
./configure --enable-nvenc --extra-cflags="-I/path/to/cuda/include -I/path/to/nvenc/include"
make -j 18

Step 3: run some encodes

cat test.sh

for a in `seq 1 $1`; do
  ./avconv -nostats -t 60 -filter_complex testsrc=hd720 -c:v $2 -f null - &
done
wait

time bash test.sh 10 nvenc_h264 2>/dev/null

real    0m34.799s
user    0m22.281s
sys     0m2.012s

time bash test.sh 20 nvenc_h264 2>/dev/null

real    1m28.207s
user    3m58.867s
sys     0m18.647s

40 concurrent instances sometimes do fail because the system goes out of video memory...

time bash test.sh 40 nvenc_h264 2>/dev/null

real    2m55.787s
user    8m20.173s
sys     0m46.804s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment