Reputation: 24116
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?
Upvotes: 1
Views: 1812
Reputation: 2337
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
or GPUOutput
that you want to write EDID information to. There are multiple ways to do so.
PhysicalGPU
s in the system using the NvAPIWrapper.GPU.PhysicalGPU.GetPhysicalGPUs()
static method, then select the PhysicalGPU
you desire based on your logic. After finding the right PhysicalGPU
, use the NvAPIWrapper.GPU.PhysicalGPU.GetDisplayDevices()
method to get a list of all connected DisplayDevice
s to that GPU and store the right one in a variable.DisplayDevice
s, you can also go for the GPUOutput
s. Just like before, you first need to find the right PhysicalGPU
and then you can get a list of all GPUOutput
s using the NvAPIWrapper.GPU.PhysicalGPU.ActiveOutputs
property and store the right GPUOutput
in a variable.DisplayDevice
is to go for a list of all Displays
. To do so, you need to use the NvAPIWrapper.Display.Display.GetDisplays()
static method. This returns an array of Display
s. Then using the NvAPIWrapper.Display.Display.DisplayDevice
property, you can get the corresponding DisplayDevice
of a Display
.DisplayDevice
or GPUOutput
, you should use the NvAPIWrapper.GPU.PhysicalGPU.WriteEDIDData()
method. This method allows you to write EDID data stored in a byte array to the DisplayDevice
or the GPUOutput
you selected before.Note: Make sure to capture NVIDIAApiException
and check for the NVIDIAApiException.Status
property in case something went wrong.
Upvotes: 2