Bitcoin Forum

Bitcoin => Project Development => Topic started by: Remember remember the 5th of November on November 08, 2012, 02:24:24 PM



Title: HowTo: Viewing VRM temperatures under Windows in your application(x64 as well).
Post by: Remember remember the 5th of November on November 08, 2012, 02:24:24 PM
Hi all.

A while back a user posted a tool called radeonvolt (https://github.com/ius/radeonvolt) for Linux that was able to display the VRM temperatures and other sensor data for the HD5850. The tool was Linux only. I decided that something must be done for Windows as well, and came to a conclusion with satisfying results. While the GPU mining era is over, there will still be people mining with them various alt-coins even after ASIC hits.

Development in Windows is tricky, more so when you want to map physical memory to userspace. In Linux, you do it with a couple of lines of code, in Windows you need a kernel mode driver and must be digitally signed for x64 variants of Windows(which the majority of us use).
I tried with the KMDF framework, but apparently, Windows didn't like that, so I instead stopped on WDM(Windows Driver Model). Not knowing how to actually map memory, I googled and discovered this awesome driver on CodeProject (http://www.codeproject.com/Articles/35378/Access-Physical-Memory-Port-and-PCI-Configuration) that does exactly this.

I went in, and compiled PhyMem for Windows 7 x64, and pmdll which is a wrapper for accessing the driver with Visual Studio 2012(Was going to use MinGW but was advised not to for kernel drivers). I had compiled pciutils for Windows x64 last year, so I used radeonvolt with minimum changes to the code. PCIUtils for Windows is great, but apparently does not fetch the PCI Region size under Windows so I had to act blind on which address to use to map memory, for my 5850 under Windows it was the 2nd I believe.
After compiling radeonvolt with the needed changes, I was able to successfully display VRM,Voltage,Current and whatnot.
I noticed that the 5870 is similar to the 5850 in regards to the GPU registers and whatnot, so it was possible to make the code display sensor data from it, I don't know of any side effects though. Make sure you do not have multiple tools that do I2C on the card, or you may cause damage.
As for other cards, we need technical documents to understand the internals and write code for it.

In order to run self-signed drivers on Windows x64, test-signing (http://msdn.microsoft.com/en-us/library/windows/hardware/ff553484(v=vs.85).aspx) must be enabled(Driver signing is not enforced on Windows x86). I was also given a link to a project that apparently bypasses driver signing requirement under Windows x64, but I have not tested it and I'm not going to discuss the legality of that now. Link http://code.google.com/p/bypass-x64-dse/

Mapping Physical Memory to userspace is dangerous. Any person with malicious intent aware of such a map may use it to gain control over the system, elevating privileges or doing severe damage with the power of just overwriting data on a specific memory address. Use with care.


Title: Re: Viewing VRM temperatures under Windows(x64 as well).
Post by: 2GOOD on November 08, 2012, 02:24:56 PM
GPU-z  ;D

how do they do it  ::)


Title: Re: Viewing VRM temperatures under Windows(x64 as well).
Post by: Remember remember the 5th of November on November 08, 2012, 02:26:31 PM
GPU-z  ;D

http://www.techpowerup.com/downloads/2181/mirrors.php
I was not asking for a tool. I was providing directions on how to build an application that is able to access VRM temperatures on Windows. Plus, GPU-Z is closed source and does not provide any code/tips on how to do it.


Title: Re: HowTo: Viewing VRM temperatures under Windows(x64 as well).
Post by: 2GOOD on November 08, 2012, 02:28:20 PM
Yes, but why to bother when there is a free tool out there. I don't get it


Title: Re: HowTo: Viewing VRM temperatures under Windows(x64 as well).
Post by: Remember remember the 5th of November on November 08, 2012, 02:30:01 PM
Because it allows building of more robust tools. It for instance now allows me to continue development of my program which monitors GPU sensors and tries to keep the system from overheating,fan failure. But VRM sensors were not exposed via the AMD ADL SDK.
Now I will monitor VRM temps trying to keep the system nice and cool. Plus, there is absolutely no information on the internet on how to do it.

And if everything goes as planned, allows me to develop a commercial non-free application. I just shared the instructions so everyone has a chance.


Title: Re: HowTo: Viewing VRM temperatures under Windows(x64 as well).
Post by: 2GOOD on November 08, 2012, 02:33:33 PM
That makes more sense, anyway my opinion is that you are at least a year late.

Anyway good luck with the project. I'll be happy to beta test it ;)