Git Product home page Git Product logo

nvapiwrapper's Introduction

NvAPIWrapper NvAPIWrapper (for NVAPI R410)

NvAPIWrapper is a .Net wrapper for NVIDIA public API, capable of managing all aspects of a display setup using NVIDIA GPUs.

This project is licensed under LGPL and therefore can be used in closed source or commercial projects. However, any commit or change to the main code must be public and there should be a read me file along with the DLL clarifying the license and its terms as part of your project as well as a hyperlink to this repository. Read more about LGPL.

How to get

This library is available for download and use through NuGet Gallery.

Help me fund my own Death Star

--OR--

You can always donate your time by contributing to the project or by introducing it to others.

What's Supported

NvAPIWrapper is not a complete wrapper of NVAPI; at least, not yet. Following is the list of NVAPI features and their status:

  • General: Full Support

    • Chipset Information
    • Driver Information and Driver Restart
    • Lid and Dock Information
  • Surround: Full Support

    • Topology Configuration (Mosaic Phase 2)
    • Grid Configuration (Mosaic Phase 1)
    • Warping Control
    • Color Intensity Control
  • Display: Full Support

    • Display Information and Capabilities
    • Path Configuration
    • Custom Resolutions
    • Refresh Rate Override
    • HDMI Support Information and Capabilities
    • DisplayPort Color Capabilities
    • HDR Capabalities
  • Display Control: Full Support

    • Color Control
    • Saturation Control (Vibrance)
    • HUE Control
    • HDMI InfoFrame Control
    • HDR and HDR Color Control
    • ScanOut Information and Configuration
    • View Control
    • EDID Retrival and Modification
  • GPU: Full Support

    • GPU Informaion
    • GPU Atchitecture Information
    • GPU Output Information
    • ECC Memory Reporting and Managment
    • PCI-E Information
    • Performance Capabilities and Monitoring
    • Cooler Information (Fan/Liquid/Passive) and Managment (Including RTX+)
    • GPU Illumination Managment
    • Usage Monitoring
    • Power Limit Status and Managment (Modification only via the low level API)
    • Thermal Limit Status and Managment (Modification only via the low level API)
    • Performance State Managment (Modification only via the low level API)
    • Clock Boost and Clock Boost Curve Confiurations (via low level API)
    • Voltage Boost and Voltage Boost Table Configurations (via low level API)
    • Clock Lock Configurations (via low level API)
  • DRS: Full Support

    • Session, Profile and Application Managment
    • Documented Setting and Managed Setting Values
  • Stereo (3D): Full Support

    • Stereo Control
    • Stereo Configurations
  • D3D: No Support

  • GSync: No Support

  • OpenGL: No Support

  • Vidio: No Support

If a feature you need is missing, feel free to open an issue.

How to use

NvAPIWrappr allows you to use the NVAPI functions directly (a.k.a. the low-level API) using the NvAPIWrapper.Native namespace. However, there is also a .Net friendly implementation of the NVAPI features (a.k.a. the high-level API) that can be used to minimize the complexity of your code and makes it more compatible with later releases of the library, therefore, I strongly recommend using these classes instead of using the native functions directly.

Currently, you can access different parts of the high level API as follow:

  • Namespace NvAPIWrapper.Display: Display and Display Control API
  • Namespace NvAPIWrapper.GPU: GPU specific API
  • Namespace NvAPIWrapper.Mosaic: Mosaic API - Surround
  • Namespace NvAPIWrapper.DRS: NVIDIA Driver settings and application profiles
  • Namespace NvAPIWrapper.Stereo: Stereo specific settings and configurations
  • Class NvAPIWrapper.NVIDIA: General Information And Methods

Please also take a look at the NvAPISample project for a number of simple examples.

This library is fully documented and this makes your journey through it as easy as it is possible with NVAPI.

Related Projects

  • WindowsDisplayAPI: WindowsDisplayAPI is a .Net wrapper for Windows Display and Windows CCD APIs

  • EDIDParser: EDIDParser is a library allowing all .Net developers to parse and to extract information from raw EDID binary data. (Extended Display Identification Data)

  • HeliosDisplayManagement: An open source display profile management program for Windows with support for NVIDIA Surround

License

Copyright (C) 2017-2020 Soroush Falahati

This project is licensed under the GNU Lesser General Public License ("LGPL") and therefore can be used in closed source or commercial projects. However, any commit or change to the main code must be public and there should be a read me file along with the DLL clarifying the license and its terms as part of your project as well as a hyperlink to this repository. Read more about LGPL.

nvapiwrapper's People

Contributors

draiget avatar falahati avatar imshobhit avatar matthewcooke-centris avatar roklem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvapiwrapper's Issues

Add LED Control and Information Support

Based on EVGA Precision X1 Software (https://store.steampowered.com/app/268850/EVGA_Precision_X1/) it is possible to handle the card ilumination, I use this to shutdown leds, o to set a tempetura profile, so, it's possible to integrate that functionality on this wrapper? brightnes controll or if graphic card supports color changes. btw, the software works with any geforce card even if it's not a EVGA card. (Something Nvidia totally missed in Nvidia control panel)

Multi Cooler Get Fan Level

Hi. Im tring to get fan level (%) in multi cooler gpus (RTX2070 and RTX2060 in my case) using last driver (441). Before this, I was using NvAPI_GPU_GetCoolerSettings funtions with single cooler gpus succesfully, but now, with multi coolers gpus functions returns -104 error (NVAPI_NOT_SUPPORTED). I am tring to use Client GPU functions, with NvAPI_GPU_ClientFanCoolersGetInfo and using your structs and it works fine (returns 0 and info is according to two coolers and returns correct values for maximum RPM for each), but when I use NvAPI_GPU_ClientFanCoolersGetStatus or NvAPI_GPU_ClientFanCoolersGetControl with your structs, both funtions returns -5 for each case (NVAPI_INVALID_ARGUMENT)(So, structures and Versions are OK), i double checked funtions but i can not make works properly. Any clue? Thanks in advanced. Great Job. (Sorry for my english).

Question about optimus

Probably not the appropriate place to ask this but you are more familiar with the nvidia library than me.

Could I use this to do three things.

  1. Determine if my GPU is currently nvidia or intel
  2. Get the GPU utilization
  3. Iterate over all of my apps and force them to use nvidia GPU (such as can be done manually in the nvidia control panel)

Any direction would be appreciated, thanks.

Possible to get hotspot and memory temps for RTX 30 series?

Hello. A single GPU temperature(for my 3080ti) is reported by NvAPIWrapper but RTX cards also have memory and hotspot temperatures.

I see NvAPI_GPU_GetThermalSettings is being used but NvAPI_GPU_GetAllTempsEx( 0x65FE3AAD) appears to have the hotspot and vram temperatures. Any plans to add this?

Setting Clockspeed

I am trying to figure out how to use the wrapper to set graphics clock speed. So far this is what I have done:

in IPerformanceClockStates20ClockEntry.cs

I changed:

        /// <inheritdoc />
        public PerformanceStates20ParameterDelta FrequencyDeltaInkHz
        {
            get => _FrequencyDeltaInkHz;
        }

to

        /// <inheritdoc />
        public PerformanceStates20ParameterDelta FrequencyDeltaInkHz
        {
            get => _FrequencyDeltaInkHz;
            set => _FrequencyDeltaInkHz = value;
        }

In PerformanceStates20Infov1.cs I added the following to PerformanceState20 so I could see what current clocks are.

from

            /// <inheritdoc />
            public bool IsEditable
            {
                get => _Flags.GetBit(0);
            }

to

            /// <inheritdoc />
            public bool IsEditable
            {
                get => _Flags.GetBit(0);
            }

            /// <inheritdoc />
            public PerformanceStates20ClockEntryV1[] Clocks
            {
                get => _Clocks;
            }

Finally in IPerformanceState20.cs:
from

        /// <summary>
        ///     Gets the performance state identification
        /// </summary>
        PerformanceStateId StateId { get; }

to

        /// <summary>
        ///     Gets the performance state identification
        /// </summary>
        PerformanceStateId StateId { get; }

        /// <summary>
        ///     Gets the performance state clock entries
        /// </summary>
        PerformanceStates20ClockEntryV1[] Clocks { get; }

Here is what I am trying to do:

int index = 0;
int core = 100;

var GPUs = PhysicalGPU.GetPhysicalGPUs();
var Performance = GPUApi.GetPerformanceStates20(GPUs[index].Handle);
var min = Performance.PerformanceStates[0].Clocks[0].FrequencyDeltaInkHz.DeltaRange.Minimum;
var max = Performance.PerformanceStates[0].Clocks[0].FrequencyDeltaInkHz.DeltaRange.Maximum;
var delta = new PerformanceStates20ParameterDelta((core * 1000), min, max);
Performance.PerformanceStates[0].Clocks[0].FrequencyDeltaInkHz = delta;
GPUApi.SetPerformanceStates20(GPUs[index].Handle, Performance);

I get:

NvAPIWrapper.Native.Exceptions.NVIDIAApiException
  HResult=0x80131500
  Source=NvAPIWrapper
  StackTrace:
   at NvAPIWrapper.Native.GPUApi.SetPerformanceStates20(PhysicalGPUHandle physicalGPUHandle, IPerformanceStates20Info performanceStates20Info) in C:\Users\Mayna\Documents\GitHub\NvAPIWrapper\NvAPIWrapper\Native\GPUApi.Performance.cs:line 524
   at NVClocks.Program.Main(String[] args) in C:\Users\Mayna\Documents\GitHub\NvAPIWrapper\NvAPISample\Program.cs:line 198

status is returning NvAPIWrapper.Native.General.Status.NotSupported

I don't think the small change I made makes a difference in reference to the exception, but I could be wrong. Is there a way to debug it deeper to find what is causing the issue?

If I change to:

var Performance = GPUApi.GetPerformanceStates20(GPUs[index].Handle);
GPUApi.SetPerformanceStates20(GPUs[index].Handle, Performance);

And just send the same IPerformance20statesInfo back it fails. This includes undoing all changes I have made so I can get the current clock settings.

Inconsistency between `Display.GetDisplays()` and `PathInfo.GetDisplaysConfig()`

I have 2 monitors attached - an Asus (2560x1440) and a Dell (1920x1080).
Display.GetDisplays() gives me the Asus on Ouput13 and the Dell on Output11
PathInfo.GetDisplaysConfig() gives me the opposite.

No matter how I switch around cables - I still get this inconsistency..
When I use a single monitor - it (of course) seems fine).

I am using an Nvidia RTX 6000.

Thanks!!!

P.S. This is using the wrapper with Nuget in C# (Visual Studio 2019).

ScanOutInformation.EnableWarping Fails

Hello,
I've been playing around with this API for a couple of days and it does the majority of the things that I need and is very well written, thanks for that. Unfortunately I'm running into a problem with using the EnableWarping method. With the original Nuget package, the exception I get is

Type 'NvAPIWrapper.Native.Display.Structures.ScanOutWarpingV1' cannot be marshaled as an unmanaged structure, no meaningful size or offset can be computed.

After pulling down the source and poking around I narrowed the problem down to the line in the constructor of the ScanOutWarpingV1 class

this = typeof(ScanOutWarpingV1).Instantiate();

this throws the exception, is ignored but the same exception gets thrown when the delegate gets called. Removing each property of the ScanOutWarpingV1 class and running it again I found that the Rectangle _TextureRectangle was the culprit. I removed the [MarshalAs(UnmanagedType.LPStruct)] attribute and the ScanOutWarpingV1 class would get instantiated without errors but then when executing the delegate I received an IncompatibleStructureVersion error. So it seems like it at least is getting through to the API but fails for some reason. I downloaded the new version of the NvAPI, version 440, from the Nvidia website and used your NvAPICodeGenerator project but the structure for the ScanOutWarpingV1 looks to be the same. Any help you could provide would be appreciated. Please let me know if you have any questions. Thanks!

How to set custom resolution?

Hi! This part of code doesn't work

var displayTest = new DisplayDevice(2147881091);
var timing = displayTest.CalculateTiming(800, 600, 60, false);
var res1 = new CustomResolution(800, 600, NvAPIWrapper.Native.Display.ColorFormat.P8, timing);
displayTest.TrialCustomResolution(res1);
displayTest.SaveCustomResolution();

Crashed on TrialCustomResolution (NvAPI error).
Help please

How to use this?

Hello,
I am an owner of a Titan RTX and I am doing 3D rendering.
I found this place while searching for how to control my fan speeds while operating the GPU at TCC mode.
I have seen a few discussions here and I think I am understanding that you found how to achieve what I am looking for.
But I haven't seen any friendly tutorials from beginning to finish on how to install, run, and use this tool or whatever it is named :(

Please if anyone can help me out here or refer me to the right place, I would very much appreciate it! It will help me a ton!

RAM type enum is incomplete

RAM type enum is missing HBM2/GDDR6/GDDR6X entries at

public enum GPUMemoryType : uint

You can look at the ones I took from GPU-Z here: https://github.com/JustAMan/pynvraw/blob/498591713adcfbdf7aae1a348c1af76513ef9a43/src/pynvraw/nvapi_api.py#L735-L749
(copied down below for easier reading)

class RamType(enum.IntEnum):
    Unknown = 0
    SDRAM = 1
    DDR1 = 2
    DDR2 = 3
    GDDR2 = 4
    GDDR3 = 5
    GDDR4 = 6
    DDR3 = 7
    GDDR5 = 8
    DDR2_alt = 9
    GDDR5X = 10
    HBM2 = 12
    GDDR6 = 14
    GDDR6X = 15

Detecting GPU presence when running inside cloud VM

Hi,

I'm using your library to detect GPU presence, and fall back to CPU if necessary. On Windows Server VMs (tested AWS, Azure and Alibaba cloud) with nVidia GPUs, this library returns NVAPI_NVIDIA_DEVICE_NOT_FOUND.

Locally, this library correctly detects the presence of GTX and Quadro-series GPUs. Are you aware of any reason that this library would fail to detect GPU presence for a cloud VM? Is there a feasible work-around?

R/W DPCD through AUX channel

Hi!
I'm working on an soft which can operate DPCD through AUX channel.
My thought is use NvAPI_GetDisplayPortInfo/NvAPI_SetDisplayPort to accomplish that,but when I dont know how to call original NvAPI(a.k.a. the low-level AP),could you please make it more specific for me(I've tried Delegate.NvAPI_GetDisplayConfig(),but didnot work)?

Knowing projectors which are just connected but don't display

Hi,
For my application, I have to differentiate between all projectors that are connected to the system. Some of the projectors are turned off but are still connected and they show up in the device manager settings too as well as in NVAPI's All displays. I wanted to know if it would be possible to somehow distinguish which projectors are just connected and not displaying anything.

(Application goal: In mosaic mode, I would want to know if any of the projectors stops displaying for some reason)

Thanks,
Sarvesh

YCbCr output color format

Hi, I've tried out the wrapper and from what I saw it doesn't seem to have a notion of YCbCr color format. I currently have YCbCr420 set in NVidia Control Panel, but the tool still returns RGB. Is this a limitation of NVidia's API itself or the wrapper?

NVIDIAApiException getting temps and fan speed (GTX 1650)

Hi there, hope you doing well!

As the title says, I am trying to get the fan speed and temperature values on a GTX 1650 (laptop), I always get NVAPI_NOT_SUPPORTED, I know what this means, but I have to ask, Is there's a way to get those values?

I'm basically doing this:

foreach (var gpu in PhysicalGPU.GetPhysicalGPUs()) { Console.WriteLine(gpu.FullName); Console.WriteLine(gpu.CoolerInformation.CurrentFanSpeedInRPM); Console.WriteLine(gpu.ThermalInformation.CurrentThermalLevel); }

There is only 1 GPU btw, it is the same if I do

var GPUs = PhysicalGPU.GetPhysicalGPUs(); var ThermalInfo= GPUs[0].ThermalInformation.ThermalSensors;

No matter what I do I always get NVIDIAApiException. Is there something that can be done?

Thanks in advance!

GTX cards fan issue

So I have user that was using my software with your wrapper with no issues. He has 3 GTX 1080ti cards.

This user decided to do a bios update on the cards. Upon doing a bios update, he noticed in EVGA precision (EVGA's overclocking software) now has the option to set both fans individually. It works correctly. Prior to the bios update, only 1 fan could be set.

Using the wrapper:

CoolerInformation.Coolers

The cards only return 1 fan cooler still.

I wasn't even aware that any GTX cards could be dual-fan aware. This is news to me. The user confirmed that he can now set fans individually after bios update.

This is a photo which uses the simple software I have made, along with the EVGA precision showing the card's fan speeds. Both this user and myself can set RTX dual-fan aware cards with the software. GTX cards however are failing due to only one cooler being found.

Do you have any ideas?

image

Setting rotation for any display doesn't work

Hi,

I have been using this API to write a small application to set the position, resolution and rotation of displays. It works perfectly fine when setting the position and resolution, BUT setting the rotation has no effect, all displays revert back to zero degrees as soon as the configuration is applied.

Add custom resolution

Hello @falahati !

I managed to change my screen resolution thanks to your answer here (#8),
however I'd like to add a custom resolution (as in the nvidia control panel), do you have any clue how I could do this ?

Thanks !

Scale and layout settings

Hello,

How would you implement something that could retrieve scaling factor by display ?

I would like at least get the selected % from this list for each display :

image

Thanks

Crash in NvAPISample

I have 4 displays connected. 3 are 1920x1080 and one is 3840x2160
Selecting [01] Connected Displays gives:

[01] \\.\DISPLAY1
[02] \\.\DISPLAY2
[03] \\.\DISPLAY3

Selecting any of these crashes with InvalidDisplayId

Multiple displays

Hey, it would be great if we could access the displays that we want to use.
I want to make a little program that will let me change my display between my TV and my three monitors. It's very time consuming and frustrating because sometimes the order of the displays is messed up and I need to go and manually drag the displays to get them in the right order.

var displays = Wrapper.GetConnectedNvidiaGPUDisplays();
Something like Wrapper.SetActiveDisplay(display[0], display[1]);
The others that are not specified in setactivedisplay, example my TV would be deactivated.

It's like the Nvidia Control Panel, on the multiple displays tab. Just like that, but if we could access it by code it would be brilliant.

Wrapper.SetPrimaryDisplay(display[0]);

These are just a few ideas;
The order of the SetActiveDisplay would be the order that they are in real life.

Thank you.

Add support for monitoring power consumption

I'm too lazy to study how this lib is implemented, so I'll leave it as an issue here.

I've studied thoroughly one of monitoring tools, and I managed to pry from it how to measure power rails, e.g. how much power is consumed from PCI-E slot.

You might want to take a look at JustAMan/pynvraw@d98c7e0

I'm also going to look in the RTSS SDK - they seem to have better understanding of the structures, so I'm going to update my Python lib based on them.

Set fan speed to automatic

gpu.CoolerInformation.SetCoolerSettings(cooler.CoolerId, 50);

this sets it to 50. how can i set it to auto, so it will reset to default?

Setting Position and Resolution of Screens

Amazing application, just the thing I was looking for!

Any chance you could provide an example of setting of properties within your sample code, at the moment, there is only getting of properties.

I want to change the resolution and/or positions of screens dynamically within a 3 screen system and wondered if this would be possible using this wrapper.

I've tried modifying properties, e.g. IsGDIPrimary, Position, Resolution within the PathInfo class however I'm not seeing any effect.

Many thanks again for the fantastic app.

S

32bit process running in a 64bit environment can't access NVIDIA API

Hi!

Followed the sample, but I get this error at NVIDIA.Initialize();

Stacktrace:

at NvAPIWrapper.Native.Helpers.DelegateFactory.NvAPI_QueryInterface(UInt32 interfaceId)
at NvAPIWrapper.Native.Helpers.DelegateFactory.GetDelegateT
at NvAPIWrapper.Native.GeneralApi.Initialize()
at NvAPIWrapper.NVIDIA.Initialize()

Any idea?

Thanks

EDIT:
Just changed the target plateform for my app, since the Wrapper solution successfully built.

Getting NVAPI_API_NOT_INITIALIZED

Getting NVAPI_API_NOT_INITIALIZED.

The error only occurs on 1 of the computers that i've tested.
The computer has an GeForce 210 with 342.01 NVIDIA Driver.

Funny thing is that i have another computer with same GPU and driver version and it works fine.

Problem using EnableCurrentTopology

Hello, I really appreciate all the work you have done for this project. I am trying it for the first time on a brand new Quardo P2200. I am getting all report data back just fine and I am even able to set a Mosaic topology just fine but anytime I try to use the EnableCurrentTopology to disable the current one it always fails and returns a general error providing no real answers as to why it is failing. Can you please offer some advise?

Request for Sample Code

Hi, I recently discovered this repository, and I am going to use it along with some software I've made.

The software is used as a launcher for racing simulator games (Sim Racing Launcher)

I would like to use this library to get the current settings, exactly like Helios does, and save them if the user requests. Then, the user could change the settings to what they would use when sim racing, and save them again with a different profile.

Then, the user could choose a profile that would be applied on launch, and another profile on exit.

I would like to achieve this in the simplest means possible, I don't need to display any DisplayDevice data or anything, just save a GridTopology object, and apply it at a certain time.

Could you guide me on which commands I would need to run to get the current display settings (for surround or not), and how to re-apply that profile.

Cheers,
Morgan

Mosaic API calls returning NVAPI_NOT_SUPPORTED exception

I have NVS 510 card. I am able to set my displays in mosaic configuration using NVidia control panel. But when i try to get the current topology using this call

MosaicApi.GetCurrentTopology(out TopologyBrief tb, out IDisplaySettings ds, out int x, out int y);

It returns NVAPI_NOT_SUPPORTED exception. I tried a few more methods like 'MosaicApi.GetSupportedTopologiesInfo' but everything return the same exception.

Reading EDID?

Thank you very much for your great work creating NvAPIWrapper. Among the many other things I'll be attempting to do, one of the first things I'm attempting to do is read EDIDs from connected DisplayPort and HDMI displays. I am using an RTX 3060. I am currently trying to read EDIDs from a 4K, 144kHz Acer monitor. The EDID has base EDID and two extension blocks on both the HDMI 2.1 port and the DisplayPort port. I first tried using your technique in I2CSample. When I use this technique, first reading the 128 base EDID and examining byte 126 to determine how many externsion blocks there are, it works greate for DisplayPort. After determining that there are two extension blocks, I call it again with a length of 384 and I am able to get the entire EDID. When I attempt to do the same while connected via HDMI 2.1, I don't get valid EDID data when reading the base EDID. When I use the same code to attempt to read the base EDID via the HDMI 2.1 port, I get 128 bytes of data that is just 00h, FFh, FFh, FFh, over and over through the entire 128 bytes. I then attempted to read the EDID using NvAPIWrapper.Native.GPUApi.GetEDID to do the task, but it seems that it is only able to return EDIDV3.MaxDataSize of 256 bytes. So I am not able to get all three blocks of EDID data. I am very much just getting started with your wrapper and I am very much stumbling around. Do you have any advice for me on how I can get all three blocks of the monitor's EDID via the HDMI 2.1 port? Thank you. -Mike

Edit:
Here is what I am doing (I modified your I2CSample.I2CReadEDID to have a second parameter called number of blocks that just mulitplies the readDataLength parameter to be 128 * numOfBlocks).

        Dim Displays() As NvAPIWrapper.Display.Display = NvAPIWrapper.Display.Display.GetDisplays()
        Dim byts() As Byte = NVIDIA.I2CSample.I2CReadEDID(Displays(0).Output, 1)
        Dim numOfBlocks As UInteger = byts(126) + 1
        byts = NVIDIA.I2CSample.I2CReadEDID(Displays(0).Output, numOfBlocks)
        
        Works fine on DP, returns 00h, FFh, FFh, FFh, 00h, FFh, FFh, FFh, 00h... for the entire 128 bytes on HDMI 2.1.

Available settings by display

Hello,

Thanks for the good work.

I'm trying to help implement something but how would you implement a method to retrieve all available settings by display ?

Like all resolutions available, all refreshrates available, etc..

is there a NvApi methods to do that we can wrap ?

Thank you !

image

GTX1050ti does not do RPM fan speed.

nvapi_gpu_gettachreading doesn't work for GTX1050ti cards. It only does % readings.

When I remove the following:

https://github.com/falahati/NvAPIWrapper/blob/master/NvAPIWrapper/GPU/GPUCooler.cs#L26

and

https://github.com/falahati/NvAPIWrapper/blob/master/NvAPIWrapper/GPU/GPUCoolerInformation.cs#L54

GPUCoolerInformation works, and you can control fans. If not, then you NVAPI_NOT_SUPPORTED errors.

You may want to consider having the Tach/RPM speed in a different lower level API method.

Absolute power reading (in Watts, not in percent of TDP) using NvAPI

Hi,

Is possible to read absolute power (in watts, not in percent of TDP) using NvAPI?. I know we can read total power in watts using NVML, but i need to read watts using NvAPI. I checked all (ones with public information) structures of NvAPI and i can not found it. NvAPI_GPU_ClientPowerTopologyGetStatus can provide Power Consumption (for board and GPU) but in % of TDP. In other hands, NvAPI_GPU_ClientPowerTopologyGetInfo (i don´t know used structure meaning) seems not provide usefull info.

Or is possible to read GPU´s TDP using NvAPI?.

Thanks in advance. Greetings

Doesnt work with 4.7?

Just pulled down your project unmodified and upon build I get this.


Build started ...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1111,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Faking NVIDIA Surround API information?

When running Nvidia surround, certain games are given API information regarding the size of each monitor. This allows them to constrain the UI of a game to the middle monitor while spanning the game across all 3 monitors.

Since Nvidia surround is such a huge pain, I've started using a method with an AutoHotKey script to resize games in borderless windowed mode to the full triplewide resolution. This works well, but has the downside of the games not having the API information to constrain the UI to the middle monitor.

Using this, is it possible to fake that surround API information in order to constrain the UI in a given game?

I believe page 14 of this document is how it's generally implemented, and what I want to try and spoof - http://developer.download.nvidia.com/whitepapers/2010/SurroundBestPracticesGuide.pdf

Thanks

Invalid encrypted settings are returned for GetSetting calls.

NVidia in their ceaseless efforts to be insane and add fake security added encrypted keys to profiles.

In NvAPIWrapper, you simply return the raw values, which are thus invalid. An example test case I used was Arma 3. The setting for
Setting ID_0x708db8c5 = 0x5e398a4c InternalSettingFlag=V0
is returned raw, as 0x5e398a4c, an invalid convergence value. The actual value should be 0x3DA26384 which is a float for 0.7.

You can see in Nvidia Profile Inspector the correct value is displayed. But returns via NvAPIWrapper's API are corrupt.

See this Issue for details on the fix: Orbmu2k/nvidiaProfileInspector#7

Any profile entry tagged with "InternalSettingFlag=V0" is an encrypted field.

Overclocking

How can I overclock using the api? like, the memory clock and voltage stuff? if i try using something it bugs out. i know that it's possible because there is an nvapiwrapper-based app that can do that.

setting power limit

uint vn = Convert.ToUInt32(actual_percent * 1000f);
PrivatePowerPoliciesStatusV1 pl = GPUApi.ClientPowerPoliciesGetStatus(GPUs[Index].Handle);
PrivatePowerPoliciesStatusV1.PowerPolicyStatusEntry[] entry = { new PrivatePowerPoliciesStatusV1.PowerPolicyStatusEntry(vn) };
PrivatePowerPoliciesStatusV1 new_pl = new PrivatePowerPoliciesStatusV1(entry);
GPUApi.ClientPowerPoliciesSetStatus(GPUs[Index].Handle, new_pl);

This will only set P0_3DPerformance to whatever % value I wanted.

I can't really change the PerformanceStateId because it's a read only value, so I'm no sure if it is worth adding 1 entry for each existing entry...If there is ever actually more than 1 existing entry...All of my GPUs don't have more than 1 PowerPolicyStatusEntry, which is P0_3DPerformance....But it is an array of PowerPolicyStatusEntries according to low-level.

This works for setting P0, I'm wondering if there is a need and/or a possibility of setting other PerformanceStateId based on the what the GPU has set already? Or would I be fine just setting P0, and removing any existing entries in GPU beyond P0 like I am doing now?

Data Structures and functions

Sorry for delay in my response. @MaynardMiner, you lib and code works perfect, thanks. @falahati, data structures are OK, problem is i was porting code and make a mistake porting your structures. About new version in structures, You are right, it is not a deal to break old programs with new structures, making old structures obsoletes. Problem is not with data structures but with functions. Navi arch does not support Fan Cooler Status Function (returns -104 Nvapi_not_supported), instead it is necessary to use Fan Client Functions (Status). I checked it using GTX1660, RTX2070 and RTX2060 GPUs with Fan Client Structures and ported code works very fine. It is possible Reserved or Unknown field are Flags for Data Supported (How knows? I do not have information about some Nvidia structures (Its a mistery for common people)). If you need to make some tests with Navi GPUs, let me know, will be my pleasure. Thanks.

Something is wrong

I downloaded the package from NUGET and no write I2C functions are available

Fan Speed Control For RTX Cards.

Would this work with latest Cuda to set fan speed? Is there a way you can provide an use-case example?

I have figured out how to get the cooler settings:

NVIDIA.Initialize();
var gpus = GPUApi.EnumPhysicalGPUs();
var GPU_CoolerSettings = GPUApi.GetCoolerSettings(gpus[0]);
for (uint i = 0; i < GPU_CoolerSettings.CoolerSettings.Length; i++)
{
 ConsoleWriter.Default.PrintMessage("Current Fan speed for cooler is:");
 ConsoleWriter.Default.WriteObject(GPU_CoolerSettings.CoolerSettings[i].CurrentLevel);
 ConsoleWriter.Default.PrintMessage("Current Policy for cooler is:");
 ConsoleWriter.Default.WriteObject(GPU_CoolerSettings.CoolerSettings[i].CurrentPolicy);
}

But I haven't figure out how to to set it, or the policy to manual (so it can be set).

        public static void SetCoolerLevels(
            PhysicalGPUHandle gpuHandle,
            uint index,
            PrivateCoolerLevelsV1 coolerLevels,
            uint levelsCount
        )
            PrivateCoolerLevelsV1 coolerLevels,
            uint levelsCount

Is what I am lost on. I have been trying to find/code a way to set RTX fans in Windows via command line.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.