open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

NVIDIA I2C driver issues

Open CalcProgrammer1 opened this issue 3 years ago • 92 comments

Copy/paste from an email I sent to [email protected], I haven't verified this against this new open driver, but it has been an issue for a while with the proprietary kernel driver.

I am the lead developer of OpenRGB, an open source RGB lighting control application for Windows and Linux. Our goal is to create a universal RGB control app, talking directly to as many RGB lighting devices as possible. As RGB control is often only supported by official software in Windows, Linux users get left out. That's where we come in.

As you are probably aware, a lot of graphics cards have built-in RGB lighting that features software control. Most cards implement RGB control using the GPU's I2C interface. We're facing an issue controlling certain RGB devices over the NVIDIA GPU's I2C interface in Linux with the proprietary NVIDIA driver. The same code is working fine using NvAPI on Windows and using the Nouveau I2C implementation on Linux, so we believe this to be an issue specific to NVIDIA's proprietary Linux driver.

The cards we've been focused on lately are the ASUS 3xxx series cards, which all use a similar I2C RGB chip that is also found on some ASUS motherboards and various manufacturers' RGB DRAM modules. The chip comes from ENE. The I2C protocol used by this chip is a 16-bit address scheme where you first write a 16-bit address to the 0x00 register of the ENE chip, then perform either a read or write operation to a fixed chip register. This chip appears to be an SMBus chip, so we're using the SMBus functions in the Linux kernel as shown in these two accessor functions:

(ene_dev_id is the 8-bit I2C address of the ENE chip, ene_register is the 16-bit address in the chip that we are reading or writing)

unsigned char ENESMBusInterface_i2c_smbus::ENERegisterRead(ene_dev_id dev, ene_register reg)
{
    //Write ENE register
    bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));

    //Read ENE value
    return(bus->i2c_smbus_read_byte_data(dev, 0x81));
}

void ENESMBusInterface_i2c_smbus::ENERegisterWrite(ene_dev_id dev, ene_register reg, unsigned char val)
{
    //Write ENE register
    bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));

    //Write ENE value
    bus->i2c_smbus_write_byte_data(dev, 0x01, val);
}

The issue here appears to be with regards to i2c_smbus_write_word_data. To detect and verify that the chip exists on the bus, we do a series of i2c_smbus_read_byte_data calls and these all work fine on the NVIDIA proprietary Linux driver. However, after detecting the chip we then write a 16-bit address and attempt to read from it. Specifically, we try to read a region of the ENE chip's memory known to contain a version string. The expectation is that the word data write puts the 16-bit address of the byte we want to read into the chip, and the following byte data read from 0x81 returns one byte from the 16-bit address.

With other SMBus host controllers (Intel and AMD chipsets) as well as the NVIDIA GPU I2C on both Windows (NvAPI) and Linux (Nouveau), this works fine and we successfully retrieve the ENE RGB controller's version string. With the NVIDIA proprietary Linux driver, we read garbage. Since we know the i2c_smbus_read_byte_data function works with other manufacturers' NVIDIA GPU boards and for detecting the chip, I can only assume the issue is that the i2c_smbus_write_word_data function isn't working correctly. Note that i2c_smbus_write_byte_data does appear to work on several other manufacturers' GPU RGB chips so I have to assume it's specific to word data.

We have also observed issues with SMBus block operations, though doing the same block operations using I2C_RDWR ioctl (thus avoiding the SMBus layer) seem to work on the NVIDIA proprietary driver.

CalcProgrammer1 avatar May 12 '22 01:05 CalcProgrammer1

The only way I have ever been able to get I²C or DDC working on my nvidia card has been to put:

options nvidia NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100

... in /etc/modprobe.d/nvidia.conf, or else set up an xorg.conf containing something like:

Section "Device"
        Identifier      "Device0"
        Driver          "nvidia"
        VendorName      "NVIDIA Corporation"
        BoardName       "GeForce GTX 750 Ti"
        Option          "RegistryDwords"        "RMUseSwI2c=0x01; RMI2cSpeed=100"
EndSection

I prefer the first method. Have you tried either of these?

I have been using this to control my monitor via DDC (which is I²C) for a year or two. My assumption is that this will also work for on-card lighting (if present), since it's probably all on one bus. I've seen this brought up before relating to Nvidia cards, so I assume it's the same issue.

Note that this driver seems not to support the 750 Ti or other Maxwell GPU's, but I suspect this fix may also work on newer cards.

wyatt8740 avatar May 12 '22 03:05 wyatt8740

The lighting controller is usually on an unused I2C bus (one not connected to a display output for DDC). I can communicate with the controllers on many cards just fine, so I don't think it has to do with I2C speed. It seems to be related to the SMBus subset of the I2C functionality in that word and block transfers do not occur correctly (but byte transfers do). I don't personally have an affected card unfortunately, it's an issue that I had others who owned an appropriate card test. The ASUS RTX3xxx series are the most affected as the lighting controller they use requires 16-bit (word) SMBus writes.

CalcProgrammer1 avatar May 12 '22 03:05 CalcProgrammer1

This explains what I saw when I was fiddling with my ASUS 3090. Interesting.

atiensivu avatar May 12 '22 03:05 atiensivu

Hello gentlemen, To get the best focus for our open source effort, we would like to keep the focus of these GitHub issues to the Open GPU Kernel Modules components. As you may know, we do have a Linux Forum (https://forums.developer.nvidia.com/c/gpu-graphics/145) where more generic issues should be discussed. Submitting the issue through [email protected] get directly to the team of developer, QA, and triage folks who are able to resolve them best. So respectfully, we will close this issue and direct you to continue using the forum for these types of problems/discussions.

PAR2020 avatar May 12 '22 03:05 PAR2020

I2C is part of the kernel components...

https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/kernel-open/nvidia/nv-i2c.c

And as I stated in the original post, I emailed this to [email protected] months ago and never got a reply.

CalcProgrammer1 avatar May 12 '22 03:05 CalcProgrammer1

I actually think removing the block of code at line 191 here would do the trick, as without the I2C_SMBUS capabilities provided by NVIDIA's driver, the kernel will fall back to using the non-SMBus I2C calls through emulation, using an interface we have confirmed working (raw I2C block transfers).

https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/kernel-open/nvidia/nv-i2c.c#L191

The issue is why do I2C SMBUS word operations fail when going through NVIDIA's implementation?

CalcProgrammer1 avatar May 12 '22 04:05 CalcProgrammer1

EVGA 30xx cards use I2C_SMBUS_I2C_BLOCK_DATA commands to talk to the RGB controller and this is not supported under Linux but is supported through nvapi.dll

See this patch that works under Windows for OpenRGB to talk to EVGA cards through NVIDIA's .dll but will fail under Linux: https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/752

Support for I2C_SMBUS_I2C_BLOCK_DATA commands is also missing in this code.

TheRogueZeta avatar May 12 '22 04:05 TheRogueZeta

Also look into https://github.com/NVIDIA/open-gpu-kernel-modules/blob/69791e9bf5161c786d620312fd6396756c37cff9/kernel-open/nvidia/nv-i2c.c#L58

Comment indicates "we only support basic I2C reads/writes, reject any other commands"

CalcProgrammer1 avatar May 12 '22 05:05 CalcProgrammer1

Hi @CalcProgrammer1 I'm sorry you didn't receive a response to your linux-bugs email. I agree this merits investigation. Reopening.

aritger avatar May 12 '22 06:05 aritger

We have filed a bug 3646481 internally for tracking purpose. You can refer it for status update.

amrit1711 avatar May 16 '22 07:05 amrit1711

@CalcProgrammer1: can you test whether the following change fixes the problem for you?

$ git diff
diff --git a/kernel-open/nvidia/nv-i2c.c b/kernel-open/nvidia/nv-i2c.c
index f227d180e149..8bc6cf6314e7 100644
--- a/kernel-open/nvidia/nv-i2c.c
+++ b/kernel-open/nvidia/nv-i2c.c
@@ -140,8 +140,9 @@ static int nv_i2c_algo_smbus_xfer(
         case I2C_SMBUS_WORD_DATA:
             if (read_write != I2C_SMBUS_READ)
             {
-                data->block[1] = (data->word & 0xff);
-                data->block[2] = (data->word >> 8);
+                u16 word = data->word;
+                data->block[1] = (word & 0xff);
+                data->block[2] = (word >> 8);
             }
 
             rmStatus = rm_i2c_transfer(sp, nv, (void *)adapter,

(the same change should apply to both the open kernel modules here and to the proprietary driver)

aritger avatar May 23 '22 18:05 aritger

@CalcProgrammer1 Can you please help to test the change fixe as suggested in last comment and share results.

amrit1711 avatar May 30 '22 07:05 amrit1711

Unfortunately, as I said earlier in this issue thread, I personally do not have a compatible GPU to test this on. I'm working based on feedback from other users on the OpenRGB Discord server. I asked a week or so ago if anyone was available to test, but I don't know if the users who had the issue are familiar enough with Linux to patch the modules.

I can ask again. If anyone here has an ASUS RTX 3 series card with Aura lighting, it would be awesome if you could test the above patch. All you would need to do is launch the latest OpenRGB (version 0.7 or newer) with the patched module loaded and then check the version string in the Information tab. If it is garbage (non-ASCII characters) then the patch did not work.

Put out a request for testers on Discord and Twitter. Hopefully someone with the right card will respond.

CalcProgrammer1 avatar May 30 '22 07:05 CalcProgrammer1

Like @CalcProgrammer1, I too lack a device to test this on. Because of the difficulties presented by the proprietary driver, I have not purchased a Nvidia based card in years. Also, ddcutil does not use I2C SMBUS ioctl's, and tries to avoid even probing a /dev/i2c device that appears to be a SMBUS device, both for efficiency and because of the potential for lockups.

rockowitz avatar Jun 01 '22 17:06 rockowitz

So I went and tried the patch.

I manually applied the patch to /usr/src/nvidia-510.73.05/nvidia/nv-i2c.c which is the current install proprietary nvidia driver.

after that I did:
cd /usr/src/nvidia-510.73.05
sudo make modules -j24
sudo make modules_install
sudo update-initramfs -c -k $(uname -r)

I originally added a printk("DC: Testing\n"); to the code as well so that I could do a dmesg and grep that string. I was able to see that string so it shows that the code and the patches took. after that I removed the print statement and did the same thing as the above.

I ran the patched version of openrgb and I also ran the one I patched which is really no difference. Sadly the patch did not fix it for my video card.

Below is what that section of the code currently looks like.
case I2C_SMBUS_WORD_DATA:
if (read_write != I2C_SMBUS_READ)
{
//data->block[1] = (data->word & 0xff);
//data->block[2] = (data->word >> 8);
u16 word = data->word;
//printk("DC: Testing\n");
data->block[1] = (word & 0xff);
data->block[2] = (word >> 8);
}

NOTE: If need be I can switch to the open-gpu-kernel-modules version of the nvidia driver. It might take me a bit to get it running on ubuntu but I am sure I can get it done.

devilsclaw avatar Jun 05 '22 04:06 devilsclaw

Further to @devilsclaw's comments it's worth noting that the same GPU (10DE:220A 1043:886E) has been confirmed as working on Windows.

Chr1sNo avatar Jun 05 '22 05:06 Chr1sNo

Removed everything except the drm failing thing, not sure if it could be causing problems.

Will add a butter dump in next comment.

[ 11.651031] [drm:nv_drm_master_set [nvidia_drm]] ERROR [nvidia-drm] [GPU ID 0x00000900] Failed to grab modeset ownership

devilsclaw avatar Jun 05 '22 05:06 devilsclaw

Here is a dump:

[ 57.761987] DC: I2C_WRITE_SMBUS_BYTE: addr 0x67 : BYTE 0x00
[ 57.762610] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA0 : BYTE 0x00
[ 57.763227] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA1 : BYTE 0x01
[ 57.763865] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA2 : BYTE 0x02
[ 57.764480] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA3 : BYTE 0x03
[ 57.765101] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA4 : BYTE 0x04
[ 57.765715] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA5 : BYTE 0x05
[ 57.766331] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA6 : BYTE 0x06
[ 57.766948] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA7 : BYTE 0x07
[ 57.767560] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA8 : BYTE 0x08
[ 57.768183] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xA9 : BYTE 0x09
[ 57.768791] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xAA : BYTE 0x0A
[ 57.769416] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xAB : BYTE 0x0B
[ 57.770020] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xAC : BYTE 0x0C
[ 57.770635] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xAD : BYTE 0x0D
[ 57.771250] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xAE : BYTE 0x0E
[ 57.771860] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0xAF : BYTE 0x0F
[ 57.771871] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.772953] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x8C
[ 57.772962] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.774040] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x80
[ 57.774048] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.775773] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0xC5
[ 57.775783] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.777650] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x80
[ 57.777660] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.779338] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x8C
[ 57.779345] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.780814] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x80
[ 57.780821] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.782100] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.782108] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.783491] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.783498] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.784832] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.784838] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.787136] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.787144] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.788692] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.788699] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.790054] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.790062] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.791563] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.791570] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.792716] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.792723] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.793788] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.793797] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.794921] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.794929] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.796019] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.796027] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.797103] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.797110] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.798222] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.798229] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.799417] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.799424] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.800505] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.800511] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.801599] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.801607] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.803293] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.803300] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.805161] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.805169] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.806638] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.806658] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.808284] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.808296] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.809634] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.809655] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.811024] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.811034] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.812773] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.812780] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.814813] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.814828] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.816183] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.816194] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1010 : BYTES 0x10,0x10
[ 57.817460] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x23
[ 57.817471] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.818733] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.818742] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.820916] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.820925] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.822297] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.822307] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.823612] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.823622] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.824992] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.825003] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.826373] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.826381] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.827558] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.827565] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.828973] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.828979] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.830253] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.830261] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.831632] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.831638] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.833060] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.833068] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.834317] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.834324] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.835611] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.835618] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.837458] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.837464] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.838555] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.838562] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.839836] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.839843] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.840940] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.840952] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.842137] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.842146] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.843299] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.843306] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.844370] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.844377] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.845936] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.845944] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.847024] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.847030] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.848119] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.848125] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.849202] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.849214] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.850293] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.850301] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.851381] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.851390] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.853369] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.853378] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.855111] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.855117] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.856589] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.856596] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.858180] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.858191] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.859637] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.859652] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.860978] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.860988] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.862331] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.862340] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.863594] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.863601] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.864915] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.864922] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.866295] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.866303] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.867539] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.867547] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.868630] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.868641] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.870678] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.870688] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.871804] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.871813] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.873013] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.873021] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.874112] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.874120] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.875544] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.875554] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.876954] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.876962] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.878030] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.878037] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.879114] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.879120] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.880193] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.880200] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.881274] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.881281] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.882347] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.882354] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.883506] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.883518] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.884657] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.884667] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.887194] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.887202] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.889020] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.889027] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.890518] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.890525] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.892369] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.892380] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.893806] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.893814] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.895358] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.895366] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.896726] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.896732] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.897993] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.898001] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.899565] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.899573] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.900831] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.900843] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.902189] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.902196] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.904177] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.904184] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x1C1C : BYTES 0x1C,0x1C
[ 57.905902] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0x00
[ 57.905972] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x8080 : BYTES 0x80,0x80
[ 57.908247] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0xAA
[ 57.908254] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x8080 : BYTES 0x80,0x80
[ 57.909759] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0xAA
[ 57.909771] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x8080 : BYTES 0x80,0x80
[ 57.911281] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0xAA
[ 57.911291] DC: I2C_WRITE_SMBUS_WORD_DATA: addr 0x67 : CMD 0x00 : WORD 0x8080 : BYTES 0x80,0x80
[ 57.912571] DC: I2C_READ_SMBUS_BYTE_DATA: addr 0x67 : CMD 0x81 : BYTE 0xAA
[ 57.932933] DC: I2C_WRITE_SMBUS_BYTE: addr 0x67 : BYTE 0x00
[ 57.957259] DC: I2C_WRITE_SMBUS_BYTE: addr 0x67 : BYTE 0x00
[ 57.977866] DC: I2C_WRITE_SMBUS_BYTE: addr 0x67 : BYTE 0x00
[ 57.978786] DC: I2C_WRITE_SMBUS_BYTE: addr 0x67 : BYTE 0x00
[ 57.979330] DC: I2C_WRITE_SMBUS_BYTE: addr 0x67 : BYTE 0x00

devilsclaw avatar Jun 05 '22 06:06 devilsclaw

just moved to Linux and now can't control leds, if you need someone to test i am willing

emko avatar Jul 01 '22 18:07 emko

Seems like i2ctransfer commands work to talk to the EVGA 30 series GPUs:

# Initialize LED control
i2ctransfer -y 5 w6@0x2d 0xb2 0x04 0xc6 0xeb 0xea 0x15
# Command control for ALL OFF
i2ctransfer -y 5 w11@0x2d 0xc0 0x09 0x00 0x00 0x00 0x00 0xff 0xff 0xff 0xff 0x00

Maps to this command here: https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/master/Controllers/EVGAAmpereGPUController/EVGAGPUv3Controller.cpp#L297

void EVGAGPUv3Controller::initCard()
{
    // This command needs to be sent before the card will respond to OpenRGB commands
    // NvAPI_I2CWriteEx: Dev: 0x2D RegSize: 0x01 Reg: 0xB2 Size: 0x05 Data: 0x04 0xC6 0xEB 0xEA 0x15
    uint8_t data_pkt[5] = {0x04, 0xC6, 0xEB, 0xEA, 0x15};
    bus->i2c_smbus_write_i2c_block_data(dev, EVGA_GPU_V3_REG_ENABLE, sizeof(data_pkt), data_pkt);
    LOG_TRACE("[%s] Sending SW int packet", evgaGPUName);
    return;
}

Should i2c_smbus_write_i2c_block_data be mapped to the i2ctransfer command or is there another fix to allow block commands to be used?

TheRogueZeta avatar Jul 02 '22 23:07 TheRogueZeta

Seems like i2ctransfer commands work to talk to the EVGA 30 series GPUs:

# Initialize LED control
i2ctransfer -y 5 w6@0x2d 0xb2 0x04 0xc6 0xeb 0xea 0x15
# Command control for ALL OFF
i2ctransfer -y 5 w11@0x2d 0xc0 0x09 0x00 0x00 0x00 0x00 0xff 0xff 0xff 0xff 0x00

Maps to this command here: https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/master/Controllers/EVGAAmpereGPUController/EVGAGPUv3Controller.cpp#L297

void EVGAGPUv3Controller::initCard()
{
    // This command needs to be sent before the card will respond to OpenRGB commands
    // NvAPI_I2CWriteEx: Dev: 0x2D RegSize: 0x01 Reg: 0xB2 Size: 0x05 Data: 0x04 0xC6 0xEB 0xEA 0x15
    uint8_t data_pkt[5] = {0x04, 0xC6, 0xEB, 0xEA, 0x15};
    bus->i2c_smbus_write_i2c_block_data(dev, EVGA_GPU_V3_REG_ENABLE, sizeof(data_pkt), data_pkt);
    LOG_TRACE("[%s] Sending SW int packet", evgaGPUName);
    return;
}

Should i2c_smbus_write_i2c_block_data be mapped to the i2ctransfer command or is there another fix to allow block commands to be used?

@ZetaPhoenix I have an EVGA XC3 Ultra RTX 3090, am I correct in my reading of your comment being that following your steps should allow lighting control of this card on Linux? I want to confirm this is what you're saying before I actually test it. Yes, I'm aware that this is all potentially risky and if I run anything it's at my own risk, but that's exactly why I want to confirm that's what you're saying beforehand.

As others have said, even though it seems like it might be a different underlying issue, EVGA Ampere GPUs seem to also be controllable on Windows via OpenRGB but not on Linux, just like the ASUS cards.

@amrit1711 @aritger as I said above, I do have hardware myself I can test this on, and I believe I can try patching the modules without much trouble (though I do use DKMS, I don't imagine that should cause any issues?)

gardotd426 avatar Jul 04 '22 06:07 gardotd426

Yes, according to other users on the OpenRGB discord, these commands work to turn off the RGB. The settings will not persist as the save command is not sent. See the rest of the OpenRGB controller code for the command if you want to save.

OpenRGB will attempt to load the firmware version from the card and if that fails (due to i2c_smbus_read_i2c_block_data not returning successfully) then the card will not be added.

TheRogueZeta avatar Jul 04 '22 09:07 TheRogueZeta

Yes, according to other users on the OpenRGB discord, these commands work to turn off the RGB. The settings will not persist as the save command is not sent. See the rest of the OpenRGB controller code for the command if you want to save.

OpenRGB will attempt to load the firmware version from the card and if that fails (due to i2c_smbus_read_i2c_block_data not returning successfully) then the card will not be added.

Ah, so so far it's only possible to turn the RGB off?

gardotd426 avatar Jul 04 '22 09:07 gardotd426

@ZetaPhoenix No dice, unfortunately:

sudo i2ctransfer -y 5 w6@0x2d 0xb2 0x04 0xc6 0xeb 0xea 0x15  
Error: Adapter does not have I2C transfers capability

Until a couple weeks ago I had a single-GPU passthrough Windows VM that I used for Apex Legends, and through that using EVGA Precision X1 I was obviously able to control lighting. I'm not sure what more info I can provide but I'm happy to provide anything else needed to help get this figured out

EDIT: I'm still getting this error when trying to run i2cdump as well:

sudo i2cdetect -l

i2c-0	i2c       	NVIDIA i2c adapter 1 at f:00.0  	I2C adapter
i2c-1	i2c       	NVIDIA i2c adapter 5 at f:00.0  	I2C adapter
i2c-2	i2c       	NVIDIA i2c adapter 6 at f:00.0  	I2C adapter
i2c-3	i2c       	NVIDIA i2c adapter 7 at f:00.0  	I2C adapter
i2c-4	i2c       	NVIDIA i2c adapter 8 at f:00.0  	I2C adapter
i2c-5	smbus     	SMBus PIIX4 adapter port 0 at 0b00	SMBus adapter
i2c-6	smbus     	SMBus PIIX4 adapter port 2 at 0b00	SMBus adapter
i2c-7	smbus     	SMBus PIIX4 adapter port 1 at 0b20	SMBus adapter

sudo i2cdetect 0

WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x08-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- 2d -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

sudo i2cdump 0 0x2d i

Error: Adapter does not have I2C block read capability

Now, this is without patching the driver, I'm assuming I need to use the patch listed above? Or should this work regardless?

gardotd426 avatar Jul 04 '22 09:07 gardotd426

Eh even with patching the nv-i2c.c file and rebuilding and reinstalling the module it still gives the same results. I'm able to test whatever needs testing but I'm swamped right now trying to finish all the work required for the Arch port of Regolith DE moving to v2.0 (I'm the sole - and apparently now official - developer/maintainer of the Regolith DE port to Arch Linux, and v1.6 -> v2.0 basically changed everything from the ground up on a fundamental level regarding how it works, so I basically have to redo the whole thing). So I don't know how much time I'll have for deep dives in the Discord, but as soon as I finish the 2.0 transition I'll have more time. In the meantime I'm open to any guidance

gardotd426 avatar Jul 04 '22 10:07 gardotd426

@CalcProgrammer1 I tried to repro issue locally with ASUS Lightning 3050 card on below configuration setup but could not repro issue.

Alienware-Area-51-R4 + Intel(R) Core(TM) i7-7900X CPU @ 3.30GHz + kernel 5.15.0-41-generic + RTX 3050 + Driver 515.43.04 + Display GBT AORUS FI27Q-P

Repro Steps Tried -

  1. Executed openrgb command and got the warning saying One or More I2C/SMBus interfaces failed to initialize.
  2. Under Information Tab, I can see version as 0.7. However as per your earlier comment, version should be a garbage value in case of repro scenario but I can see correct version. --- NO REPRO

Request you or someone else to please share reliable test case along with steps.

amrit1711 avatar Jul 22 '22 21:07 amrit1711

Please make sure to load the udev rules and try with the pipeline version. Adding -vv will print more data to the console and launching with --loglevel 6 will create a verbose log file in ~/.config/OpenRGB/logs

FYI, that card does seem to have been added to the controller so it will skip: https://gitlab.com/OpenRGBDevelopers/OpenRGB-Wiki/-/blob/stable/Supported%20Devices/Supported%20Devices.md

Does it have RGB?

TheRogueZeta avatar Jul 22 '22 21:07 TheRogueZeta

Looks like we finally have an internal repro of this issue. As stated, using Nouveau works fine (proper version reported, LEDs can be changed). Using the 515.57 driver (monolithic or OpenRM) with OpenRGB 0.7 shows the card is detected but the LEDs cannot be changed, version field is garbage. System being used for dev triage.

PAR2020 avatar Jul 26 '22 18:07 PAR2020

Good to hear.

Are there any patches to test for the block writes (EVGA GPU's)? That seems possible in some instances with i2ctransfer.

TheRogueZeta avatar Jul 26 '22 18:07 TheRogueZeta

Not yet. The current patch reported here does not work in the repro case. Will advise if a new one is proposed.

PAR2020 avatar Jul 26 '22 18:07 PAR2020