With OCCT 7.5.0 build, 3D viewer is not showing up in applications

I built OCCT 7.5.0 using CMake 3.20.2 and Visual studio 2017.
I used basic configuration to generate the project.
The following images shows the configuration I used,
OCCT-7.5.0-BuildConfig-1.png
OCCT-7.5.0-BuildConfig-2.png
OCCT-7.5.0-BuildConfig-3.png
OCCT-7.5.0-BuildConfig-4.png

After successfully built the OCCT, I ran the sample program MFC->Modeling.
The program didn't properly shows the 3D viewer. Image "OCCT-7.5.0-MFC-Modeling.png" is showing that.
Then, I clicked the "New" button, program crashed as shown in the image "OCCT-7.5.0-MFC-Modeling-New.png".

But I followed the same procedure to build OCCT 7.4.0 and ran the sample program, it worked without any issue.
Following images shows that.
OCCT-7.4.0-BuildConfig-1.png
OCCT-7.4.0-BuildConfig-2.png
OCCT-7.4.0-BuildConfig-3.png
OCCT-7.4.0-BuildConfig-4.png
OCCT-7.4.0-MFC-Modeling.png

My laptop has Intel(R) UHD graphic driver with driver version 27.20.100.9664.
And, also both OCCT 7.4.0 and OCCT 7.5.0 builds are working normally in my another laptop which has Intel(R) HD Graphics 620 driver with driver version 27.20.100.8681.

Can you help me solve this problem.

Thanks in advance.

Kirill Gavrilov's picture

Could you please quote the full error message from wglCreateContext(), which is clipped on screenshot OCCT-7.5.0-MFC-Modeling-New.png?

Vinojan Thiyagarasah's picture

I attached the snapshot of error message. Is this what you asked?

Kirill Gavrilov's picture

I was meant the following message:

OpenGl_Window:CreateWindow: wglCreateContext failed: Error code: -1073281622

It is more convenient sharing error messages as a text rather than screenshots. But in this case wglCreateContext() returns a non-standard error code, so it points to nowhere. Looks like indeed some bug in OpenGL driver.

Vinojan Thiyagarasah's picture

Okay, Then how OCCT 7.4.0 is working without any issue? Is there any new approach introduced in OCCT 7.5.0 to select OpenGL driver?

Kirill Gavrilov's picture

I don't recall any peculiar changes in OCCT 7.5.0 compared to 7.4.0 that might strike during OpenGL initialization like that - I don't have an answer here. So far I've seen only a bug in old drivers for HD Graphics 520 leading to artifacts in QtQuick application, not a crash.

OpenGL API doesn't provide graphics driver selection at all (unlike Vulkan / Direct3D), so there are no changes in OCCT in this regard.

You may try building MFC samples from OCCT 7.4.0 with OCCT 7.5.0 to see if issue is somehow related to changes in MFC samples themselves. OCCT 7.5.0 included several improvements in 3D Viewer initialization and event management. The first one might theoretically be related to the crash.

Kirill Gavrilov's picture

My laptop has Intel(R) UHD graphic driver with driver version 27.20.100.9664.
And, also both OCCT 7.4.0 and OCCT 7.5.0 builds are working normally in my another laptop which has Intel(R) HD Graphics 620 driver with driver version 27.20.100.8681.

Which CPU / Intel UHD Graphics model is used on the first laptop? Is it a single-GPU device or it has also some other GPUs as well? Which version of Windows is used?

Vinojan Thiyagarasah's picture

I attached the snapshots of the system and display information.
It has both Intel and NVIDIA GPUs. I tried with both enabled and NVIDIA disabled.
Gave me the same result in both scenarios.

Kirill Gavrilov's picture

Have you tried selecting NVIDIA as a preferred GPU in NVIDIA Control Panel?

Vinojan Thiyagarasah's picture

Yes Kirill, I had tried it before updating my windows from 10 to 11. It didn't work. But now it is working after selecting NVIDIA as preferred GPU.
Thank you so much for your help in this issue. My project is working in my machine without any issue now.

Note :
OCCT 7.5.0,MFC->Geometry sample program's 3D view operations and New operation are working fine now.
But it is crashing while clicking the close button.

Thank you.