GLFW Window Slows Down on RTX2070 , d

hi i have an on going issue regarding a basic GLFW runs ok for 4-5 times then slows down quite a lot so I go get a coffee. Just a simple window with a color no objects no other things. I have RTX2070 updated May 27, 2020 thru GeoForce on a 32gm ram i7 9700k, Windows 10 Pro …everything is current updated as of 31 may2020. The windows device drivers details matches the version of GeoForce Update driver. Did some online research and saw similar issue back in 2018, 2019 and discussions with GLFW guys mention about PixelFormatSelector holds the application because of different Nvidia OpenGl implementation and even mentioned about a checklist that Nvidia drivers goes thru. But I am not sure what really the issue is, my machine is pretty clear not much installed other than Visual Studio where I do my programming and started OpenGL classes. And I had this problem in two different codes. They both have the same issue ; somehow and something is loading the cache too much I guess cause I had to restart for code to run properly but any other applications are not impacted. So I am confused. Please please help…I love Nvidia products and how much they contribute to industry and paid a lot of money for that card :)

any help from Nvidia would be appreciated… I tried GeoForce forum as well but since it is development issue they could not help but at least some tried.
I also contacted GLFW and they told me that they have already resolved all past issues with Nvidia issues. Please help Nvidia…I have two machine with Nvidia RTX cards and want to keep using them happily .please :)

Hi salimp2009,

Welcome to the Nvidia Developer forums. Unfortunately, I have not been able to find any information on your issue. I suggest posting this issue in the GLFW forums.

Best of luck,
Tom

I already did here is the issue on GLFW but it seems they already did on their end on older issues https://github.com/glfw/glfw/issues/1709

I saw several similar issues dated back from 2018-2019 . I was wondering the same issue was happening again…a conflict with recent Nvidia drivers and GLFW …the older issue were about “ChoosePixelFormat calls getPixelFormatAttrib…” here is the link on previous issue

And some solutions created from that link was ;
“…ChoosePixelFormat calls getPixelFormatAttrib around 20x per loop. This in turn calls wglGetPixelFormatAttribivARB which could be slow on your system for some reason…”

“Calling wglGetPixelFormatAttribivARB once for all required attributes might improve performance if this is the case by up to 20x, which could get you within reasonable performance times for your setup…”

there is also another blog which mentions about Nvidia driver issue with OpenGL and glfw. There are also so many issue regarding Geforce in NVIDIA GeForce forum…seems like the user found work around by deleting Geforce and driver and cleaning the registry and and install the drivers again but not Geforce…to my understanding Geforce creates a huge list that does a check it goes thru…which makes it slow down 100 times. this is a serious number and seems to be the main reason of this bug causes to people . On my end, I did the clean up and reinstalled but it did not work so I am not sure why not ?? I also created an issue on Geforce forum , it seems like Nvidia does not want to do anything . they said I should issue Developer forum which I did before they said . I also did the issue on GLFW as well but Nvidia s only response is just let somebody handle it. But I trust on Nvidia I am sure there will be someone who will take the torch and solve it. Nvidia can do awesome technological innovations and I am sure that issue will be way too easy for you to resolve. I appreciate help . I will be more than happy try and do and try to help and analyze and solve with you.
I want to use my cards happily after :)

Unfortunately, I am not a technical resource for driver issues. I am still looking for someone to provide some guidance on this. Thanks for your patience.

Tom

thank you… i also come up on Twitter with someone from Nvidia who resolved those past issues and i sent him a msg via Twitter if this old issues are recurring in the new updates; his name is Pier Danniell . maybe he can help sounds like he is familiar with the issue and Nvidia was aware of it back then;

here is his response on those older/similar issue;
https://twitter.com/piers_daniell/status/892424998249406464

and here is Pier’s twitter page :
https://twitter.com/piers_daniell

1 Like

any status or anything from Nvidia side cause somehow it looks like it is a driver issue since the same file does not cause any problems with another graphic. It may be either Geforce settings or the driver files. But I am not able which one unless we get a direction / help / support from Nvidia. Please Nvidia…help :(

Hi Salimp2009,

It’s not clear from your description what you are trying to do.

Do you have some code sample, a Visual Studio project or a test app, so it is possible to reproduce your problem?

Sent so many links describing in details but it is creating a basic GLFW windows;

include <GLFW/glfw3.h>

int main(void)
{
    GLFWwindow* window;

    /* Initialize the library */
    if (!glfwInit())
        return -1;

    /* Create a windowed mode window and its OpenGL context */
    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        return -1;
    }

    /* Make the window's context current */
    glfwMakeContextCurrent(window);

    /* Loop until the user closes the window */
    while (!glfwWindowShouldClose(window))
    {
        /* Render here */
        glClear(GL_COLOR_BUFFER_BIT);

        /* Swap front and back buffers */
        glfwSwapBuffers(window);

        /* Poll for and process events */
        glfwPollEvents();
    }

    glfwTerminate();
    return 0;
}

There’s a fairly long delay (40 seconds or so) on the call to choosePixelFormat() (wgl_context.c) .

I have two different projects that uses a similar GLFW initialization They both have the same problem . I will also send the github links later today. The links above are the same problems from 2018.
I tried it on different machines one with my desktop with Nvidia Rtx 2070 card and one laptop with on board Intel Graphics card . The one with Nvidia card opens the window in 40 seconds after trying 3-4 times and the one with standart intel card opens wibdow arnd 565-675 milliseconds .
Do you need any more specific info.
The above links also refer a similar problem with OpenGl but the bottleneck is here opening the windows

let me know if you already need system specific info the OS and Nvidia drivers, the board or the RAMs or the CPU…Nvidia drivers are latest update as of May2020. The driver update date :

Nvidia driver date 15-5-2020
driver info: 26.21.14.4614,
driver version 446.14

OS: Windows 10 Pro updated as of May31, 2020 (we were aware of this issuesince Feb2020 but it may be present before because we were not using it for this purpose)

IDE: VS Studio 2019 16.6 (aware of Jan2020 and happened in earlier versions too)

Hi @salimp2009,

It turns out there is a known issue on Quadro cards once Choosepixelformat is called. This may be related, so there was an internal bug filed with the engineers. Unfortunately, I do not have a time-frame for when this will be resolved.

Regards,
Tom

Please put Rtx2070 cards on thatlist as well . Do they have a work around about it at least keep me going I would really appreciate and i dont want to feel that i wasted my money buying that card.
Thanks for tour prompt response tough👍👍

1 Like

I see 2 ChoosePixelFormat in wgl_context.c

There’s

if (!SetPixelFormat(dc, ChoosePixelFormat(dc, &pfd), &pfd))

in _glfwInitWGL.

This is a Win32 call.
In the end, it should load the NVIDIA OpenGL driver

There’s

pixelFormat = choosePixelFormat(window, ctxconfig, fbconfig);

in _glfwCreateContextWGL

This is a GLFW internal function.
It could call into the driver and take some time if the number of format is high, however if there an unexplained slowdown, I expect the first ChoosePixelFormat is more likely to be the cause.
Is that correct?

I’m not sure because you wrote choosePixelFormat with a lower case ‘c’

On my main system, with a RTX 2080 and the 446.14 driver I don’t see the issue.
Same for my GTX 1070 laptop

Yes correct;
the function that causes the slow down is
i
n file : wgl_context.c ,

line 69 it helld over there for 40 secs (at the begining of the loop at line 69)

static int choosePixelFormat(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)

here is also the link about issue i open glfw side
https://github.com/glfw/glfw/issues/1709

i also have a Msi laptop with RTX2060 card and on board intel card. It does not have problem either but it does not use Nvidia card for that function

the problem occurs if i hit the run 3-4 times in a row and kinda random.

The card that has the problem is RTX2070 system on desktop Both uses the same problem

The weird thing is other programs work OK. I have Unreal installed as well and i dont have problem there but it might not be using GLFW

Let me know if you want more info or help in anyway.

Oh, so it is “static int choosePixelFormat”

It must be the call to wglGetPixelFormatAttribivARB that is slow then.
Is that correct?

How high is your nativeCount?
Mine is 670

On your laptop, can you force using High Performance GPU in the NV control panel and see if you can reproduce the problem.
It should use your RTX 2060

native count is 670 but before it is initialized it waited 40 seconds

yes it basically waits at line 42 for the call

static int findPixelFormatAttribValue(const int* attribs,
int attribCount,
const int* values,
int attrib)
{
int i;

for (i = 0; i < attribCount; i++)
{
if (attribs[i] == attrib)
return values[i];
}

_glfwInputErrorWin32(GLFW_PLATFORM_ERROR,
“WGL: Unknown pixel format attribute requested”);
return 0;
}

here is also some info from locals;

Document

native count is 670 but before it is initialized it waited 40 seconds

For me, nativeCount is initialized at

wglGetPixelFormatAttribivARB(window->context.wgl.dc, 1, 0, 1, &attrib, &nativeCount)

Before the first call to findPixelFormatAttribValue

Is _glfw.wgl.ARB_pixel_format true on your system?

Is nativeCount initialized with wglGetPixelFormatAttribivARB or DescribePixelFormat?