How do you call this method on Nvidia GPU:
NVAPI_INTERFACE NvAPI_GPU_SetEDID (
NvPhysicalGpuHandle hPhysicalGpu,
NvU32 displayOutputId,
NV_EDID * pEDID
)
I need to execute the above command to remove all EDID set on all DisplayOutputs on our new Quadro Graphics Cards. Based on the API documentation, I tried searching for NvPhysicalGpuHandle and came across this project/library:
https://github.com/openhardwaremonitor/openhardwaremonitor/blob/master/Hardware/Nvidia/NVAPI.cs
This does not have the method I need NvAPI_GPU_SetEDID
I am not hardware programmer, I just need to be able to call this one command. any ideas? Can this be achieved using nvapi.dll/nvapi64.dll
via pinvoke
or something?
I personally didn't test this, but you can try the library and see if it can set EDID information without any problem, if it fails, please open an issue.
https://github.com/falahati/NvAPIWrapper
Here is how you should do it,
DisplayDevice
orGPUOutput
that you want to write EDID information to. There are multiple ways to do so.PhysicalGPU
s in the system using theNvAPIWrapper.GPU.PhysicalGPU.GetPhysicalGPUs()
static method, then select thePhysicalGPU
you desire based on your logic. After finding the rightPhysicalGPU
, use theNvAPIWrapper.GPU.PhysicalGPU.GetDisplayDevices()
method to get a list of all connectedDisplayDevice
s to that GPU and store the right one in a variable.DisplayDevice
s, you can also go for theGPUOutput
s. Just like before, you first need to find the rightPhysicalGPU
and then you can get a list of allGPUOutput
s using theNvAPIWrapper.GPU.PhysicalGPU.ActiveOutputs
property and store the rightGPUOutput
in a variable.DisplayDevice
is to go for a list of allDisplays
. To do so, you need to use theNvAPIWrapper.Display.Display.GetDisplays()
static method. This returns an array ofDisplay
s. Then using theNvAPIWrapper.Display.Display.DisplayDevice
property, you can get the correspondingDisplayDevice
of aDisplay
.DisplayDevice
orGPUOutput
, you should use theNvAPIWrapper.GPU.PhysicalGPU.WriteEDIDData()
method. This method allows you to write EDID data stored in a byte array to theDisplayDevice
or theGPUOutput
you selected before.Note: Make sure to capture
NVIDIAApiException
and check for theNVIDIAApiException.Status
property in case something went wrong.