fyr77 / EnvyUpdate

Small update checker application for NVIDIA GeForce GPUs
MIT License
137 stars 7 forks source link

"Invalid API response from Nvidia" when opening EnvyUpdate #31

Closed sfaria closed 11 months ago

sfaria commented 1 year ago

EnvyUpdate version: 2.17 (latest) Windows 11 22H2 (22621.1413) GPU: RTX 4080 Founders Edition

error_message

Unfortunately, there doesn't seem to be any logging, so I can't really provide any more information.

fyr77 commented 1 year ago

Ah, I think I know what the problem is. Creating some kind of logging here would be smart for future problems, I will include that in the next patch. I believe your GPU's name actually includes the "Founders Edition" string, so my code fails to detect it properly. Up until now, I just filtered out these suffixes manually, but I think I should rethink my method here. Patch is incoming the next few days.

sfaria commented 1 year ago

Awesome, thanks for the update! if you need any additional information from me to debug just tell me.

fyr77 commented 1 year ago

Alright, I think I fixed it in 7173f2ec5e15f27c49398b7c88e77207e90370b0 and version 2.18. Please test it and see if it works for you. @sfaria

sfaria commented 1 year ago

I get the same response popup using 2.18. I took a look at your code and did a little digging:

Since I don't really do C# or have an environment, I'm going to hobble around with PowerShell and try to use the same detection method you're using:

$VideoControllers = Get-WmiObject -Query "SELECT * FROM Win32_VideoController"
$VideoControllers.GetPropertyValue("Description")

This gives me the value NVIDIA GeForce RTX 4080. There doesn't seem to be any reference to "Founder's Edition" in there, unfortunately.

 $VideoControllers.GetPropertyValue("DriverVersion")

Gives me 31.0.15.3141

$OfflineGPUVersion = $VideoControllers.GetPropertyValue("DriverVersion")
$OfflineGPUVersion = $OfflineGpuVersion.Replace(".", "")
$Index = (([array]0,($OfflineGPUVersion.Length-5)) | measure -Maximum).Maximum
$OfflineGPUVersion = $OfflineGPUVersion.Substring($Index)
$OfflineGPUVersion = $OfflineGPUVersion.Substring(0, 3) + "." + $OfflineGPUVersion.Substring(3)

Returns 531.41, which seems sensible so that's working.

GPU Detection seems to work now:

$GPUName = $VideoControllers.GetPropertyValue("VideoProcessor").ToLower()

Outputs nvidia geforce rtx 4080

$GPUName -match '(geforce )?.tx \w*\d*'

Returns True.

Maybe you can use some of this output to figure out what's going on?

fyr77 commented 1 year ago

Hmm, very odd. I'll look into it, thanks for the info.

sfaria commented 1 year ago

No problem, if you need any info dumps please let me know.

fyr77 commented 1 year ago

@sfaria I made a new build from commit 6a10abc334a1ce10978aef3b3c39c006ef9a11ef, please try this one. It should still throw an error, but a more useful one this time. https://github.com/fyr77/EnvyUpdate/releases/tag/2.19-pre1

sfaria commented 1 year ago

Here's what it output:

image

fyr77 commented 1 year ago

Very strange, it seems that EnvyUpdate cannot properly find your GPU in the Nvidia master list. Could you try opening this URL in a browser? It should give you a massive XML list of graphics cards: https://www.nvidia.com/Download/API/lookupValueSearch.aspx?TypeID=3

sfaria commented 1 year ago

It resolves, and here is the chunk with both 4080 and 4080 mobile:

<LookupValue ParentID="127">
<Name>NVIDIA GeForce RTX 4080</Name>
<Value>999</Value>
</LookupValue>
<LookupValue ParentID="127">
</LookupValue>
<LookupValue ParentID="128">
<Name>L4</Name>
<Value>1009</Value>
</LookupValue>
<LookupValue ParentID="128">
<Name>L40</Name>
<Value>1003</Value>
</LookupValue>
<LookupValue ParentID="129">
<Name>GeForce RTX 4090 Laptop GPU</Name>
<Value>1004</Value>
</LookupValue>
<LookupValue ParentID="129">
<Name>GeForce RTX 4080 Laptop GPU</Name>
<Value>1005</Value>
</LookupValue>
fyr77 commented 1 year ago

Alright, thank you for checking. Please use this build, it should create a log file envyupdate.log. Please share the log file here. @sfaria

sfaria commented 1 year ago

Ran the app once - I've attached the log.

envyupdate.log

sfaria commented 1 year ago

Did you ever figure out what was wrong?

fyr77 commented 1 year ago

@sfaria Sorry for not keeping you updated, university had me occupied - I was not able to figure out the problem so far. Somewhere the data from your GPU gets lost - or never even read out properly. Could you perhaps contact me via email? Perhaps we could debug the code directly on your machine to figure out where the data gets lost...

sfaria commented 1 year ago

Hey, no worries! You should concentrate on your exams - I'll pull down the project and do some debugging myself. I'll make a PR once I figure it out.

fyr77 commented 1 year ago

Alright, thank you! That codebase is a bit old and not always completely logical... (I should rewrite a few things probably) - please ask if anything seems off.

fyr77 commented 1 year ago

I have gotten my hands on a GTX 1080 Ti, which seems to have triggered the same issue you were having. I will release 2.19 now, please test that when you have the time. @sfaria

sfaria commented 1 year ago

Hey! Thanks for looking into this. Sorry I didn't get time to look into the issue myself - I started a new job search shortly after our last update and didn't get the time.

I'll install the latest version and let you know.

sfaria commented 1 year ago

Same issue:

image

fyr77 commented 1 year ago

Hmm, very unfortunate. I did fix another issue at least. I'll keep looking into it.

fyr77 commented 1 year ago

Hi again @sfaria. I have released another new version with some internal improvements to logic, but I don't expect this to fix the problem. Still, I added a button in the settings to enable logging and improved the log messages, so I would appreciate it if you could share another log file from 2.20.

If it helps in any way, here is one from my current system: envyupdate.log

sfaria commented 1 year ago

Hey @fyr77!

Great work on getting logging in - I enabled it and restarted the program. I've attached the log output. Thanks!

envyupdate.log

nezorflame commented 11 months ago

Got the same error. RTX 4080 Laptop, version 2.20.

Latest current driver is here: https://www.nvidia.com/download/driverResults.aspx/209268/en-us/

Log contents:

------
INFO Enabled logging to file. Restart Application to see full startup log.
------
INFO Found log file, will start logging to this.
INFO Starting EnvyUpdate, version 2.20
INFO Found Win32_Battery, assuming mobile device.
INFO Mobile: True
INFO Looking for driver version in ManagementObjects
INFO Found driver in ManagementObjects.
INFO Local driver version: 531.61
INFO Local driver version already known, updating info without reloading.
INFO Updating local driver version in UI.
INFO Trying to get GPU name from ManagementObjects...
INFO Found GPU name: NVIDIA GeForce RTX 4080 Laptop GPU
INFO Detecting driver type.
INFO Trying to find DCH key in registry...
INFO Done detecting driver type: DCH
INFO Started check timer.
INFO Started update file system watcher.
INFO Found standard driver.
INFO Trying to get GPU update URL.
INFO Getting Nvidia GPU list...
INFO Got Nvidia GPU list.
INFO Trying to get GPU name from ManagementObjects...
INFO Found GPU name: geforce rtx 4080
INFO Got psid: 0
INFO Getting Nvidia GPU list...
INFO Got Nvidia GPU list.
INFO Trying to get GPU name from ManagementObjects...
INFO Found GPU name: geforce rtx 4080
INFO Got pfid: 0
INFO Getting Nvidia GPU list...
INFO Got Nvidia GPU list.
WARN Ignore previous warning, just getting osid.
INFO Got osid: 57
INFO Trying to find DCH key in registry...
INFO Getting GPU URLs. IDs in order psid, pfid, osid, dtcid, dtid: 0, 0, 57, 1, 1
INFO Built GPU URL: http://www.nvidia.com/Download/processDriver.aspx?psid=0&pfid=0&osid=57&dtcid=1&dtid=1
INFO Downloaded driver page URL: <li>No certified downloads were found for this configuration. To include beta downloads in your search, click <a href='Find.aspx?lang=en-us'>here</a>.</li>
WARN Could not get GPU update URL, trying again with non-studio driver.
INFO Getting Nvidia GPU list...
INFO Got Nvidia GPU list.
INFO Trying to get GPU name from ManagementObjects...
INFO Found GPU name: geforce rtx 4080
INFO Got psid: 0
INFO Getting Nvidia GPU list...
INFO Got Nvidia GPU list.
INFO Trying to get GPU name from ManagementObjects...
INFO Found GPU name: geforce rtx 4080
INFO Got pfid: 0
INFO Getting Nvidia GPU list...
INFO Got Nvidia GPU list.
WARN Ignore previous warning, just getting osid.
INFO Got osid: 57
INFO Trying to find DCH key in registry...
INFO Getting GPU URLs. IDs in order psid, pfid, osid, dtcid, dtid: 0, 0, 57, 1, 1
INFO Built GPU URL: http://www.nvidia.com/Download/processDriver.aspx?psid=0&pfid=0&osid=57&dtcid=1&dtid=1
INFO Downloaded driver page URL: <li>No certified downloads were found for this configuration. To include beta downloads in your search, click <a href='Find.aspx?lang=en-us'>here</a>.</li>
FATAL Invalid API response from Nvidia. Attempted API call: http://www.nvidia.com/Download/processDriver.aspx?psid=0&pfid=0&osid=57&dtcid=1&dtid=1

image image

fyr77 commented 11 months ago

I may have found the issue. Nvidia switched their titling in the 40 series, from "GeForce RTX 3080" to "NVIDIA GeForce RTX 4080". I believe my code does not account for this. I am currently not home, I will attempt to fix this for the next release and also release a fixed 2.X version by the end of the coming week.

nezorflame commented 11 months ago

@fyr77 sounds great, feel free to ping me to test it!

fyr77 commented 11 months ago

I have just released 2.21, please test this version. It should fix your issue.

nezorflame commented 11 months ago

@fyr77 indeed, it works now. Thanks!

fyr77 commented 11 months ago

@nezorflame Wonderful!

@sfaria If possible, please confirm it works for you as well. If yes, I will close the issue.

sfaria commented 11 months ago

@fyr77 - Working now for me as well. Great work, and thanks for looking into this!

nezorflame commented 11 months ago

Just an FYI - for some reason WIndows Defender now considers your new version a trojan: https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?name=Trojan%3AWin32%2FBearfoos.A!ml&threatid=2147731250

fyr77 commented 11 months ago

@nezorflame Annoying... Thank you for the heads-up. It is amusing, since I merely changed two lines of code which should have no impact on virus detection. Weirdly enough, my own installation of Windows 11 does not recognize it as a virus. As always, Windows Defender is a mystery ;)