Skip to content
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

dynamic loader: Introduce use of nv-codec-headers #21

Merged
merged 1 commit into from Jan 10, 2022

Conversation

philipl
Copy link
Contributor

@philipl philipl commented Jan 8, 2022

nv-codec-headers provides a dynamic symbol loader that makes it much
easier to build cuda/nvdec/nvenc dependent code and it's used by ffmpeg
and mpv. This driver makes heavy use of cuda and nvdec, and so it too
can benefit from having a dynamic loader to avoid requiring the cuda
SDK at build time.

I had to introduce the EGLStream related symbols and data types into
nv-codec-headers, but with those in place, it's a simple mechanical
process to switch over.

Fixes #1.

@philipl
Copy link
Contributor Author

philipl commented Jan 8, 2022

This requires philipl/nv-codec-headers@4d38030 which I will get merged.

@elFarto
Copy link
Owner

elFarto commented Jan 9, 2022

Thanks for this. The patch looks fine. I'll wait for you to get that nv-codec-headers change merged in.

@philipl
Copy link
Contributor Author

philipl commented Jan 9, 2022

src/vabackend.c Outdated Show resolved Hide resolved
nv-codec-headers provides a dynamic symbol loader that makes it much
easier to build cuda/nvdec/nvenc dependent code and it's used by ffmpeg
and mpv. This driver makes heavy use of cuda and nvdec, and so it too
can benefit from having a dynamic loader to avoid requiring the cuda
SDK at build time.

I had to introduce the EGLStream related symbols and data types into
nv-codec-headers, but with those in place, it's a simple mechanical
process to switch over.

Fixes elFarto#1.
@pobrn
Copy link
Contributor

pobrn commented Jan 10, 2022

I believe cc.find_library('dl') library should be added to the dependencies. I am getting

undefined reference to `dlopen'
undefined reference to `dlsym'
[...]

errors.

@elFarto
Copy link
Owner

elFarto commented Jan 10, 2022

Interesting, I'm not seeing those and it's working fine and it's not linked with libdl.

@philipl
Copy link
Contributor Author

philipl commented Jan 10, 2022

I think in some configurations, varying by distro and compiler, you may need to explicitly include -ldl. It's reasonable to add and harmless when not needed.

@elFarto
Copy link
Owner

elFarto commented Jan 10, 2022

Ok, added. @pobrn Let me know if that fixes it.

@pobrn
Copy link
Contributor

pobrn commented Jan 10, 2022

It builds now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use nv-codec-headers to load cuda and nvdec
3 participants