Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Question: Can this be used to control RGB on a Nvidia GPU? #2

Open
ghost opened this issue Dec 6, 2019 · 11 comments
Open

Feature Question: Can this be used to control RGB on a Nvidia GPU? #2

ghost opened this issue Dec 6, 2019 · 11 comments

Comments

@ghost
Copy link

ghost commented Dec 6, 2019

As the question asks, I was wondering if this can be used to control RGB on a Nvidia GPU on Linux?

@SveSop
Copy link
Owner

SveSop commented Dec 18, 2019

@David-Frick Hi. Sorry i have not noticed this post until today, so i apologize for the late reply.
What would you need this function for? If you provide a windows app that would use this for something meaningful, i am willing to test for functions.

First i need to find if doing this is actually used as a nvapi call in windows, then i must see if nvctrl for Linux have the same function.. and if so + given a test program, it could be made to work :)

@sizzlesloth
Copy link

sizzlesloth commented Aug 30, 2020

Sorry for bumping, but I came across this and I might be able to help a bit.

I would also like to be able to control RGB on my EVGA 1070 FTW in Linux. I came across a GitHub repo under https://github.com/iamdroppy/EvgaI2C

He found that the EVGA Precision X OC software sets RGB through i2c, using nvapi. You can compile his .sln file in Visual Studio and his example sets the RGB to green. I modified his program to allow you to choose each value for the R, G, and B LEDs. I can send the compiled .exe over if you still want to have a look at it! It would be very much appreciated and I'm sure many would find it useful. While his repo is for EVGA Pascal cards, I believe pretty much all Nvidia GPUs use nvapi to set their RGB colors. I'll be happy to help where necessary if you want to take a look at it as it would be great to be able to run his program through WINE.

@SveSop
Copy link
Owner

SveSop commented Aug 31, 2020

I am not really sure if this is some vendor specific thing, or if this is something that nvAPI actually can do for all card with the proper support?

I mean, some vendors have a massive amount of extra stuff on their cards, using a multitude of various software(bloatware) to set this. If it is a EVGA vendor thing, i have no way of testing this, and it would probably be just random guesswork of back and forth testing.

Ill look into it, but i do not think i will implement any i2c things anytime soon, as i do not really work much with this thing anymore.

@SveSop
Copy link
Owner

SveSop commented Aug 31, 2020

It looks like there is some functions in nvAPI that could do stuff with "illumination" (The logo and whatnot). If other stuff is more vendor specific, i have no clue.

    { "NvAPI_GPU_QueryIlluminationSupport", 0xa629da31 },
    { "NvAPI_GPU_GetIllumination", 0x9a1b9365 },
    { "NvAPI_GPU_SetIllumination", 0x0254a187 },
    { "NvAPI_GPU_ClientIllumDevicesGetInfo", 0xd4100e58 },
    { "NvAPI_GPU_ClientIllumDevicesGetControl", 0x73c01d58 },
    { "NvAPI_GPU_ClientIllumDevicesSetControl", 0x57024c62 },
    { "NvAPI_GPU_ClientIllumZonesGetInfo", 0x4b81241b },
    { "NvAPI_GPU_ClientIllumZonesGetControl", 0x3dbf5764 },
    { "NvAPI_GPU_ClientIllumZonesSetControl", 0x197d065e },

However, i have no clue where to start to actually set this "illumination" in Linux, cos the nvml library does not seem to contain anything of that sort?

From the wee bit of looking at that link you posted above, it seems as he have made a "easier and lighter" method of setting the lights in Windows with this code.. So, setting this illumination by using a different program than the bloatware that many vendors use to customize their "amazing stuff", is not the same as getting it to work in Linux.

As i said, it has been a while since i fiddled with this code tbh, but what happens is basically this:
Windows app -> Wine -> loads nvapi.dll -> nvapi.dll communicates with nvml (closest to nvapi that Linux has).
So, what i need to do is to make the custom nvapi.dll do functions in nvml. If there is no function for X in nvml, then i cannot do it. So far mostly what i have done is to make a sort of "proof of concept" thing where i read stuff from nvml and let nvapi send this to whatever windows app running in wine (eg. GPU Caps Viewer displaying fan speed or whatnot). I can "fake" information, but there is no point in faking color settings without actually setting the colors :)

If you find a linux binary setting these RGB/Led colors of sort (preferably opensource), please let me know :)

EDIT: Even this project seems to miss RGB control in Linux
NVIDIA/nvidia-settings#48

@Alokin90
Copy link

I use OpenRGB to change the GPU LED color and brightness and it works with my Gigabyte RTX 2070

https://gitlab.com/CalcProgrammer1/OpenRGB

@ghost
Copy link
Author

ghost commented Sep 29, 2020

@Alokin-ITA but is that on Linux or Windows? Thanks for the feedback guys. There was an issue raised in nvidia-settings about RGB light control on linux and it seems to be going nowhere but it seems some people are able to..? Seems to be pretty random at this point.

@ghost
Copy link
Author

ghost commented Sep 29, 2020

@SveSop Thanks for all the feedback. I think what you said about wine and nvapi is an interesting idea. I have seen some people discussing that method as well. How hacky would something like that be?

@SveSop
Copy link
Owner

SveSop commented Sep 29, 2020

@Frick-David
My problem is that for any "hacks" to be done, i need the following:

  1. A windows program that uses nvapi to set colors (Not sure any does, and IF they do, it MAY be a combination of using nvapi + whatever proprietary stuff)
  2. A way to replicate that function in Linux. Implementing loads of stuff as a non-programmer is not too easy. Cant just throw snippits from things like the OpenRGB project linked into nvapi and compile.
  3. A positive way to actually test this (Not sure my GTX970 that is in my Windows box has much light controls on it.. MSI GTX970)

I think the OpenRGB thingy looks promising, and it would be unlimited times better to use that, than for me to try to invent the wheel for these functions if the sole reason for RGB control is to... well.. control the RGB as a Linux user.

@Alokin90
Copy link

@Alokin-ITA but is that on Linux or Windows? Thanks for the feedback guys. There was an issue raised in nvidia-settings about RGB light control on linux and it seems to be going nowhere but it seems some people are able to..? Seems to be pretty random at this point.

On Linux.

@sizzlesloth
Copy link

sizzlesloth commented Sep 29, 2020

Just to let you all know, I used the research from https://github.com/iamdroppy/EVGAI2C and worked with CalcProgrammer1 to get the 1070 FTW supported on OpenRGB for Windows and Linux. See here: https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/EVGA-GPU

I found the memory address and values for the different modes as well. It works well on Windows but if you build from source right now for Linux, you need to add this line back in which was removed in this commit:
https://gitlab.com/CalcProgrammer1/OpenRGB/-/commit/973dce9d80cd3fa6d23228b29ad96132894915a3

@ghost
Copy link
Author

ghost commented Sep 30, 2020

@brittle-bones how hard would it be to get support for new GPUs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants