ledoge / novideo_srgb

Calibrate monitors to sRGB or other color spaces on NVIDIA GPUs, based on EDID data or ICC profiles
GNU General Public License v3.0
986 stars 35 forks source link

Driver version 531.79 broke clamping with error "NvAPI_GPU_SetColorSpaceConvertion failed with error code -104" #71

Open jxlarrea opened 1 year ago

jxlarrea commented 1 year ago

Rolling back to previous drivers fixes the issue.

Galf506 commented 1 year ago

Has there been any update on this? This application is kind of vital for my work and if Nvidia drivers borked it it's sort of a major issue

weili-jiang commented 1 year ago

This error seem to pop up if Windows goes into HDR mode. When back in SDR mode the clamping seems to work again, at least for my Acer XV272U. I'm using Game Ready Driver 536.23 with RTX 3080.

KrazyDeinos commented 1 year ago

This error seem to pop up if Windows goes into HDR mode. When back in SDR mode the clamping seems to work again, at least for my Acer XV272U. I'm using Game Ready Driver 536.23 with RTX 3080.

Yeah same here.

Is this fixable?

I would be nice with an option for error messages to be silent

weili-jiang commented 1 year ago

I have created a build on my fork to suppress this error: https://github.com/weili-jiang/novideo_srgb/releases/tag/suppress-disable-error

KrazyDeinos commented 1 year ago

I have created a build on my fork to suppress this error: https://github.com/weili-jiang/novideo_srgb/releases/tag/suppress-disable-error

Seems to be working, thanks buddy! 😃👌

antonp92 commented 1 year ago

@weili-jiang Thank you for creating the fork and getting rid of the error. I'm having an issue with your version though. If the clamp is active, when I enable HDR the colors are very washed out. If the clamp is disabled, the HDR colors are normal.

I have to manually disable the clamp every time before I enable HDR

weili-jiang commented 1 year ago

I don't think it's fixable - the API no longer works when HDR is enabled (hence the error message). The whole API is unofficial anyway so I doubt we can expect NVIDIA support on it.

I'm curious why it seems to work for some people though. What OS / monitor combinations have washed out colors and what ones don't?

antonp92 commented 1 year ago

@weili-jiang I've tested this on AW3423DW, and it seems to affect both, the original and the fork. Before 531.79, when the clamp is enabled and I activate HDR, the clamp gets automatically disabled and the HDR colors are accurate.

After 531.79 I have to disable the clamp manually, otherwise the colors are washed out in HDR. Is it possible that the clamp remains applied even in HDR?

jxlarrea commented 1 year ago

Is it possible that the clamp remains applied even in HDR?

@antonp92 that's exactly what's going on. The newer drivers no longer have the API function to remove the clamp in HDR mode. The fork from the guy above is useless as the only thing it does is suppress an error message box.

weili-jiang commented 1 year ago

I never said my fork fixes the real issue. I don't experience the washed out colors on my set up so suppressing the error is fine by me. The API to disable clamp now fails while in HDR so this cannot be truly fixed.

jxlarrea commented 1 year ago

I never said my fork fixes the real issue. I don't experience the washed out colors on my set up so suppressing the error is fine by me. The API to disable clamp now fails while in HDR so this cannot be truly fixed.

I am not 100% certain but I believe that the washed out colors happens when there is an ICC profile added to the clamp. Hope someone else can confirm if they are also seeing this behavior.

antonp92 commented 1 year ago

@jxlarrea I do not have an ICC profile added to the clamp.

weili-jiang commented 1 year ago

I have a calibrated sRGB ICC profile (made using DisplayCAL and Spyder) applied to my clamp. Maybe my setup is unusual - if I have the clamp enabled and simply turn on Windows HDR, with my monitor in SDR mode, it does indeed look awful:

Clamp enabled, Windows HDR, monitor SDR 20230721_201112

If I switch my monitor to HDR mode, it looks better:

Clamp enabled, Windows HDR, monitor HDR 20230721_201130

For comparison, here's clamped SDR with a calibrated ICC profile:

Clamp enabled, Windows SDR, monitor SDR 20230721_201651

weili-jiang commented 1 year ago

Okay I see the difference now, if both my monitor and Windows are in HDR mode and I have clamp on versus off, there is a difference in saturation. Not super obvious until I compared side by side.

antonp92 commented 1 year ago

How difficult would it be to implement a hotkey feature to disable the clamp. If we bind it to Win + Alt + B the clamp will disable at the same time we enable HDR.

weili-jiang commented 1 year ago

How difficult would it be to implement a hotkey feature to disable the clamp. If we bind it to Win + Alt + B the clamp will disable at the same time we enable HDR.

I don't think that would work well as it would be a race condition as to which happens first, it will randomly fail.

I can see it working as an integration with AutoActions, however. I already use AutoActions to automatically put Windows and my monitor into HDR mode when launching Cyberpunk 2077 (since that game doesn't trigger HDR mode - you have to put Windows in HDR mode first).

Using AutoActions, it would be possible to sequence it to ensure that the clamp is disabled before HDR is enabled, and vice-versa. You would just have to explicitly whitelist any applications you want to enable HDR and add it to the action profile.

There would be some work to allow running novideo_srgb as a command line one-shot to set clamp, and have the two instances (the one-shot, and the persistent daemon) synchronize with each other correctly.

antonp92 commented 1 year ago

@ledoge sorry for the direct ping, is there anything in the works resolve this? I would be eternally grateful :)

ledoge commented 1 year ago

Not currently interested in working on this, sorry. IMO the fact that the API cannot be used in HDR while the GPU still uses the values set in SDR is a driver bug that should be fixed by NVIDIA.

DitherMan420 commented 12 months ago

Weird, I never had this issue until I installed drivers 537.34.......

So just to confirm, if I manually UNCLAMP the gamut and THEN switch Windows into HDR mode, everything is fine?

DitherMan420 commented 12 months ago

Not currently interested in working on this, sorry. IMO the fact that the API cannot be used in HDR while the GPU still uses the values set in SDR is a driver bug that should be fixed by NVIDIA.

Are you sure there is nothing you can do to see if you can fix it on your side? This tool you made is seriously one of the most useful and best-working tools for gamut clamping. It would be a shame to lose functionality. Having to manually uncheck the clamp box every time you want to turn on HDR is a major pain in the ass. Can you please look into it? If you don't mind?

DitherMan420 commented 11 months ago

Not currently interested in working on this, sorry. IMO the fact that the API cannot be used in HDR while the GPU still uses the values set in SDR is a driver bug that should be fixed by NVIDIA.

Following up on my last comment thank you!

KrazyDeinos commented 9 months ago

Reading the 4.1 changes, does it relate to this issue?

ledoge commented 9 months ago

Reading the 4.1 changes, does it relate to this issue?

That change is just for easier adjustment of dither settings when you don't have an active color space conversion in the first place. I.e. if you have the clamp disabled in SDR, and then switch to HDR, you'd get this error message sometimes despite there not being anything to disable in the first place. Still can't do anything about the case where you have a color space conversion active in SDR and then switch to HDR, unfortunately :/

KrazyDeinos commented 9 months ago

No worries, I know you don't have a way of solve this , I just hoped Christmas came early. Maybe someday Nvidia will make some adjustments so this can be worth using, but for now it's easier to push the buttons on the monitor to switch back and forth to the sRGB mode.

calmoon commented 5 days ago

Since NVIDIA doesn't care, here's a makeshift solution for anyone still annoyed by this.

I wrote a small AutoHotKey script that allows automatically toggling both the Novideo sRGB clamp and HDR by simply pressing Ctrl + Win + H.

To use it:

  1. Download AutoHotKey v1.1 (not v2!) from here: https://www.autohotkey.com/
  2. Copy the code from the bottom of this comment, paste it in a new text file
  3. Find the line "Global installDir" at the top of the file, change the path to where you have Novideo sRGB extracted to
  4. Save the file and change the file extension to .ahk
  5. Double-click the .ahk file you created. A tray icon should appear to indicate the script is now running in the background
  6. Press Ctrl + Win + H at any time while the script is running to trigger the toggle

⚠️ Important:

Code for the script:

Click here to view ``` #SingleInstance Force #Persistent ; Change this to your install folder: Global installDir := "C:\Novideo sRGB" reloadNovideoSRGB() { static exe := "novideo_srgb.exe" Process, Close, %exe% Process, WaitClose, %exe%, 5 if ErrorLevel { MsgBox, Failed to exit Novideo sRGB. reload } Run, %installDir%\%exe% WinWait, ahk_exe %exe%,, 8 if ErrorLevel { MsgBox, Failed to run Novideo sRGB. reload } WinMinimize } ^#h:: config := "config.xml" FileRead, configFileContents, %installDir%\%config% configXml := ComObjCreate("MSXML2.DOMDocument.6.0") configXml.async := false configXml.loadXML(configFileContents) monitorSettings := configXml.selectSingleNode("//monitors/monitor") clampSetting := "clamp_sdr" isClamped := monitorSettings.getAttribute(clampSetting) if (%isClamped%) { monitorSettings.setAttribute(clampSetting):="false" configXml.save(installDir . "\" . config) reloadNovideoSRGB() Send, #!b } else { monitorSettings.setAttribute(clampSetting):="true" configXml.save(installDir . "\" . config) Send, #!b reloadNovideoSRGB() } return ```