Esempio n. 1
0
NvDisplayHandle EnumNvidiaDisplayHandles(VOID)
{
    NvPhysicalGpuHandle szGPUHandle[NVAPI_MAX_PHYSICAL_GPUS] = { 0 };     
    NvU32 gpuCount = 0;
    ULONG i = 0;

    NvStatus status = NvAPI_EnumPhysicalGPUs(szGPUHandle, &gpuCount);

    if (NV_SUCCESS(status))
    {
        for (i = 0; i < gpuCount; i++)
        {
            NvDisplayHandle zero = 0;

            if (NV_SUCCESS(NvAPI_EnumNvidiaDisplayHandle(i, &zero)))
            {
                return zero;
            }
        }
    }
    else
    {
        LogEvent(L"gfxinfo: (EnumNvidiaDisplayHandles) NvAPI_EnumPhysicalGPUs failed (%s)", status);
    }

    return NULL;
}
Esempio n. 2
0
BEGIN_NAMESPACE_XEVOL3D

xNvRenderer::xNvRenderer()
{
    NvAPI_Status ret = NvAPI_Initialize();
	if(NVAPI_OK != ret)
	{
         XEVOL_LOG(eXL_ERROR_NORMAL , L"Initialize NvApi Failed\n");
		 return ;
	}

	NvAPI_Status nvapiStatus;
	m_nvDisplayCount = 0;
	// Enumerate all display handles
	for(int i=0,nvapiStatus=NVAPI_OK; nvapiStatus == NVAPI_OK; i++)
	{
		nvapiStatus = NvAPI_EnumNvidiaDisplayHandle(i, &m_hDisplay[i]);

		if (nvapiStatus == NVAPI_OK) m_nvDisplayCount++;
	}
	for(int i=0; i< m_nvDisplayCount; i++)
	{
		NvAPI_GetDisplayDriverVersion(m_hDisplay[i] , &m_DrvVersion);
		
	}

	
}
Esempio n. 3
0
static VOID NvGpuEnumDisplayHandles(VOID)
{
    for (NvU32 i = 0; i < NVAPI_MAX_DISPLAYS; i++)
    {
        NvDisplayHandle displayHandle;

        if (NvAPI_EnumNvidiaDisplayHandle(i, &displayHandle) == NVAPI_END_ENUMERATION)
        {
            break;
        }

        PhAddItemList(NvGpuDisplayHandleList, displayHandle);
    }
}
Esempio n. 4
0
NvPhysicalGpuHandle EnumNvidiaGpuHandles(VOID)
{
    NvPhysicalGpuHandle szGPUHandle[NVAPI_MAX_PHYSICAL_GPUS] = { 0 };     
    NvU32 gpuCount = 0;
    ULONG i = 0;

    NvStatus status = NvAPI_EnumPhysicalGPUs(szGPUHandle, &gpuCount);

    if (NV_SUCCESS(status))
    {
        for (i = 0; i < gpuCount; i++)
        {
            NvDisplayHandle zero = 0;

            if (NV_SUCCESS(NvAPI_EnumNvidiaDisplayHandle(i, &zero)))
            {
                NvU32 num3;

                NvPhysicalGpuHandle gpuHandles2[0x40];

                if (NV_SUCCESS(NvAPI_GetPhysicalGPUsFromDisplay(zero, gpuHandles2, &num3)))
                {
                    ULONG gpuCount2;

                    for (gpuCount2 = 0; gpuCount2 < num3; gpuCount2++)
                    {
                        //if (!NVidiaGPUs.ContainsKey(gpuCount2))
                           // NVidiaGPUs.Add(gpuCount2, new NvidiaGPU(i, gpuHandles2[gpuCount2], zero));
                        return gpuHandles2[gpuCount2];
                    }
                }
            }
        }
    }
    else
    {
        LogEvent(L"gfxinfo: (EnumNvidiaGpuHandles) NvAPI_EnumPhysicalGPUs failed (%s)", status);
    }

    return szGPUHandle[0];
}