@sujatas-NV @planke-NV @arunimam-NV
nvapi.h includes nvapi_lite_salstart.h which in turn uses a symbol NvAPI_Status which is only defined later in nvapi_lite_common.h (which also includes nvapi_lite_salstart.h before it defines the symbol).
This level of software engineering incompetence with basic C/C++ stuff such as header files, order of including, avoiding cyclic inclusions, and symbols being used before defining is staggering even when it doesn't result in unusable release -- I'd expect it from students learning C in high school class, not from NVIDIA employees even if those are new hires.
You all should be ashamed of yourself for allowing this to be released in such a broken state both here and in R560-developer.zip download from developer.nvidia.com.
Bug ID #4919663.
Activity
3This is still broken in R590... sad...
The following resolved it for me.
// nvapi headers
// disable clang-format header reordering
// as <NvApiDriverSettings.h> needs types from <nvapi.h>
// clang-format off
// With GCC/MinGW, nvapi_lite_salend.h (included transitively via nvapi_lite_d3dext.h)
// undefines all SAL annotation macros (e.g. __success, __in, __out, __inout) after
// nvapi_lite_salstart.h had defined them. This leaves NVAPI_INTERFACE and other macros
// that use SAL annotations broken for the rest of nvapi.h. Defining __NVAPI_EMPTY_SAL
// makes nvapi_lite_salend.h a no-op, preserving the SAL macro definitions throughout.
// After nvapi.h, we include nvapi_lite_salend.h explicitly (without __NVAPI_EMPTY_SAL)
// to clean up the SAL macros and prevent them from polluting subsequent includes.
#if defined(__GNUC__)
#define __NVAPI_EMPTY_SAL
#endif
#include <nvapi.h>
#include <NvApiDriverSettings.h>
#if defined(__GNUC__)
#undef __NVAPI_EMPTY_SAL
// Clean up SAL macros that nvapi_lite_salstart.h defined and salend.h was
// prevented from cleaning up (due to __NVAPI_EMPTY_SAL above).
#include <nvapi_lite_salend.h>
#endif
// clang-format onI used Claude Sonnet 4.6 to create the solution.
Another (probably cleaner) solution would be to reorder #include"nvapi_lite_salstart.h" in nvapi.h as the last include.
Probably got messed up by some automatic header reordering tool?
I suspect this is the cause of my build errors in the following as well.
I have my own dist of this (https://github.com/LizardByte/nvapi-open-source-sdk) which I created before the official repo existed. I am now trying to move to the official one, but the R555 version is missing
nvapi_interface.hso it cannot be used as is. https://github.com/NVIDIA/nvapi/tree/fab23132652026fe9bb42c2c4cac452bddfcc5a9At a bare minimum would it be possible for a maintainer to edit the git history and fix the R555 version?