DGL
https://delphigl.com/forum/

Get GPU temp and fan speeds in Delphi
https://delphigl.com/forum/viewtopic.php?f=19&t=11139
Seite 1 von 1

Autor:  GL123 [ Fr Mär 21, 2014 06:19 ]
Betreff des Beitrags:  Get GPU temp and fan speeds in Delphi

There are the usual apps like MSI Afterburner to show a nice graph of your GPU temp and fan speeds.

Does anyone have any Delphi code to do this? I would like to have a similar graph in my app without having to run Afterburner as well.

Any clues/code?

Autor:  GL123 [ Fr Mär 21, 2014 06:24 ]
Betreff des Beitrags:  Re: Get GPU temp and fan speeds in Delphi

For NVidia there is using the NvCplGetThermalSettings call in the NVCPL.DLL
http://developer.download.nvidia.com/SD ... el_API.pdf
Does anyone have experience calling a DLL like that from Delphi?

I am more interested in NVidia anyway as they have the best compiler and support for shaders from my tests so far.

Autor:  GL123 [ Mo Mär 24, 2014 23:40 ]
Betreff des Beitrags:  Re: Get GPU temp and fan speeds in Delphi

OK, an update.

This code apparently works, but failed for me as I have a 32 bit compiled delphi app running under 64 bit Windows 8 so the dll LoadLibrary call fails with system error 193.

Code:
  1. function GetNVDIATemp: integer;
  2. type
  3.   NvCplGetThermalSettings = function(WindowsMonitorNumber: UINT;pGpuTemp, pUmgebTemp, pSlowDownTemp: Pointer): BOOL;stdcall;
  4. var
  5.   hInstNvcpl: THandle;
  6.   GetThermalSettings: NvCplGetThermalSettings;
  7.   UmgebTemp, SlowDownTemp: cardinal;
  8. begin
  9. Result := 0;
  10. UmgebTemp := 0;
  11. SlowDownTemp := 0;
  12. hInstNvcpl := LoadLibrary('nvcpl.dll');
  13. if hInstNvcpl <> 0 then
  14.    try
  15.      GetThermalSettings:= GetProcAddress(hInstNvcpl,'NvCplGetThermalSettings');
  16.      if Assigned(GetThermalSettings)  then
  17.         GetThermalSettings(0, Addr(Result), Addr(UmgebTemp), Addr(SlowDownTemp));
  18.     finally
  19.         FreeLibrary(hInstNvcpl);
  20.     end;
  21. end;

For calling a 64 bit dll from 32 bit dll there is apparently this code that may help
http://cc.embarcadero.com/Item/27667

For now I give up.

Hopefully the above may help someone else who has the same issue.

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/