Page 1 of 1

Trying to use wglCreateAffinityDCNV to select graphics card

Posted: 15 Aug 2013 15:28
by kc7bfi
We have the case where we have one desktop with two nVidia cards and four monitors where we are trying to play 48 vlc video windows. It appears that when using vout=opengl, that only the first graphics card is used for acceleration. I have been trying to write a patch to allow a custom vlc command line argument to specify the graphics card to use, such as

Code: Select all

--nvidia-affinity=1
I have been playing with the following code

Code: Select all

int nVidiaAffinity = var_InheritInteger(vd, "nvidia-affinity"); if (nVidiaAffinity >= 0) { HGPUNV GpuMask[2]; HGPUNV hGPU; GpuMask[0] = NULL; GpuMask[1] = NULL; if (wglEnumGpusNV(nVidiaAffinity , &hGPU)) { GpuMask[0] = hGPU; sys->hGLDC = wglCreateAffinityDCNV(GpuMask); } }
Everything compiles but when I go to run, the wgl extension function pointers are all NULL.

Any thoughts on what I may be doing wrong? Any one interested in looking at this development? We might be willing to pay for this feature to be developed and contributed back to vlc.
Thanks, David

Re: Trying to use wglCreateAffinityDCNV to select graphics c

Posted: 15 Aug 2013 16:09
by Jean-Baptiste Kempf
Are you sure you shouldn't get those wglEnumGpusNV with vlc_gl_GetProcAddress ?

Re: Trying to use wglCreateAffinityDCNV to select graphics c

Posted: 15 Aug 2013 18:07
by kc7bfi
According to wglew.h and glwin32.c the function call to find the procedure pointers is

Code: Select all

wglGetProcAddress
Is this correct?

Re: Trying to use wglCreateAffinityDCNV to select graphics c

Posted: 15 Aug 2013 18:41
by Jean-Baptiste Kempf
No. Use the vlc one.