Problem compiling ffmpeg with nvenc using visual studio 2015 community edition

I’m trying to build ffmpeg w/ nvenc on Windows 10 64 bit and visual studio 2015 community edition. The command from step 10 in the Using FFmpeg with NVIDIA GPU Hardware Acceleration doc:

./configure --enable-nonfree --enable-cuda-sdk --enable-libnpp –-toolchain=msvc --extra-cflags=-I…/nv_sdk --extraldflags=-libpath:…/nv_sdk

Gives me the error ‘Unknown option “–-toolchain=msvc”’

Background: I’ve executed the commands (changed the path in the first, I’m not sure its right):

export PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/":$PATH export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/bin/":$PATH

And …/nv_sdk has the subdirectories include & bin, copied from the NVIDIA GPU Computing Toolkit directory.

1 Like

Did you solve this? I am facing this problem too.

First write the command ./configure --toolchain=msvc. After configuration has finished, run the configuration again like this: ./configure -toolchain=msvc --enable-cuda-nvcc --enable-nonfree --enable-libnpp --extra-cflags=-I…/nv_sdk --extraldflags=-libpath:…/nv_sdk. Do not use –enable-cuda-sdk, it has been deprecated. There will be error again. Modify the configure file in the main directory. Search for the word gencode in the file. You will see a line like this: nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2". Replace 30 by converting your gpu’s compute capability version. FOR EXAMPLE: if your gpu has compute capability 6.1 then replace 30 with 61.

1 Like

Thank you for sharing the solution and I’d like to mention that there are some typos in the command.
In the second command:
should be


I do NOT think you need to run the following first if the typo in the second command is fixed:
./configure --toolchain=msvc

And this forum editor may changed
to some weird … unicode character, be careful when you copy them. (The ones next to libpath and extra-cflags

The command works for me:
./configure --enable-cuda-nvcc --disable-shared --enable-nonfree --enable-libnpp --toolchain=msvc --extra-cflags=-I…/nv_sdk --extra-ldflags=-libpath:…/nv_sdk

The gencode comment really helped me a lot. I changed it to 61 as I’m using GTX 1080 and its compute capability is 6.1
and you can find yours here: