dmlc / decord

An efficient video loader for deep learning with smart shuffling that's super easy to digest
Apache License 2.0
1.88k stars 160 forks source link

libnvcuvid not found when compiling with CUDA on WINDOWS 10 #179

Open psandev opened 3 years ago

psandev commented 3 years ago

Hi, I am trying to build decord 0.6 with CUDA on Winddows 10. I installed FFMPEG and placed the bin subfolder in PATH.
Here is my cmake command with its output.

C:\Users#####\Downloads\decord\build>cmake -DUSE_CUDA=ON -DCMAKE_CXX_FLAGS="/DDECORD_EXPORTS" -DCMAKE_CONFIGURATION_TYPES="Release" -G "Visual Studio 16 2019" -DFFMPEG_DIR="C:\ffmpeg\bin" .. -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042. -- The C compiler identification is MSVC 19.28.29334.0 -- The CXX compiler identification is MSVC 19.28.29334.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The CUDA compiler identification is NVIDIA 11.1.74 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done FFMPEG_INCLUDE_DIR = C:\ffmpeg\bin/include FFMPEG_LIBRARIES = C:\ffmpeg\bin/lib/libavformat.lib;C:\ffmpeg\bin/lib/libavfilter.lib;C:\ffmpeg\bin/lib/libavcodec.lib;C:\ffmpeg\bin/lib/libavutil.lib;C:\ffmpeg\bin/lib/libavdevice.lib;C:\ffmpeg\bin/lib/libswresample.lib -- Found CUDA_TOOLKIT_ROOT_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1 -- Found CUDA_CUDA_LIBRARY=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/lib/x64/cuda.lib -- Found CUDA_CUDART_LIBRARY=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/lib/x64/cudart.lib -- Found CUDA_NVRTC_LIBRARY=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/lib/x64/nvrtc.lib -- Found CUDA_CUDNN_LIBRARY=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/lib/x64/cudnn.lib -- Found CUDA_CUBLAS_LIBRARY=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/lib/x64/cublas.lib -- Found CUDA_NVIDIA_ML_LIBRARY=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/lib/x64/nvml.lib -- Found CUDA_NVCUVID_LIBRARY=CUDA_NVCUVID_LIBRARY-NOTFOUND CMake Error at cmake/modules/CUDA.cmake:33 (message): Cannot find libnvcuvid, you may need to manually register and download at https://developer.nvidia.com/nvidia-video-codec-sdk. Then copy libnvcuvid to cuda_toolkit_root/lib64/ Call Stack (most recent call first): CMakeLists.txt:92 (include)

-- Configuring incomplete, errors occurred! See also "C:/Users/peter.s/Downloads/decord/build/CMakeFiles/CMakeOutput.log".

psandev commented 3 years ago

Hi guys. Can anybody help bulding decord with GPU on Windows 10? The procedure you provide fails with the failure described above and I cannot find a way around it. It is a shame to lose all the performance gains utilizing the GPU. Thanks a lot.

trifle commented 3 years ago

Hi @psandev , Sorry, I cannot really help and fear that building decord on Windows is a major pain. Anything with GPUs is a pain, and having to deal with Windows being slightly different makes it even more difficult.

The issue that you're seeing is a missing nvidia library - nvcuvid, this provides the basic functions for decoding videos on the GPU. Try the instructions (download it, put it into the library directory and make cmake aware where it is). Again, this being Windows, I don't have a clue where the paths are and how you'd set them.

Best of luck!

psandev commented 3 years ago

Thank you for the reply. It is OK if decord does not support GPU on Windows. Many libraries don't.. But they say it clearly. For example, nvidia-dali says clearly that it does not support Winddows at all. Nowhere in the decord installation procedure is this stated explicitly. So, which is it? Does deocrd support GPU on Windows or doesn't it? Or it is a mater of a tricky installation? If the later is the case, please provide a detailed installation procedure.

trifle commented 3 years ago

Hi @psandev, disclaimer: I'm not a developer of decord.

My guess would be: We don't know whether it supports Windows? Perhaps nobody has tried yet. Also, support for linux-centric tooling on Windows is an evolving story. It changes all the time, and perhaps it's different now from how it was some months ago. If you try the instructions from the error message and manage to get it working, I'm sure the devs would be happy about a pull request with your insights and tips for getting it working!

[edit] To clarify: Of course we're talking about GPU support on Windows ... regular cpu decoding is officially supported.