Page 1 of 3

AutoHotkey & NVIDIA (NvAPI)

Posted: 08 Dec 2014, 09:49
by jNizM
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

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 08 Dec 2014, 12:05
by Bruttosozialprodukt
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?

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 20 Dec 2014, 17:04
by CrazyT666
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?

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 22 Dec 2014, 03:25
by jNizM
Edit:
See First Post ==> Set Digital Vibrance (DVC) per Display
Image

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 22 Dec 2014, 10:14
by just me

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.

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 23 Dec 2014, 06:48
by jNizM
Edit:
See First Post ==> Set Digital Vibrance (DVC) per Display
Image

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 25 Dec 2014, 20:57
by runie
Cool, but does it deal with SLi configurations? The classic example doesn't, atleast.

Awesome script though!

Image

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 26 Dec 2014, 05:00
by jNizM
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 °)

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 26 Dec 2014, 14:26
by jNizM
Edit:
See First Post ==> Set Digital Vibrance (DVC) per Display
Image

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 29 Dec 2014, 03:06
by jNizM
* Add new functions
* Add new example: Digital Vibrance Control per Display
* Bugfixes

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 03 Jan 2015, 17:34
by runie
Hey, do you have skype or steam? I have something related to this I want to ask you about :p

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 04 Jan 2015, 07:46
by jNizM
Ill pm you my steam id

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 04 Jan 2015, 11:07
by joedf

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 12 Jan 2015, 00:07
by CrazyT666
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...

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 12 Jan 2015, 05:20
by jNizM
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

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 13 Feb 2015, 02:55
by Guest
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

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 13 Feb 2015, 02:56
by Vols and Jezuz
Oops that was me, forgot to login.

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 21 Feb 2015, 04:56
by Guest
Hi, how can i toggle NV Surround and screen resolutions with this script?

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 22 Aug 2015, 06:59
by Vols and Jezuz
@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

Re: AutoHotkey & NVIDIA (NvAPI)

Posted: 23 Aug 2015, 22:16
by Azevedo
Hi, Is it possible to control brightness, contrast, saturation?
Image