Skip to content

Official NVAPI R560 release is broken!!! #11

Description

@levicki

@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

  1. ReenigneArcher commented on Mar 15, 2025

    @ReenigneArcher

    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.h so it cannot be used as is. https://github.com/NVIDIA/nvapi/tree/fab23132652026fe9bb42c2c4cac452bddfcc5a9

    At a bare minimum would it be possible for a maintainer to edit the git history and fix the R555 version?

  2. ReenigneArcher commented on Mar 9, 2026

    @ReenigneArcher

    This 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 on

    I used Claude Sonnet 4.6 to create the solution.

  3. chrooti commented on Mar 9, 2026

    @chrooti

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions