Skip to content

Add support for multiple GPUs on Windows#187

Open
tyan0 wants to merge 1 commit into
intel:mainfrom
tyan0:multiGPU
Open

Add support for multiple GPUs on Windows#187
tyan0 wants to merge 1 commit into
intel:mainfrom
tyan0:multiGPU

Conversation

@tyan0

@tyan0 tyan0 commented Jan 9, 2026

Copy link
Copy Markdown

If the primary GPU is not an Intel GPU, libvpl cannot detect the Intel GPU in the Windows environment, even though it is present. The situation is, for example, using an NVIDIA graphics card with an Intel CPU that has an embedded GPU. This patch allows the Intel GPU to be detected in such situations.

Issue

When a GPU of other than Intel is primary, the Intel GPU fails to be detected by libvpl for MFX API.

Solution

Search Intel GPU (vendor ID == 0x8086) whose adapterNum is other than 0 in MFXLibraryIterator::GetRegkeyDir().

How Tested

Apply the proposed patch to cygwin libvpl package, and run mpv -vd h264_qsv videofile.mp4 in my environment:

  • Primary GPU: NVIDIA Geforce GTX 750Ti
  • Secondary GPU: Intel HD Graphics 4600 (Core i7 4790)

100% tests passed for the test suites.

If the primary GPU is not an Intel GPU, libvpl cannot detect the
Intel GPU in the Windows environment, even though it is present.
The situation is, for example, using an NVIDIA graphics card with
an Intel CPU that has an embedded GPU. This patch allows the Intel
GPU to be detected in such situations.

Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
@jonrecker

Copy link
Copy Markdown
Contributor

Thank you for the PR. The reg keys queried by this code path were only used by quite old versions of the MediaSDK installer The driver now installs MSDK / VPL runtimes in Windows Driver Store and supports any number of installed GPUs with libvpl.

The concern with querying all installed adapters here is increasing VPL initialization latency on all Windows platforms. MFXCreateSession() may not support Core i7 4790 (Haswell, also see here) but as an alternative the application may try to create a session using MFXInitEx() directly.

@tyan0

tyan0 commented Jul 16, 2026

Copy link
Copy Markdown
Author

@jonrecker , Thanks for the review. I evaluated the latency. My environment is:

  • Primary GPU: NVIDIA Geforce GTX 750Ti
  • Secondary GPU: Intel HD Graphics 4600 (Core i7 4790)

With this patch:
Whole LoaderCtxVPL::BuildListOfCandidateLibs() call: 7.0msec.
MFXLibraryIterator::GetRegkeyDir() [first time: for HKCU]: 0.57msec.
MFXLibraryIterator::GetRegkeyDir() [second tome: for HKLM]: 1.1msec.

Without this patch;
Whole LoaderCtxVPL::BuildListOfCandidateLibs() call: 6.4msec.
MFXLibraryIterator::GetRegkeyDir() [first time: for HKCU]: 0.57msec.
MFXLibraryIterator::GetRegkeyDir() [second tome: for HKLM]: 0.57msec.

Do you consider this increase in latency unacceptable?

@tyan0

tyan0 commented Jul 16, 2026

Copy link
Copy Markdown
Author

In addition, MFXCreateSession() returns sts == 0 (MFX_ERR_NONE) with this patch. It seems that Intel HD Graphics 4600 in Core i7 4790 works as expected with MFXCreateSession(). So, unless we intentionally exclude it, libvpl will continue to be able to function on a Core i7 4790 (Haswell).

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.

2 participants