-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-existent "libcuda_nvcc.lib" link library added to VS projects with --enable-cuda-nvcc #29
Comments
Just to follow up on this. I had to take a few manual steps to complete the build with this configuration. Documenting them here in case it helps someone or as an indication of what needs to happen.
This was all necessary to get rid of the link errors. I am sure there must be a way to automate all of this......but having zero experience of CUDA files, compiling etc it’s not something I could figure out easily. |
Ive fixed the incorrect inclusion of "libcuda_nvcc.lib" in the repo. However adding support for ptx generation and inclusion is alot more complicated (as your list of above steps demonstrates). Unfortunately ffmpeg doesnt use the cuda runtime api as that would have made it alot easier. So it may take quite some time to work out how to integrate the required steps into the project. |
No problem Matthew, and thanks for the fix. I guess it's something of an edge-case and I've worked around it by just doing the steps manually. I don't think those CU files are likely to change frequently. I think the way FFmpeg have done it might be to avoid a dependency on the CUDA runtime libs (related to licensing). i.e. previously I think if FFmpeg had been built with the deprecated enable-cuda-sdk then it would have required the runtime CUDA libraries to be installed at the place FFmpeg was to be run, or for them to be distributed with FFmpeg. Fairly recently this was changed so that it works the same as nvenc/nvdec in that it uses the libraries that come with the graphics drivers. I don't fully understand it, but that seems to be the gist of it from a bit of googling and reading the FFmpeg mailing lists. |
The following bash snippet can be used to compile the .cu files prior to calling project_generate.exe, which will then pick up the generated .c files:
I tested this snippet with the version of bash found with a git installation, but presumably it would work with any Windows bash shell. It obviously requires the CUDA Toolkit to be installed (for nvcc.exe) and also requires the 64-bit version of cl.exe to be found in PATH, since nvcc.exe uses cl.exe. This is most easily achieved by: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat” x86_amd64 (or similar, according to your VS installation). Anyway, thought I'd share these steps/this mini script for anyone else wanting to enable CUDA in this project. |
Thank you for your excellent work! The final To help those who come later, I would like to remind you that the filters |
Just updating back here as a few things seem to have changed with latest FFmpeg. They removed ptx2c.sh, which I was using in my build scripts to produce the ptx.c files (as detailed above), and seem to be doing things slightly differently now. Anyway, I recovered ptx2c.sh but found it *no longer worked, but here is a working one. This will produce ptx.c files from the .cu files in a format that works with latest FFmpeg.
*it actually caused the MSVC compiler to use up all resources and eventually run out of heap space, while seriously degrading the performance of the machine. |
Recent-ish changes to FFmpeg have deprecated enable-cuda-sdk in favour of enable-cuda-nvcc. The intention is that the likes of yadif_cuda etc no longer need to link with the CUDA SDK libraries (they can rely on ffnvcodec), however, the CUDA SDK still needs to be present in order to build (nvcc).
I'm trying to get this configuration going with your wonderful tool but I guess something needs tweaking somewhere as it is assuming there is some kind of "libcuda_nvcc.lib" needing creating, which as far as I can tell isn't the case.
I am going to manually delete these entries for now, and see if I come up against any other problems with the cuda changes.
This is using a build of the project_generator from the last release.
The text was updated successfully, but these errors were encountered: