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

In RTX Cards, nvoclock cannot reset/get vfp #3

Open
nantcom opened this issue Jul 25, 2019 · 7 comments
Open

In RTX Cards, nvoclock cannot reset/get vfp #3

nantcom opened this issue Jul 25, 2019 · 7 comments
Milestone

Comments

@nantcom
Copy link

nantcom commented Jul 25, 2019

RTX Cards seems to have 128 VF points while GTX10 has 80 points. Could this be an issue with not enough array size?

thread 'main' panicked at 'index out of bounds: the len is 103 but the index is 103', /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/nvapi-0.0.3/src/clock.rs:163:27
note: Run with RUST_BACKTRACE=1 for a backtrace.

@arcnmx
Copy link
Owner

arcnmx commented Jul 25, 2019

Yeah, roughly.

I can't say I recall where I got the +23 from, the API always supported up to 128 looks like, just wasn't tested with more. I don't have an RTX card (unfortunately) but can try to put together a quick fix soon.

@arcnmx
Copy link
Owner

arcnmx commented Jul 25, 2019

Hm I see, it's 23 for the VRAM curve on pascal... I'm not sure how much I can look into this without a card, because...

  1. I can assume the size of the mask is 128 instead and hope that's right and easy to fix, though may not be the case.
  2. After that you'll just run into NV_CLOCK_TABLE_V1 being problematic, it's really not going to work as-is and I'm not sure what the proper representation of the data is without seeing what the API returns for the new cards.

@nantcom
Copy link
Author

nantcom commented Jul 26, 2019

I was thinking about using your tool nvmitm - but i'm too newbie with rust language and have been trying to set up my IDE~ nothing even compile right now >.< once i get it up and running and learn rust a bit I will see what i can do.

Actually, you can install EVGA Precision X1 and use ILSpy to take a peek at ManagedNvApi.dll in the program folder. I'm quite sure with your experience in the NVAPI stuff you will be able to decipher the internal workings of it easily.

What i have dig out so far:

  • VfPointsStatus is struct containting VfPoints array and number of offsets
  • VfPoints is struct for holding the mV, Frequency (called zeroedFrequency), offset, overclocked frequency (they have both frequency and overclocked frequency)
  • Array of VfPointsStatus is allocated for 128 entries (hard coded)
  • NvAPI.getClientClkStatus(uint nIndex, ValueType VfPointsStatus, ref int nLength) is used to query current values (See ILSpy for Code) and populate the VfPointsStatus structure
    • nIndex = GPU Index, VfPointsStatus = Pointer to Allocated Struct, nLength they hard coded to 128,
  • Inside this function - it appears they manually read the memory of _NV_GPU_CLOCK_CLIENT_CLK_VF_POINTS_STATUS_V1 and populate VfPoints
  • Caller set each item in VfPointsStatus.overclockedFrequency = zeroedFrequency
  • NvAPI.setClientClkVfPointOffset(uint nIndex, ValueType ClrVfPointsStatus) is used for setting the VfCurve - i have tested with offset only and it worked similar to your nvoclock set vfp import
  • in this function they also copy the memory content manually from VfPoints struct into _NV_GPU_CLOCK_CLIENT_CLK_VF_POINT_CONTROL_V1 which we can possily guess the structure of it

I have been trying to come up with my own implementation in C# but time is not on my side right now :'( and also I don't have the function Id for NvAPI_GPU_ClockClientClkVfPointsGetInfo and NvAPI_GPU_ClockClientClkVfPointsSetControl

@SkatterPieter
Copy link

Has there been any update on this? I'm trying to export the vf curve on my GTX 1650 but unfortunately I have the same error code. Thanks!

@arcnmx
Copy link
Owner

arcnmx commented Jun 30, 2022

Sorry it took me so long to get to this, but I'm currently working on it in the vfp branch. You can download development builds from the GH Actions CI or use cargo install --git while I'm working on it.

I haven't tested anything that sets or resets the curve yet, but it at least can show/export them again. I'm currently testing with an Ampere card, and will try my GTX 1650 once things get a bit more stable (hopefully it resembles turing more than pasal despite not being an rtx card?).

@broizter
Copy link

broizter commented Sep 17, 2022

Windows 10 Build 19044.2006
Nvidia driver 516.94
GTX1070
Latest VFP build

.\nvoclock.exe set vfp export .\file.txt
.\nvoclock.exe set vfp import .\file.txt
NVAPI error: NvAPI_GPU_ClockClientClkVfPointsSetControl failed: NVAPI_ERROR

Content of file.txt

voltage,frequency,delta,default_frequency
450000,265500,0,0
462500,341500,0,0
475000,417500,0,0
481250,493500,0,0
493750,531500,0,0
500000,582000,0,0
512500,632500,0,0
525000,683000,0,0
531250,734000,0,0
543750,784500,0,0
550000,835000,0,0
562500,885500,0,0
575000,936500,0,0
581250,987000,0,0
593750,1037500,0,0
600000,1063000,0,0
612500,1101000,0,0
625000,1126000,0,0
631250,1164000,0,0
643750,1189500,0,0
650000,1227500,0,0
662500,1278000,0,0
675000,1328500,0,0
681250,1379500,0,0
693750,1404500,0,0
700000,1430000,0,0
712500,1455000,0,0
725000,1480500,0,0
731250,1506000,0,0
743750,1531000,0,0
750000,1556500,0,0
762500,1582000,0,0
775000,1607000,0,0
781250,1632500,0,0
793750,1645000,0,0
800000,1670500,0,0
812500,1695500,0,0
825000,1708500,0,0
831250,1733500,0,0
843750,1746500,0,0
850000,1771500,0,0
862500,1784500,0,0
875000,1809500,0,0
881250,1822500,0,0
893750,1835000,0,0
900000,1860000,0,0
912500,1873000,0,0
925000,1885500,0,0
931250,1898000,0,0
943750,1911000,0,0
950000,1923500,0,0
962500,1936000,0,0
975000,1949000,0,0
981250,1961500,0,0
993750,1974000,0,0
1000000,1987000,0,0
1012500,1987000,0,0
1025000,1999500,0,0
1031250,2012000,0,0
1043750,2012000,0,0
1050000,2025000,0,0
1062500,2037500,0,0
1075000,2037500,0,0
1081250,2037500,0,0
1093750,2037500,0,0
1100000,2037500,0,0
1112500,2037500,0,0
1125000,2037500,0,0
1131250,2037500,0,0
1143750,2037500,0,0
1150000,2037500,0,0
1162500,2037500,0,0
1175000,2037500,0,0
1181250,2037500,0,0
1193750,2037500,0,0
1200000,2037500,0,0
1212500,2037500,0,0
1225000,2037500,0,0
1231250,2037500,0,0
1243750,2037500,0,0

@SkatterPieter
Copy link

Sorry it took me so long to get to this, but I'm currently working on it in the vfp branch. You can download development builds from the GH Actions CI or use cargo install --git while I'm working on it.

I haven't tested anything that sets or resets the curve yet, but it at least can show/export them again. I'm currently testing with an Ampere card, and will try my GTX 1650 once things get a bit more stable (hopefully it resembles turing more than pasal despite not being an rtx card?).

Sorry for the late reply. I tried the vfp branch with my RTX 3050 and I can correctly export the VF Points. Thanks!

@arcnmx arcnmx added this to the v0.0.4 milestone Jun 13, 2023
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

4 participants