Jump to content
  • Advertisement
Sign in to follow this  

PresentMulti-GPU/head DX9ex application on Windows 10

This topic is 644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



we have a DX9ex application that uses multiple GPUs and each GPU has 2 heads (NVIDIA K600).

This application runs fine on Windows 7 but we experiencing problems on Windows 10. 


The application is rendering to 4 displays.

It uses the following DX9ex methods to determine if a frame (for a certain swapchain) has been rendered to the display:

if((stat.PresentCount == id) ==> we render the next frame to prevent buffering and increasing latency.
The application does runs on Windows 10 one or two GPUs.
But there is a problem if we use the second head on one of each of the GPUs.
In other words the APIs do work when running without the second head (works when using 2 GPUs each one head).
In this situation the results returned by GetPresentStats and GetLastPresentCount don't seem to make sense anymore
(note the return values are not zero). The check (stat.PresentCount == id) fails and our rendering loop fails.
Can anybody shed some light on this?
- Windows 10 version 10.0.14393
- DX9ex 
- NVIDIA driver 376.63.
- 2 x NVIDIA K600 graphics cards

Share this post

Link to post
Share on other sites

Sounds like something might have gotten broken somewhere in the 5 OS releases between 7 and 10.14393. Are you able to provide any other data points between those (Win8, Win8.1, 10.10240, 10.10586)? Knowing where it last worked would help track down what might've caused it to stop working. Can you provide the application, or a slimmed down version of it for debugging?

Share this post

Link to post
Share on other sites

Hi Jesse, 


I can try on an older version of Windows 10. I will do so first thing tomorrow when I am back at the office.

I do not have access to Windows 8(.1). I can provide you the test program so you can take a look.


Note that latency is critical for us because our application is based on hand eye coordination, user looking at the screen while positioning a device. We use 2 GPUs each having 2 heads. I am measuring the latency using a light sensor

(similar to what is described in this post).


What we do is we check for each frame if the previous frame is already rendered, if not we skip the frame.

Our render loop does this for each display. By preventing frames getting buffered, this way we minimze the latency. 


Note we are running full screen. Furthermore on Windows 7 we disabled the compositor (DWM). On Windows 10 it is not possible to disable the DWM, correct?

bool DX9Screen::isPresented() const
    bool result = false;
    IDirect3DSwapChain9Ex *swap = nullptr;
    IDirect3DSwapChain9	  *swapChain = nullptr;

    if (FAILED(m_device->GetSwapChain(m_screen, &swapChain)))	                              throw "error: doRender GetSwapChain failed";
    if (FAILED(swapChain->QueryInterface( __uuidof(IDirect3DSwapChain9Ex), (void**)&swap)))   throw "error: QueryInterface IDirect3DSwapChain9Ex";

    UINT id;

    HRESULT hr = swap->GetPresentStats(&stat);
    checkHResult("GetPresentStats", hr);
    hr = swap->GetLastPresentCount(&id);
    checkHResult("GetLastPresentCount", hr);

    //We use present statistics to figure out whether the last frame has actually been sent to the screen..
    //This allows us to minimize latency; if we would render while the last frame is still in an internal queue, 
    //we would introduce latency
    if((stat.PresentCount == id) || (m_lastPresent == 0))  result = true;
    else if(stat.PresentCount == 0)
        trace("WARNING: isPresented stat.PresentCount not valid (or wrapped around) ");
        result = true; 

    if(swap)        swap->Release();
    if(swapChain)   swapChain->Release();

    return result;

If you need to see more of the code then that is not a problem. I have a relatively small test app which I use to measure.


Thanks in advance



Share this post

Link to post
Share on other sites

Correct, it's not possible to disable the DWM for windowed apps on Win10, though fullscreen exclusive still bypasses the DWM. Please provide a repro app and I'll get a bug filed, and we'll see if we can track down what broke. The simpler the app, the more likely we'll be able to figure it out and hopefully fix it (e.g. only 2 monitors on one GPU instead of 4 monitors on 2 GPUs would be great).

Share this post

Link to post
Share on other sites

Hi, I have stripped down the test app somewhat more and tested it again. I still have a repro, so if you can give it a shot that would be great.

I attached the code to this post.


I also tested on an older version of Windows 10 (version 10.0.10240 + NVIDIA driver 368.39).

On this configuration the program does NOT work, I get a black screen when using 1 GPU and two heads.

When I run it on a 1 GPU / 1 head the program does work.

I upgraded the driver to version 376.62 but this did not solve the problem.


On Windows 10 version 10.0.14393 (see initial post) the program does run using 1 or 2 heads but the present API gives a problem.


PS: we are also working on a DX12 test app. We have it working but we have 16 ms additional latency compared to DX9ex.

I will create a separate post for this today or tomorrow after some more testing and re-watching your videos on flipping modes :-)






Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!