• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

GPU-Z not starting just after RTX30x0 driver autoinstall before reboot

Joined
Oct 22, 2020
Messages
30 (0.02/day)
Hello! I'm doing a lot of GPU testing, mostly NVIDIA 3xxx series and I'm running GPU-Z for every card. I do not have GPU-Z auto-starting, I'm just manually launching it.

Several months ago I noticed quite strange behaviour: when I plug a new GPU or even re-plug existing GPU on another PCIe slot - then after automatic driver re-installation done by Windows - I can run ~all 3d apps just fine, but I can't run GPU-Z. It silently exits without showing splash screen, no matter how times I try. But after a reboot (so it would be a clean boot without driver reinstallation) - GPU-Z starts working perfectly fine.

A lot of other tools including GPUShark, Afterburner, do work fine just after driver install before reboot. But the Hwinfo64 tool suffers from same issue as GPU-Z. So, it may be some OS/driver special behaviour that is not handled in GPU-Z and hwinfo64. I didn't have this issue ~year ago but unfortuntely didn't notice when it appeared.I was initially suspecting GPU-Z update - but it is not the case: the all 2.x GPU-Z versions that worked fine earlier now has this same problem.
I gone earlier to just find that GPU-Z 0.4.6 starts fine, but the 0.4.7 does not work until reboot. The changelog says that 0.4.7 introduced some driver loading machinery changes, maybe it is related

By now I'm running R560.38 driver, but the issue appeared definitely earlier while I was using several older drivers.
The windows version is win10 22H2 10.0.19045.2251 (Nov 8 2022) with EFI boot.
Also, it it matters I have intel integrated GPU (problem appeared both with UHD 610 and HD P630) and during initial windows boot I have only intel GPU having driver attached, so the "GPU-with-driver" count switches from 1 to 2 during driver install.

Overall, the problem is a quite minor since only affects scenarios with often GPU replacements. Even more - maybe something changed in my system that lead to GPU-Z and hwinfo64 misbehaviour in the "driver installed without reboot scenario". Being a developer I understand that such kind of bugs without exactly known way to reproduce can be hard to fix, so I've created this thread mostly to start collecting other users feedback regarding similar problem.

I don't know if GPU-Z is writing some logs, so to make at least some light on the silent exit reason I launched it under the WinDBG tool. It seems that GPU-Z crashes nearly immediatlely after start with something like "NULL+4 pointer dereference". The exact GPU-Z version corresponding to the below offsets is GPU-Z 2.59.0

GPUZ-crash.png
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
27,613 (3.70/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
A lot of other tools including GPUShark, Afterburner, do work fine just after driver install before reboot
This is the expected behavior for GPU-Z, too, and until now I wasn't aware of any such issue

I don't know if GPU-Z is writing some logs
I does not, to not clutter user systems. I'll send you logging-enabled build in a PM
 
Joined
Oct 22, 2020
Messages
30 (0.02/day)
Conclusion about the problem made after a joint research: it looks like some obscure problem with my windows settings/boot process combo that triggers behavior similar to a windows bug.

GPU-Z uses the Microsoft's MFC/ATL library for UI rendering, that has a global/static variable AFX_GLOBAL_DATA afxGlobalData;
At the very early of application start it is running its initialization code - its initialization code GetStockObject(DEFAULT_GUI_FONT)

And for some strange reason, that WINAPI function returns NULL. And the MFC/ATL library crashed after this.

However, the exact reason for such behavior was not found. I suspect "a series of DPI adjustments performed during detection of a monitor", since my boot sequence with a new NVIDIA GPU looks a bit unusual:
  1. Stage: BIOS stage and early Windows boot (rotating dots):
    • system initialized a pair of EFI-compatible GPUs in CSM=Off mode. The first intel GPU without displays and second NVIDIA with a display attached. The display works fine at this stage
  2. Stage: "Windows kernel inited" & autologin before driver autoinstalls:
    • Windows has a first intel GPU with a driver but without display and a second EFI-capable NVIDIA that's driver is still not loaded but with display attached. For some reason, windows just showing a black screen in such situation. It does autologin in the background, but I see nothing on the display for ~30-100 seconds while driver is autoinstalling.
    • For subsequent boots this stage is completely absent because the driver is loaded immediately.
  3. Stage: "Driver autoinstall done":
    • The driver autoinstall finished, the picture on the display is back and it show already logged in Desktop. And This is the moment when I'm launching GPU-Z and getting the fail above.
Some DPI or other settings of GPU-Z may affect this, since in a simple one-liner app the GetStockObject(DEFAULT_GUI_FONT) is non-NULL in the same environment.
 

W1zzard

Administrator
Staff member
Joined
May 14, 2004
Messages
27,613 (3.70/day)
Processor Ryzen 7 5700X
Memory 48 GB
Video Card(s) RTX 4080
Storage 2x HDD RAID 1, 3x M.2 NVMe
Display(s) 30" 2560x1600 + 19" 1280x1024
Software Windows 10 64-bit
Thanks for the thorough investigation. I guess this is something that can't be fixed easily, and would require too much time investment.

I do have plans for a rewrite of GPU-Z with an improved GUI and core functions running in .NET.
The core functionality would be implemented as AOT'd .NET or C++ (still researching), so no more MFC, which should "fix" the problem
 
Top