Is there a way in .NET 3.5 C # to determine if NVIDIA SLI mode is active

For NVIDIA graphics cards, you can have two workers (SLI). For a .NET desktop application, I need to verify that SLI is enabled. Is it possible?

+3
source share
1 answer

It should be possible.

According to nVidia docs, you can request this via NVCPL.DLL (liked the documentation).

The call used NvCplGetDataInt()(page 67), with the argument NVCPL_API_NUMBER_OF_SLI_GPUSor NVCPL_API_SLI_MULTI_GPU_RENDERING_MODEyou should get the required information.

, P/Invoke. NVCPL.DLL, ( ), . LoadLibrary GetEntryPoint Marshal ( ), .

Edit: ( nVidia, ;)):

public const int NVCPL_API_NUMBER_OF_GPUS =7;    // Graphics card number of GPUs. 
public const int NVCPL_API_NUMBER_OF_SLI_GPUS = 8;    // Graphics card number of SLI GPU clusters available. 
public const int NVCPL_API_SLI_MULTI_GPU_RENDERING_MODE = 9;    // Get/Set SLI multi-GPU redering mode.  

[DllImport("NVCPL.DLL", CallingConvention=CallingConvention.Cdecl)]
public static extern bool nvCplGetDataInt([In] int lFlag, [Out] out int plInfo);

public static void Main()   {
    int sliGpuCount;
    if (nvCplGetDataInt(NVCPL_API_NUMBER_OF_SLI_GPUS, out sliGpuCount)) {
        // we got the result
        Console.WriteLine(string.Format("SLI GPU present: {0}", sliGpuCount));
    } else {
        // something did go wrong
        Console.WriteLine("Failed to query NV data");
    }
}
+3

Source: https://habr.com/ru/post/1725440/


All Articles