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

gpu-context should auto switch when switch hwdec #13926

Open
Andarwinux opened this issue Apr 18, 2024 · 6 comments
Open

gpu-context should auto switch when switch hwdec #13926

Andarwinux opened this issue Apr 18, 2024 · 6 comments

Comments

@Andarwinux
Copy link
Contributor

Before requesting a new feature make sure it hasn't been requested yet.
meta:feature-request

Expected behavior of the wanted feature

Example:

gpu-context=d3d11,winvk
hwdec=d3d11va

Then switch hwdec to nvdec at runtime (set hwdec nvdec) , then gpu-context should auto switch to winvk to allow hwdec=nvdec to work without error.

@kasper93
Copy link
Contributor

@na-na-hi What do you think?

@Hrxn
Copy link
Contributor

Hrxn commented Apr 18, 2024

hwdec=nvdec requires gpu-context=winvk now? At least on Windows. Is this by design?

@philipl
Copy link
Member

philipl commented Apr 18, 2024

There are interops for egl and vulkan, so it doesn't have to be winvk but that is the better choice. It is possible to write a d3d11 interop but someone has to do the work

@Hrxn
Copy link
Contributor

Hrxn commented Apr 18, 2024

I see.. So, not some recent change mandated by newer versions of NVIDIA's Windows drivers?

@philipl
Copy link
Member

philipl commented Apr 18, 2024

No. Egl should still work fine but I haven't touched windows for ages.

@na-na-hi
Copy link
Contributor

Note that this should also be applied when --hwdec-codecs change when --hwdec=auto is set.

To avoid unnecessary vo reconfigs, the switching meshanism needs to know which hwdec methods are compatible with which GPU contexts. AFAIK mpv doesn't maintain such a list.

I think such functionality can be done with a script. It only needs to do the following:

  • Observe --hwdec and --hwdec-codecs for changes
  • Compute a list of GPU contexts that is compatible with the union of all acceptable hwdecs
  • Compare the context list with the current list. If different, set --gpu-context to the new list. A reconfig should trigger and try to use the hwdec.

hwdec=nvdec requires gpu-context=winvk now? At least on Windows. Is this by design?

NVDEC works with OpenGL on Windows.

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

No branches or pull requests

5 participants