Sign in to follow this  
Followers 0
GtaSpider

nVidia Graphiccard temp check

7 posts in this topic

#1 ·  Posted (edited)

Hello,

This Tool shows you the temperature of your nVidia GraphicsCard. If the temperature becomes too high, it will automaticly cool down your GraCa.

But the fan is only regularable if you have nVidia nTune installed on your PC. If not, you can download it on www.nvidia.com

For the temperature you only have to install a normal nVidia driver.

You can move the GUI by Dragging the GUI.

;By GtaSpider - Oct, 2008
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

Opt("GuiOnEventMode", 1)

Global $iHot = 75; If temperature becomes more than 75, the GUI going to be yellow
Global $iTooHot = 85 ;If temperature becomes more than 85, graphiccard will be cool down
Global $iTimeToCoolDown = 10 ;10 Seconds cooldown

Global $iOldTemp = 0
Global $hNvCplDLL, $hnVsublibDLL

;PathDeclare
Global $nvcpldll = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\MediaCenterTray\NvCpl.dll", "FullPath")
Global $nvsulibdll = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\nTune", "NVSUProfilePath")
$nvsulibdll = StringLeft($nvsulibdll, StringInStr($nvsulibdll, "\", -1, -1)) & "nvsulib.dll"

;If not exist..
If Not FileExists($nvcpldll) Then Exit MsgBox(16, "", $nvcpldll & " doesn't exists")
If Not FileExists($nvsulibdll) Then
    MsgBox(48, "", $nvsulibdll & " doesn't exists!" & @CRLF & "The speed is not regulareable!" & @CRLF & "Download nTune on www.nvidia.com")
    $nvsulibdll = False
EndIf

;DLLs
Global $hNvCplDLL = DllOpen("Nvcpl.dll")
If $nvsulibdll Then Global $hnVsublibDLL = DllOpen("c:\programme\nvidia corporation\ntune\nvsulib.dll")
If $nvsulibdll Then DllCall($hnVsublibDLL, "none", "RestoreGpuCoolerSettingsDll", "int", False);Set fan to automatic

;GUI
GUICreate("", 200, 20, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit");If ESC pushed exit
GUISetBkColor(0x00ff00)

$hLab = GUICtrlCreateLabel("", 0, 3, 200, 20, 1, $GUI_WS_EX_PARENTDRAG);Dragable
GUICtrlSetTip(-1, "Drag me!")
GUICtrlSetBkColor(-1, -2)


GUISetState()

While 1
    $iTemp = DllCall($hNvCplDLL, "int:cdecl", "NvCplGetThermalSettings", "int", 0, "long*", '', "long*", "", "long*", "")
    $iTemp = Number($iTemp[2])
    If $iTemp <> $iOldTemp Then
        GUICtrlSetData($hLab, $iTemp & " °C")
        If $iTemp >= $iTooHot Then
            ConsoleWrite("!Too Hot, " & $iTemp & " °C" & @CRLF)
            GUISetBkColor(0xff0000)
            _CoolDown()
        ElseIf $iTemp >= $iHot Then
            ConsoleWrite("-Hot, " & $iTemp & " °C" & @CRLF)
            GUISetBkColor(0xffff00)
        Else
            ConsoleWrite("+Normal, "&$iTemp&" °C" & @CRLF)
            GUISetBkColor(0x00ff00)
        EndIf
        $iOldTemp = $iTemp
    EndIf
    Sleep(1000)
WEnd

Func _CoolDown()
    If Not $nvsulibdll Then Return ConsoleWrite("!WARNING: Too hot but could not regular the temperature" & @CRLF)
    $aRetDll = DllCall($hnVsublibDLL, "none", "SetGpuCoolerLevelDll", "int", 0, "int", 100);Set fan to 100%
    Sleep($iTimeToCoolDown * 1000)
    $aRetDll = DllCall($hnVsublibDLL, "none", "RestoreGpuCoolerSettingsDll", "int", False);Set fan to automatic
EndFunc   ;==>_CoolDown

Func _exit()
    Exit
EndFunc   ;==>_exit

Func OnAutoItExit()
    If $hnVsublibDLL Then DllClose($hnVsublibDLL)
    If $hNvCplDLL Then DllClose($hNvCplDLL)
EndFunc   ;==>OnAutoItExit

Hope someone find use for it. :P

Your Spider

Edit: HotFix

Edit2: HotFix2

Edited by GtaSpider

www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
Share on other sites



Good Job :P Although I only have a sucky Intel graphics card ...


code

Share this post


Link to post
Share on other sites

Works great! Just need to install nTune. This should also display the temperature on the GUI itself. :P

Share this post


Link to post
Share on other sites

Hi

Thanks for your comments :P

Your Spider


www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
Share on other sites

nice..!!

Share this post


Link to post
Share on other sites

Very good. But need little correction: I not have a nTune utility and when I close your script I get this warning:

c:\Test.au3 (76) : ==> Invalid file handle used.:
DllClose($hnVsublibDLL)

I think this will is correct:

Func OnAutoItExit()
    If $hnVsublibDLL Then DllClose($hnVsublibDLL)
    If $hNvCplDLL Then DllClose($hNvCplDLL)
EndFunc   ;==>OnAutoItExit

:P

Share this post


Link to post
Share on other sites

Hups, there i was a little bit too fast :P

Thanks

Spider


www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0