NvAPI_GetSupportedMosaicTopologies and NvAPI_EnableCurrentMosaicTopology return -3

mosaic api return -3 , Can who anyone give me some helps?

Hi,

NvAPI_GetSupportedMosaicTopologies and NVAP_EnableCurrentMosaicTopology are legacy APIs only used on Windows XP for NVIDIA QuadroPlex products.

To enable MOSIAC on Windows 7 or Windows 10 you will need to use the following APIs:

  • NvAPI_Mosaic_EnumDisplayGrids // Will get the current setup
  • NvAPI_Mosaic_ValidateDisplayGrids // Validates the display GRID
  • NvAPI_Mosaic_SetDisplayGrids // sets the display grid.

Each call has the parameter NV_MOSAIC_GRID_TOPO which defines the display grid in terms of rows, columns, display ids that make up the GRID and the display resolution.

Code snippet to get return the current GRID is:

NvU32 get_current_grid(NV_MOSAIC_GRID_TOPO *gridTopo)
{
//Enumerate display grids
NvU32 gridCount;
NvAPI_ShortString estring;
NvAPI_Status status;

// Get the current state - useful for debugging
    // Returns the number of grids
    // One MOSAIC display is 1 grid
    // Four extended desktops would be 4 GRIDs
    status = NvAPI_Mosaic_EnumDisplayGrids(NULL, &gridCount);
    if (status != NVAPI_OK)  {
           NvAPI_GetErrorMessage(status, estring);
           printf("NvAPI_SetDisplaySettings Error: %s\n", estring);
           }

// Setup Grid topology
    //NV_MOSAIC_GRID_TOPO *gridTopo = new NV_MOSAIC_GRID_TOPO[gridCount];

// gridTopo->version = NV_MOSAIC_GRID_TOPO_VER;

    //Read the topology of the current Grid. 
    // This will populate resolution info etc.
    status = NvAPI_Mosaic_EnumDisplayGrids(gridTopo, &gridCount);
if (status != NVAPI_OK)  {
           NvAPI_GetErrorMessage(status, estring);
           printf("NvAPI_SetDisplaySettings Error: %s\n", estring);
           }
    return(gridCount);

}

Note: If MOSAIC is not enabled when you call this it will return multiple GRIDS each wait a single display.

Once you have defined the grid you want to set you can validate if it is supported on your setup:

void mosaic_validate_displayGrid(NV_MOSAIC_GRID_TOPO *gridTopo, NvU32 gridcount)
{
NvAPI_ShortString estring;
NvAPI_Status status;

    //
    NV_MOSAIC_DISPLAY_TOPO_STATUS *gridTopoStatus = new NV_MOSAIC_DISPLAY_TOPO_STATUS[16];
    gridTopoStatus->version = NV_MOSAIC_DISPLAY_TOPO_STATUS_VER;

    printf("\n Checking the requested Display Grid is valid");

    status = NvAPI_Mosaic_ValidateDisplayGrids(0, gridTopo, gridTopoStatus, gridcount);
    if (status != NVAPI_OK)  {
           NvAPI_GetErrorMessage(status, estring);
           printf("NvAPI_SetDisplayGrids Error: %s\n", estring);
           }
    else
           {
           if(gridTopoStatus->errorFlags == 0)
             printf("\n Display Grid Valid... \n");
           else
           {
                   printf("\n Display Grid is not valid");
                   printf("\n NvAPI_ValidateDisplayGrids returned the following Error Flags:");
                   // Error values are from NV_MOSAIC_DISPLAYCAPS_PROBLEM - which are not defined in Public API
                   // Added the error checks here.

                   if (gridTopoStatus->errorFlags & NV_BIT(0))
                           printf("\n\t Display is on Invalid GPU \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(1))
                           printf("\n\t DISPLAY_ON_WRONG_CONNECTOR \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(2))
                           printf("\n\t NO_COMMON_TIMINGS \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(3))
                           printf("\n\t NO_EDID_AVAILABLE  \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(4))
                           printf("\n\t MISMATCHED_OUTPUT_TYPE \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(5))
                           printf("\n\t NO_DISPLAY_CONNECTED  \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(6))
                           printf("\n\t NO_GPU_TOPOLOGY  \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(7))
                           printf("\n\t DISPLAY_TIMING_NOT_SUPPORTED  \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(8))
                           printf("\n\t NO_SLI_BRIDGE    \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(9))
                           printf("\n\t ECC_ENABLED     \n");
                   if (gridTopoStatus->errorFlags & NV_BIT(10))
                           printf("\n\t GPU_TOPOLOGY_NOT_SUPPORTED     \n");
           }

    if(gridTopoStatus->warningFlags != 0)
           {
                   printf("\n NvAPI_ValidateDisplayGrids returned the following Warning Flags:");
                   if((gridTopoStatus->warningFlags & 0x01))
                           printf("\n INFO only: Display's position in the grid is sub-optimal \n");
                   if(gridTopoStatus->warningFlags & 0x02)
                   {
                           printf("\n !! To enable MOSAIC the NVIDIA driver will need to be re-loaded");
                           printf("\n !! Please close any running 3D applications before proceeding");
                           printf("\n !! Failure to do so may make the system or application unstable");
                           system("pause");
                   }
           }
    }

}

Finally to enable MOSAIC:

                   status = NvAPI_Mosaic_SetDisplayGrids(gridTopo, gridCount, 0);


                   if (status != NVAPI_OK)  {
                   NvAPI_GetErrorMessage(status, estring);
                   printf("NvAPI_SetDisplayGrids Error: %s\n", estring);
                   }
                   else
                   {
                           printf("\n Setting MOSAIC successfull... \n");
                   }
1 Like

Hi, rypark

I have met challenges in use the NVIDIA MOSAIC API to realize the fuctions of “configureMosaic.exe”.
Can you give me a demo about this?
Hope for reply, Thanks!
Best Wishs.

Could you provide more specific details?

Are you asking for help to develop a configureMosaic like app, or asking for help to run “configureMosaic”?

Thanks,

Ryan Park

Yes, I’m asking for help to develop a configureMosaic like app.
Hope for reply, Thanks!
Best Wishs.