AutoHotkey & NVIDIA (NvAPI)

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

AutoHotkey & NVIDIA (NvAPI)

08 Dec 2014, 09:49

AutoHotkey & NVIDIA (NvAPI)

Source
Class_NvAPI.ahk (GitHub)

Converted NvAPI-Functions
* DisableHWCursor()
* DISP_GetGDIPrimaryDisplayId()
* DRS_CreateSession()
* DRS_DestroySession()
* DRS_GetCurrentGlobalProfile()
* DRS_GetNumProfiles()
* DRS_LoadSettings()
* DRS_LoadSettingsFromFile()
* DRS_RestoreAllDefaults()
* DRS_SaveSettings()
* DRS_SaveSettingsToFile()
* EnableHWCursor()
* EnumLogicalGPUs()
* EnumNvidiaDisplayHandle()
* EnumNvidiaUnAttachedDisplayHandle()
* EnumPhysicalGPUs()
* GetAssociatedDisplayOutputId()
* GetAssociatedNvidiaDisplayHandle()
* GetAssociatedNvidiaDisplayName()
* GetDisplayDriverMemoryInfo()
* GetDisplayDriverVersion()
* GetDisplayPortInfo()
* GetDVCInfo()
* GetDVCInfoEx()
* GetErrorMessage()
* GetHDMISupportInfo()
* GetHUEInfo()
* GetInterfaceVersionString()
* GetUnAttachedAssociatedDisplayName()
* GetVBlankCounter()
* GPU_GetAGPAperture()
* GPU_GetAllClockFrequencies()
* GPU_GetBoardInfo()
* GPU_GetBusId()
* GPU_GetBusSlotId()
* GPU_GetBusType()
* GPU_GetCoolerSettings()
* GPU_GetCurrentAGPRate()
* GPU_GetCurrentPCIEDownstreamWidth()
* GPU_GetCurrentPstate()
* GPU_GetDynamicPstatesInfoEx()
* GPU_GetFullName()
* GPU_GetGpuCoreCount()
* GPU_GetGPUType()
* GPU_GetHDCPSupportStatus()
* GPU_GetIRQ()
* GPU_GetMemoryInfo()
* GPU_GetOutputType()
* GPU_GetPerfDecreaseInfo()
* GPU_GetPhysicalFrameBufferSize()
* GPU_GetSystemType()
* GPU_GetTachReading()
* GPU_GetThermalSettings()
* GPU_GetUsages()
* GPU_GetVbiosOEMRevision()
* GPU_GetVbiosRevision()
* GPU_GetVbiosVersionString()
* GPU_GetVirtualFrameBufferSize()
* GPU_SetCoolerLevels()
* SetDVCLevel()
* SetDVCLevelEx()
* SetHUEAngle()
* Stereo_IsEnabled()
* Stereo_IsWindowedModeSupported()
* SYS_GetChipSetInfo()
* SYS_GetDriverAndBranchVersion()
* Unload()
* VIO_EnumDevices()
* VIO_GetCapabilities()
* VIO_IsRunning()
* VIO_Start()
* VIO_Stop()

Examples:
- All functions and returns in a ListView (Source)
Image

- Classic GUI (Clocks, Load, Fans & Temperature) (Source)
Image

- Set Digital Vibrance (DVC / Saturation) per Display (Source)
Image


Contributing
- special thanks to just me
- thanks to AutoHotkey Community

Copyright and License
unlicense.org & NVIDIA NVAPI SDK LICENSE
Last edited by jNizM on 29 Dec 2014, 05:05, edited 2 times in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: AutoHotkey & NVIDIA (NvAPI)

08 Dec 2014, 12:05

Woah, this is amazing!
I was looking for a way to find the GPU load a while ago and I think I finally found it. =)
I'm wondering if there is a similar API for AMD?
CrazyT666
Posts: 2
Joined: 20 Dec 2014, 16:58

Re: AutoHotkey & NVIDIA (NvAPI)

20 Dec 2014, 17:04

Hey could you please explain me how you managed to CHANGE the Digital vibrance for a specified Monitor?

I don't have your skills in AHK or something... it's like magic for me what you've done!

For Example:

I wan't DV @ 75 instead of stock 50 on Monitor 1

and the other Monitor stays @stock 50 how to hell do i manage that?
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

22 Dec 2014, 03:25

Edit:
See First Post ==> Set Digital Vibrance (DVC) per Display
Image
Last edited by jNizM on 29 Dec 2014, 09:33, edited 2 times in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
just me
Posts: 9425
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: AutoHotkey & NVIDIA (NvAPI)

22 Dec 2014, 10:14

Code: Select all

DllCall(NvAPI._SetDVCLevelEx, "Ptr", hNvDisplay, "UInt", outputId, "Ptr", &pDVCInfo, "CDECL")
SetDVCLevelEx() accepts a hNvDisplay handle which could be determined within SetDVCLevelEx() if either the monitor name or the index to use with NvAPI.EnumNvidiaDisplayHandle() would be passed to the function.
To get the handle associated with the monitor name NvAPI_GetAssociatedNvidiaDisplayHandle() might be useful.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

23 Dec 2014, 06:48

Edit:
See First Post ==> Set Digital Vibrance (DVC) per Display
Image
Last edited by jNizM on 29 Dec 2014, 09:33, edited 2 times in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
runie
Posts: 304
Joined: 03 May 2014, 14:50
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

25 Dec 2014, 20:57

Cool, but does it deal with SLi configurations? The classic example doesn't, atleast.

Awesome script though!

Image
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

26 Dec 2014, 05:00

Its because I can not test it with SLI

(p.s. Temperature text failure: save your script as UTF-8 | or use Chr(176) for °)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

26 Dec 2014, 14:26

Edit:
See First Post ==> Set Digital Vibrance (DVC) per Display
Image
Last edited by jNizM on 29 Dec 2014, 09:33, edited 1 time in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

29 Dec 2014, 03:06

* Add new functions
* Add new example: Digital Vibrance Control per Display
* Bugfixes
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
runie
Posts: 304
Joined: 03 May 2014, 14:50
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

03 Jan 2015, 17:34

Hey, do you have skype or steam? I have something related to this I want to ask you about :p
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

04 Jan 2015, 07:46

Ill pm you my steam id
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
CrazyT666
Posts: 2
Joined: 20 Dec 2014, 16:58

Re: AutoHotkey & NVIDIA (NvAPI)

12 Jan 2015, 00:07

Well, to be honest.... i don't get how i set the DVC level with a hotkey, can i add you in steam if you want?

I't really heavy to understand for me.... that looks like higher programming skills for me...
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: AutoHotkey & NVIDIA (NvAPI)

12 Jan 2015, 05:20

Here is an example how to change DVC via Hotkey

Code: Select all

; GLOBAL SETTINGS ===============================================================================================================

;#Warn
#NoEnv
#SingleInstance Force
SetBatchLines -1
#Include Class_NvAPI.ahk

; SCRIPT ========================================================================================================================

OnExit, EOF
NVIDIA := new NvAPI()

def := NVIDIA.GetDVCInfoEx(0).defaultLevel


; Win + Numpad 4 (or Numpad Left)      ==> Decrease Digital Vibrance by 1
#Numpad4::     NVIDIA.SetDVCLevelEx((DV := NVIDIA.GetDVCInfoEx(0).currentLevel - 1) > 100 ? 100 : DV < 0 ? 0 : DV, 0)
#NumpadLeft::  NVIDIA.SetDVCLevelEx((DV := NVIDIA.GetDVCInfoEx(0).currentLevel - 1) > 100 ? 100 : DV < 0 ? 0 : DV, 0)


; Win + Numpad 5 (or Numpad Clear)     ==> Set Digital Vibrance to Default (50)
#Numpad5::     NVIDIA.SetDVCLevelEx(def, 0)
#NumpadClear:: NVIDIA.SetDVCLevelEx(def, 0)


; Win + Numpad 6 (or Numpad Right)     ==> Increase Digital Vibrance by 1
#Numpad6::     NVIDIA.SetDVCLevelEx((DV := NVIDIA.GetDVCInfoEx(0).currentLevel + 1) > 100 ? 100 : DV < 0 ? 0 : DV, 0)
#NumpadRight:: NVIDIA.SetDVCLevelEx((DV := NVIDIA.GetDVCInfoEx(0).currentLevel + 1) > 100 ? 100 : DV < 0 ? 0 : DV, 0)


; Win + Numpad 8 (or Numpad UpArrow)   ==> Set Digital Vibrance to 80
#Numpad8::     NVIDIA.SetDVCLevelEx(80, 0)
#NumpadUp::    NVIDIA.SetDVCLevelEx(80, 0)


; EXIT ==========================================================================================================================

GuiClose:
EOF:
NVIDIA.SetDVCLevelEx(def, 0)
NVIDIA.OnExit()
ExitApp
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Guest

Re: AutoHotkey & NVIDIA (NvAPI)

13 Feb 2015, 02:55

This script is great! I used a small bit of it in a program I made called sourceGL (and credited you in the credits text file :) ). I'm going to make a thread for it
Vols and Jezuz
Posts: 5
Joined: 13 Feb 2015, 02:53

Re: AutoHotkey & NVIDIA (NvAPI)

13 Feb 2015, 02:56

Oops that was me, forgot to login.
Guest

Re: AutoHotkey & NVIDIA (NvAPI)

21 Feb 2015, 04:56

Hi, how can i toggle NV Surround and screen resolutions with this script?
Vols and Jezuz
Posts: 5
Joined: 13 Feb 2015, 02:53

Re: AutoHotkey & NVIDIA (NvAPI)

22 Aug 2015, 06:59

@jNizM I'm trying to add some NvAPI functions like GPU_SetCoolerLevels to your AHK Nvidia library, but I'm having trouble with the DllCall's. Would you add me on Steam and take a look at my code? I'll PM you my Steam profile. Thanks
Azevedo
Posts: 81
Joined: 07 Feb 2014, 11:35

Re: AutoHotkey & NVIDIA (NvAPI)

23 Aug 2015, 22:16

Hi, Is it possible to control brightness, contrast, saturation?
Image

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: nitsik and 187 guests