falahati/NvAPIWrapper

Problem using EnableCurrentTopology

gmeisel01 opened this issue · 4 comments

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?

What is the error message?

Topology is phase 1 mosaic API and is obsolete. Consider using GridTopology class which is phase 2 mosaic API. The correct way to disable mosaic using the phase 2 API is to simply create a topology for each display and use SetGridTopologies static method to activate them all.

var currentConfig = GridTopology.GetGridTopologies();
var newConfig = currentConfig
                         .SelectMany(t => t.Displays)
                         .Select(d => new GridTopology(1, 1, d))
                         .ToArray();
GridTopology.SetGridTopologies(newConfig, SetDisplayTopologyFlag.MaximizePerformance);

Thank you so much for clearing that up! I will give it a try. Surprisingly, there is nothing on the internet that even mentions this change in functionality in the NvApi, in fact, Nvidia still shows the the old functions in there current documents and still recommends using it to disable topo's?

NVAPI is not actually known for its good documentation :) But for this specific issue there is a block in the nvapi.h file that says:

// ###########################################################################
// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
//
//   Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain
//   once Phase 2 is complete.  For a small amount of time, the two will co-exist.  As
//   soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2
//   entrypoints, the code below will be deleted.
//
// DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
// ###########################################################################

But that's the only place that mentions this.

That's why I suggest using the high-level APIs and don't go for anything inside the Native namespace until you are sure that you have to. I marked the phase 1 classes as obsolete so that the library user knows that. But I didn't do so for the low-level functions in the Native namespace.