nvapi

How to use NvAPI_DISP_GetDisplayConfig?

回眸只為那壹抹淺笑 提交于 2019-12-11 10:02:10
问题 When using the NVAPI I'm having problems with NvAPI_DISP_GetDisplayConfig. I get an AppCrash on the second call to NvAPI_DISP_GetDisplayConfig. Can't seem to figure out why. NvU32 count = 0; status = NvAPI_DISP_GetDisplayConfig(&count, NULL); if (status != NVAPI_OK) PrintError(status); printf("Configs: %i\n", count); NV_DISPLAYCONFIG_PATH_INFO *configinfos = new NV_DISPLAYCONFIG_PATH_INFO[count]; configinfos[0].version = NV_DISPLAYCONFIG_PATH_INFO_VER; status = NvAPI_DISP_GetDisplayConfig(

Get temperature from NVidia GPU using NVAPI

余生长醉 提交于 2019-12-10 19:55:10
问题 I have been trying for the last few days to get the temperature of my GPU using C++ using the NVAPI i have the following code #include "stdafx.h" #include "nvapi.h" int _tmain(int argc, _TCHAR* argv[]) { NvAPI_Status ret = NVAPI_OK; int i=0; NvDisplayHandle hDisplay_a[NVAPI_MAX_PHYSICAL_GPUS*2] = {0}; ret = NvAPI_Initialize(); if (!ret == NVAPI_OK){ NvAPI_ShortString string; NvAPI_GetErrorMessage(ret, string); printf("NVAPI NvAPI_Initialize: %s\n", string); } NvAPI_ShortString ver; NvAPI

NvAPI NVAPI_INTERFACE Missing explicit type

帅比萌擦擦* 提交于 2019-12-10 16:35:28
问题 I'm new to c++/cli and would like to write a little managed wrapper for the nvapi. Now when trying to access some functions (e.g. NvAPI_Initialize) Visual Studio tells me that this function is not defined: #include "nvapi.h"; NvAPIStatus Nv_GPU_ThermalAPI::M_NvAPI_GPU_GetThermalSettings(System::UIntPtr gpuHandle, Nv_Thermal_Target sensorIndex, [Out] array<Nv_GPU_Thermal_Settings^>^% settings) { NvAPI_Status res = NvAPI_Status::NVAPI_OK; // OK NvPhysicalGpuHandle handle; // OK NV_GPU_THERMAL