Overclock.net › Forums › Graphics Cards › AMD/ATI › ATI Drivers and Overclocking Software › VRMtool - a simple tool to read and write to I2C VRM controllers
New Posts  All Forums:Forum Nav:

VRMtool - a simple tool to read and write to I2C VRM controllers - Page 4

post #31 of 79
you can use asus tweak for this wink.gif
FX
(7 items)
 
  
CPUMotherboardGraphicsRAM
FX-8320@4.4Ghz M5A99FX PRO R2.0 AMD Radeon R9 290X Patriot Memory  
Hard DriveCoolingMonitor
Samsung 840 Raijintek Ereboss iiyama X4071UHSU (4K) 
  hide details  
Reply
FX
(7 items)
 
  
CPUMotherboardGraphicsRAM
FX-8320@4.4Ghz M5A99FX PRO R2.0 AMD Radeon R9 290X Patriot Memory  
Hard DriveCoolingMonitor
Samsung 840 Raijintek Ereboss iiyama X4071UHSU (4K) 
  hide details  
Reply
post #32 of 79
@deeper-blue I am trying to use ADL2_Display_WriteAndReadI2C but the desciption of the ADLI2C structure members are lacking. What are the correct values?

I2C clock speed in KHz is 100 (Normal), 400 (Fast) or 1000 (Max speed). So is 400 ok?
Edited by BromoL - 8/16/16 at 4:18am
i5 3470 + RX 480
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3470 Gigabyte H77-DS3H AMD Radeon RX 480 2 x 4GB Corsair Vengeance LP DDR3-1600 
Hard DriveHard DriveCoolingOS
128GB Samsung 830 SSD 240GB OCZ Trion 150 SSD Thermalright HR-02 Macho Rev. A (BW) Windows 10 Pro 
MonitorKeyboardPowerCase
Dell U2713HM generic Thermaltake Munic 430W Antec Three Hundred 
Mouse
Roccat Kone Pure Military 
  hide details  
Reply
i5 3470 + RX 480
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3470 Gigabyte H77-DS3H AMD Radeon RX 480 2 x 4GB Corsair Vengeance LP DDR3-1600 
Hard DriveHard DriveCoolingOS
128GB Samsung 830 SSD 240GB OCZ Trion 150 SSD Thermalright HR-02 Macho Rev. A (BW) Windows 10 Pro 
MonitorKeyboardPowerCase
Dell U2713HM generic Thermaltake Munic 430W Antec Three Hundred 
Mouse
Roccat Kone Pure Military 
  hide details  
Reply
post #33 of 79
Thread Starter 
Quote:
Originally Posted by BromoL View Post

@deeper-blue I am trying to use ADL2_Display_WriteAndReadI2C but the desciption of the ADLI2C structure members are lacking. What are the correct values?

I2C clock speed in KHz is 100 (Normal), 400 (Fast) or 1000 (Max speed). So is 400 ok?

This is my wrapper code for using this function it shoudl get you started. I use 100 but I think 400 should also be no problem.
Code:
int I2C_WriteAndRead(int iAdapterIndex, int iLine, int iAddress, int iOffset, int iAction, int iDataSize, char *pI2Cdata)
{
        ADLI2C *pI2C;
        ADLI2C I2Cstore;
        pI2C = &I2Cstore;

        pI2C->iSize = sizeof(ADLI2C);
        pI2C->iSpeed = 100;
        pI2C->iAction = iAction;

        pI2C->iLine = iLine;
        pI2C->iAddress = iAddress << 1;

        pI2C->iOffset = iOffset;

        pI2C->iDataSize = iDataSize;
        pI2C->pcData = pI2Cdata;

        return ADL_Display_WriteAndReadI2C(iAdapterIndex, pI2C);
}
post #34 of 79
Ok, thanks. On problem i still have is, that i can only read single bytes. Setting iDataSize greater one only repeats the first byte multiple times.

So far i am using the ADL2-variants of functions with context argument. But i have some performance issues. Reading 6 values per second (directly one after the other) already produces stuttering in 3d applications. Is the locking mechanism only relevant for multithreading and performance better without it? Or does using the wrong frequency add some expensive frequency switching? I will make some more tests.

I also use ADL2_Display_WriteAndReadI2C to acces the SMB. Is this 'the way its meant to done'?. I use information from http://www.irf.com/product-info/datasheets/data/ir3565b.pdf. I assume, that your plot voltage is also from the SMB, because it differs from VID and VDDC. VIN seems also to be encoded in the 11-bit linear format (i get plausible values around 12V this way). I was not successful in decoding any current or power values. Sometimes they seem right (close to power target under load) but often they are way of. That also holds for the current from I2C registers. Or constantly polling the bus causes some kind of throttling. But HWiNFO also fails to read plausible values.

AMD released ADL SDK 10. So i tried some of the ODN-APIs (OverdriveNext). But i could not get power draw from there either. I wonder what GPU-Z is doing. Most of the stuff (clocks, fan control, ...) seems to work fine. Currently i am trying to combine Wattman and I2C/SMB features (with logging) in one application.

I would like to have LLC permanently enabled, because vdroop seems kind of unpredictable under varying load. But booting with low voltages and failing to enable LLC is predetermined to crash rather soon. With LLC enabled i can undervolt to 1000mV at stock clocks. Without LLC i need 1025 mV VID, which drops to 1002 sometimes. The register mapping posted py @gupsterg mentions that "no VDroop sends driver "iffy" so no good for 24/7 use". I wonder what that means. I could not observe any problems with LLC enabled so far (using it for some gaming sessions).

I am currently not sure what i want to achive with my application. I think having some easy profile switching (including stuff not available in Wattman) combined with logging would be fine. But transfering like 100 bytes over the I2C bus equates to 8 ms (at 100kHz). If the GPU or driver is somehow blocked during this time, logging I2C registers (few per second) is probably not reasonable.

I really enjoyed buildzoid's RX 480 hardmodding streams. Softmodding is more accessible to me. I learned some stuff about VRMs and I2C/SMB and had fun with my RX 480 (outside of gaming).
Edited by BromoL - 8/18/16 at 7:54am
i5 3470 + RX 480
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3470 Gigabyte H77-DS3H AMD Radeon RX 480 2 x 4GB Corsair Vengeance LP DDR3-1600 
Hard DriveHard DriveCoolingOS
128GB Samsung 830 SSD 240GB OCZ Trion 150 SSD Thermalright HR-02 Macho Rev. A (BW) Windows 10 Pro 
MonitorKeyboardPowerCase
Dell U2713HM generic Thermaltake Munic 430W Antec Three Hundred 
Mouse
Roccat Kone Pure Military 
  hide details  
Reply
i5 3470 + RX 480
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3470 Gigabyte H77-DS3H AMD Radeon RX 480 2 x 4GB Corsair Vengeance LP DDR3-1600 
Hard DriveHard DriveCoolingOS
128GB Samsung 830 SSD 240GB OCZ Trion 150 SSD Thermalright HR-02 Macho Rev. A (BW) Windows 10 Pro 
MonitorKeyboardPowerCase
Dell U2713HM generic Thermaltake Munic 430W Antec Three Hundred 
Mouse
Roccat Kone Pure Military 
  hide details  
Reply
post #35 of 79
Could you incude support for r9 380 and 285 NCP81022?. This datasheet will help: http://media.digikey.com/pdf/Data%20Sheets/ON%20Semiconductor%20PDFs/NCP81022.pdf

I2c dump is: Warning: Spoiler! (Click to show)
Code:
------[ ATI I2C Device GPU #1 / B06-D24 ]------

  0000  FF 80 17 7F FF FF FF FF FF FF FF FF FF FF FF FF  ...............
  0010  00 FF FF FF FF FF FF FF FF B0 FF FF FF FF FF FF  ................
  0020  22 00 FF FF 00 18 A8 FF FF FF FF FF FF FF FF FF  "...............
  0030  FF FF FF FF FF FF FF FF 01 00 FF FF FF FF FF FF  ................
  0040  FF FF FF FF FF FF FF FF FF FF 64 FF FF FF FF 55  ..........d....U
  0050  FF 46 00 64 FF 10 FF FF FF FF FF FF FF FF FF FF  .F.d............
  0060  FF FF FF FF FF FF FF FF 2C FF FF FF FF FF FF FF  ........,.......
  0070  FF FF FF FF FF FF FF FF 00 00 00 00 00 00 FF FF  ................
  0080  FF FF FF FF FF FF FF FF E9 FF FF 3F F0 00 FF FF  ...........?....
  0090  FF FF FF FF FF FF 64 FF FF 1A 22 03 FF FF FF FF  ......d...".....
  00A0  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
  00B0  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
  00C0  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
  00D0  00 01 00 03 50 02 00 FF FF FF 01 FF FF FF FF FF  ....P...........
  00E0  FF 00 00 02 03 03 00 3D FF FF FF FF FF FF FF FF  .......=........
  00F0  FF FF FF 68 FF FF FF 0A BC 9C FF 07 FF 0F FF FF  ...h............

------[ ATI I2C Device GPU #1 / B06-D24 ]------

  0000  FFFF 2F80 7E17 FF7F FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0010  6F00 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 4CB0 FFFF FFFF FFFF FFFF FFFF FFFF 
  0020  6022 0000 FFFF FFFF 0000 0018 00A8 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0030  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0001 0000 FFFF FFFF FFFF FFFF FFFF FFFF 
  0040  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0064 FFFF FFFF FFFF FFFF 0055 
  0050  FFFF 0046 0000 0064 FFFF 0010 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0060  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 012C FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0070  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FB00 0000 2D00 4600 5000 3B00 FFFF FFFF 
  0080  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF D2E9 FFFF FFFF 013F A2F0 0000 FFFF FFFF 
  0090  FFFF FFFF FFFF FFFF FFFF FFFF A364 FFFF FFFF 001A 1022 8103 FFFF FFFF FFFF FFFF 
  00A0  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00B0  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00C0  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00D0  E200 8E01 3400 5603 BA50 2C02 9F00 FFFF FFFF FFFF 6201 FFFF FFFF FFFF FFFF FFFF 
  00E0  FFFF 6800 D500 B002 A103 CA03 7E00 003D FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00F0  FFFF FFFF FFFF 0368 FFFF FFFF FFFF 810A F5BC F29C FFFF 5807 FFFF 1D0F FFFF FFFF

Thanks thumb.gif
Edited by mynm - 8/23/16 at 10:24am
post #36 of 79
Thread Starter 
Quote:
Originally Posted by BromoL View Post

Ok, thanks. On problem i still have is, that i can only read single bytes. Setting iDataSize greater one only repeats the first byte multiple times.

So far i am using the ADL2-variants of functions with context argument. But i have some performance issues. Reading 6 values per second (directly one after the other) already produces stuttering in 3d applications. Is the locking mechanism only relevant for multithreading and performance better without it? Or does using the wrong frequency add some expensive frequency switching? I will make some more tests.

If you haven't already figured it out yourself, here is how I can read a word instead of just one byte - which you will need to read from the PMBus address of the I2C device. And yes as you guessed that's what I'm reading out to generate the graphs.

Also I don't think the context versions of the functions make any difference, they are more meant for preventing issues if you access ADL from multiple threads in your app.

Regarding the problem of stalling the GPU during access - it seems like we can't prevent that. Running VRM tool and having it read out all the register values does interrupt the GPU quite heavily. Not sure if there's a better way do to it.

I'm in the middle of rewriting the whole thing to allow me more flexibility for things that I want to support - when/if that works it will be put up on github.
Code:
     char *pI2Cdata;
        UINT16 I2Cdata;
        pI2Cdata = (char *)&I2Cdata;

        int iResult = I2C_WriteAndRead(iAdapterIndex, iLine, iAddress, iRegister, ADL_DL_I2C_ACTIONREAD_REPEATEDSTART, 2, pI2Cdata);
        if (iResult != ADL_OK) {
                m_TextOut.Format(_T("%s\r\nFailed to read from I2C register. Error code: %d\r\n"), m_TextOut.GetString(), iResult);
        }
post #37 of 79
Thread Starter 
Quote:
Originally Posted by mynm View Post

Could you incude support for r9 380 and 285 NCP81022?. This datasheet will help: http://media.digikey.com/pdf/Data%20Sheets/ON%20Semiconductor%20PDFs/NCP81022.pdf

I2c dump is: Warning: Spoiler! (Click to show)
Code:
------[ ATI I2C Device GPU #1 / B06-D24 ]------

  0000  FF 80 17 7F FF FF FF FF FF FF FF FF FF FF FF FF  ...............
  0010  00 FF FF FF FF FF FF FF FF B0 FF FF FF FF FF FF  ................
  0020  22 00 FF FF 00 18 A8 FF FF FF FF FF FF FF FF FF  "...............
  0030  FF FF FF FF FF FF FF FF 01 00 FF FF FF FF FF FF  ................
  0040  FF FF FF FF FF FF FF FF FF FF 64 FF FF FF FF 55  ..........d....U
  0050  FF 46 00 64 FF 10 FF FF FF FF FF FF FF FF FF FF  .F.d............
  0060  FF FF FF FF FF FF FF FF 2C FF FF FF FF FF FF FF  ........,.......
  0070  FF FF FF FF FF FF FF FF 00 00 00 00 00 00 FF FF  ................
  0080  FF FF FF FF FF FF FF FF E9 FF FF 3F F0 00 FF FF  ...........?....
  0090  FF FF FF FF FF FF 64 FF FF 1A 22 03 FF FF FF FF  ......d...".....
  00A0  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
  00B0  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
  00C0  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  ................
  00D0  00 01 00 03 50 02 00 FF FF FF 01 FF FF FF FF FF  ....P...........
  00E0  FF 00 00 02 03 03 00 3D FF FF FF FF FF FF FF FF  .......=........
  00F0  FF FF FF 68 FF FF FF 0A BC 9C FF 07 FF 0F FF FF  ...h............

------[ ATI I2C Device GPU #1 / B06-D24 ]------

  0000  FFFF 2F80 7E17 FF7F FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0010  6F00 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 4CB0 FFFF FFFF FFFF FFFF FFFF FFFF 
  0020  6022 0000 FFFF FFFF 0000 0018 00A8 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0030  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0001 0000 FFFF FFFF FFFF FFFF FFFF FFFF 
  0040  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0064 FFFF FFFF FFFF FFFF 0055 
  0050  FFFF 0046 0000 0064 FFFF 0010 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0060  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 012C FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  0070  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FB00 0000 2D00 4600 5000 3B00 FFFF FFFF 
  0080  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF D2E9 FFFF FFFF 013F A2F0 0000 FFFF FFFF 
  0090  FFFF FFFF FFFF FFFF FFFF FFFF A364 FFFF FFFF 001A 1022 8103 FFFF FFFF FFFF FFFF 
  00A0  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00B0  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00C0  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00D0  E200 8E01 3400 5603 BA50 2C02 9F00 FFFF FFFF FFFF 6201 FFFF FFFF FFFF FFFF FFFF 
  00E0  FFFF 6800 D500 B002 A103 CA03 7E00 003D FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
  00F0  FFFF FFFF FFFF 0368 FFFF FFFF FFFF 810A F5BC F29C FFFF 5807 FFFF 1D0F FFFF FFFF

Thanks thumb.gif

Thank you for the dump!
And yes I plan to add support for that VRM controller. I'm rewriting the tool right now to make it easier for me to extend it with additional chips and functionality.
post #38 of 79
Quote:
Originally Posted by deeper-blue View Post

Thank you for the dump!
And yes I plan to add support for that VRM controller. I'm rewriting the tool right now to make it easier for me to extend it with additional chips and functionality.

Great! Tranks thumb.gif
post #39 of 79
Quote:
Originally Posted by deeper-blue View Post

If you haven't already figured it out yourself, here is how I can read a word instead of just one byte - which you will need to read from the PMBus address of the I2C device. And yes as you guessed that's what I'm reading out to generate the graphs.

Also I don't think the context versions of the functions make any difference, they are more meant for preventing issues if you access ADL from multiple threads in your app.

Regarding the problem of stalling the GPU during access - it seems like we can't prevent that. Running VRM tool and having it read out all the register values does interrupt the GPU quite heavily. Not sure if there's a better way do to it.

I'm in the middle of rewriting the whole thing to allow me more flexibility for things that I want to support - when/if that works it will be put up on github.
Code:
     char *pI2Cdata;
        UINT16 I2Cdata;
        pI2Cdata = (char *)&I2Cdata;

        int iResult = I2C_WriteAndRead(iAdapterIndex, iLine, iAddress, iRegister, ADL_DL_I2C_ACTIONREAD_REPEATEDSTART, 2, pI2Cdata);
        if (iResult != ADL_OK) {
                m_TextOut.Format(_T("%s\r\nFailed to read from I2C register. Error code: %d\r\n"), m_TextOut.GetString(), iResult);
        }

I think I am using only ADL_DL_I2C_ACTIONREAD to read 2 bytes (as a word) from the PMBus. It is working there, but not for multiple consecutive I2C registers (where i only get the first byte repeated several times). The PMBus does not work like registers, because consecutive command codes return different data sizes.

Regarding the locking and multithreading i am confused. There are 4 variants of ADL_Main_Control_Create. The difference ADL2 variants create a context handle with unknown purpose. The SDK explicitly states: "ADL initialized using ADL2_Main_Control_Create will not enforce serialization of ADL API executions by multiple threads." Only the X2 variants have an argument that sets the threading model. But it is still unclear how/whether serialization is done for multiple processes. I had two system crashes while running GPU-Z and my application simultaneously. But it never crashed with only my application running.
i5 3470 + RX 480
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3470 Gigabyte H77-DS3H AMD Radeon RX 480 2 x 4GB Corsair Vengeance LP DDR3-1600 
Hard DriveHard DriveCoolingOS
128GB Samsung 830 SSD 240GB OCZ Trion 150 SSD Thermalright HR-02 Macho Rev. A (BW) Windows 10 Pro 
MonitorKeyboardPowerCase
Dell U2713HM generic Thermaltake Munic 430W Antec Three Hundred 
Mouse
Roccat Kone Pure Military 
  hide details  
Reply
i5 3470 + RX 480
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3470 Gigabyte H77-DS3H AMD Radeon RX 480 2 x 4GB Corsair Vengeance LP DDR3-1600 
Hard DriveHard DriveCoolingOS
128GB Samsung 830 SSD 240GB OCZ Trion 150 SSD Thermalright HR-02 Macho Rev. A (BW) Windows 10 Pro 
MonitorKeyboardPowerCase
Dell U2713HM generic Thermaltake Munic 430W Antec Three Hundred 
Mouse
Roccat Kone Pure Military 
  hide details  
Reply
post #40 of 79
Thread Starter 
Quote:
Originally Posted by BromoL View Post

I think I am using only ADL_DL_I2C_ACTIONREAD to read 2 bytes (as a word) from the PMBus. It is working there, but not for multiple consecutive I2C registers (where i only get the first byte repeated several times). The PMBus does not work like registers, because consecutive command codes return different data sizes.

Regarding the locking and multithreading i am confused. There are 4 variants of ADL_Main_Control_Create. The difference ADL2 variants create a context handle with unknown purpose. The SDK explicitly states: "ADL initialized using ADL2_Main_Control_Create will not enforce serialization of ADL API executions by multiple threads." Only the X2 variants have an argument that sets the threading model. But it is still unclear how/whether serialization is done for multiple processes. I had two system crashes while running GPU-Z and my application simultaneously. But it never crashed with only my application running.

I too noticed that just ACTIONREAD does seem to work - but from reading the PMBus spec I think the REPEATED_START would be the correct approach.
Now I'm not sure what exactly you're trying to do but each register is only one byte and you cannot read out all registers in one command, you do have to read one single byte from each register to get the whole register map - which of course is super slow hence you only want to do this for sparsingly.

The crashes are easily explained and the context functions of ADL don't work across processes. So what happens is that two apps access the I2C bus and their commands can corrupt each other which can quickly result in a crash (a simple way to see that it's easy to crash the system via I2C is this: just try to read one single byte from all the PMBus device offsets, aka just make a register map like you would for the I2C register interface of the VRM -> Reboot every single time).
I've read that afterburner does work with a mutex that is supposed to safeguard I2C access across different tools that access the bus - but haven't really looked into it yet.
Also the Fury cards crash very fast after starting VRM tool. I suspect the I2C commands from the GPU interfere with the I2C commands from the tool, newer/older GPUs likely have a safeguard against that.
New Posts  All Forums:Forum Nav:
  Return Home
Overclock.net › Forums › Graphics Cards › AMD/ATI › ATI Drivers and Overclocking Software › VRMtool - a simple tool to read and write to I2C VRM controllers