Jump to content

nVidia Graphiccard temp check


GtaSpider
 Share

Recommended Posts

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 Forum

 

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...