port from perforce
This commit is contained in:
355
ruins64k/tools/NvPerf/include/nvperf_d3d11_host.h
Normal file
355
ruins64k/tools/NvPerf/include/nvperf_d3d11_host.h
Normal file
@@ -0,0 +1,355 @@
|
||||
#ifndef NVPERF_D3D11_HOST_H
|
||||
#define NVPERF_D3D11_HOST_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_d3d11_host.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
/// 'NVPA_MetricsContext' and its APIs are deprecated, please use 'NVPW_MetricsEvaluator' and its APIs instead.
|
||||
typedef struct NVPA_MetricsContext NVPA_MetricsContext;
|
||||
|
||||
typedef struct NVPW_D3D11_MetricsContext_Create_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out]
|
||||
struct NVPA_MetricsContext* pMetricsContext;
|
||||
} NVPW_D3D11_MetricsContext_Create_Params;
|
||||
#define NVPW_D3D11_MetricsContext_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_MetricsContext_Create_Params, pMetricsContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_MetricsContext_Create(NVPW_D3D11_MetricsContext_Create_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_RawMetricsConfig_Create_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
NVPA_ActivityKind activityKind;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out] new NVPA_RawMetricsConfig object
|
||||
struct NVPA_RawMetricsConfig* pRawMetricsConfig;
|
||||
} NVPW_D3D11_RawMetricsConfig_Create_Params;
|
||||
#define NVPW_D3D11_RawMetricsConfig_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_RawMetricsConfig_Create_Params, pRawMetricsConfig)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_RawMetricsConfig_Create(NVPW_D3D11_RawMetricsConfig_Create_Params* pParams);
|
||||
|
||||
typedef struct NVPW_MetricsEvaluator NVPW_MetricsEvaluator;
|
||||
|
||||
typedef struct NVPW_D3D11_MetricsEvaluator_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out]
|
||||
size_t scratchBufferSize;
|
||||
} NVPW_D3D11_MetricsEvaluator_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_D3D11_MetricsEvaluator_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_MetricsEvaluator_CalculateScratchBufferSize_Params, scratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_MetricsEvaluator_CalculateScratchBufferSize(NVPW_D3D11_MetricsEvaluator_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_MetricsEvaluator_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
uint8_t* pScratchBuffer;
|
||||
/// [in] the size of the 'pScratchBuffer' array, should be at least the size of the 'scratchBufferSize' returned
|
||||
/// by 'NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize'
|
||||
size_t scratchBufferSize;
|
||||
/// [in] use either 'pChipName' or 'pCounterDataImage', 'pChipName' will create the metrics evaluator based on a
|
||||
/// virtual device while 'pCounterDataImage' will create the metrics evaluator based on the actual device. If
|
||||
/// both are provided, 'pCounterDataImage' will be used
|
||||
const char* pChipName;
|
||||
/// [in]
|
||||
const uint8_t* pCounterDataImage;
|
||||
/// [in] must be provided if 'pCounterDataImage' is not NULL
|
||||
size_t counterDataImageSize;
|
||||
/// [out]
|
||||
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
||||
} NVPW_D3D11_MetricsEvaluator_Initialize_Params;
|
||||
#define NVPW_D3D11_MetricsEvaluator_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_MetricsEvaluator_Initialize_Params, pMetricsEvaluator)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_MetricsEvaluator_Initialize(NVPW_D3D11_MetricsEvaluator_Initialize_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_D3D11_HOST_H
|
||||
677
ruins64k/tools/NvPerf/include/nvperf_d3d11_target.h
Normal file
677
ruins64k/tools/NvPerf/include/nvperf_d3d11_target.h
Normal file
@@ -0,0 +1,677 @@
|
||||
#ifndef NVPERF_D3D11_TARGET_H
|
||||
#define NVPERF_D3D11_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_d3d11_target.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
// Device enumeration functions must be preceded by NVPA_<API>_LoadDriver(); any API is fine.
|
||||
|
||||
|
||||
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
/// GPU architecture support level
|
||||
typedef enum NVPW_GpuArchitectureSupportLevel
|
||||
{
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
||||
} NVPW_GpuArchitectureSupportLevel;
|
||||
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
/// SLI configuration support level
|
||||
typedef enum NVPW_SliSupportLevel
|
||||
{
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
/// Only Non-SLI configurations are supported.
|
||||
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
||||
} NVPW_SliSupportLevel;
|
||||
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
|
||||
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
||||
((pParams_)->structSize >= (const size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name External Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
struct ID3D11DeviceContext;
|
||||
struct ID3D11Device;
|
||||
typedef struct _LUID LUID;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_CounterDataImageOptions
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// The CounterDataPrefix generated from e.g. NVPW_CounterDataBuilder_GetCounterDataPrefix(). Must be align(8).
|
||||
const uint8_t* pCounterDataPrefix;
|
||||
size_t counterDataPrefixSize;
|
||||
/// max number of ranges that can be specified
|
||||
uint32_t maxNumRanges;
|
||||
/// max number of RangeTree nodes; must be >= maxNumRanges
|
||||
uint32_t maxNumRangeTreeNodes;
|
||||
/// max string length of each RangeName, including the trailing NUL character
|
||||
uint32_t maxRangeNameLength;
|
||||
} NVPW_D3D11_Profiler_CounterDataImageOptions;
|
||||
#define NVPW_D3D11_Profiler_CounterDataImageOptions_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_CounterDataImageOptions, maxRangeNameLength)
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_CounterDataImage_CalculateSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_D3D11_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [out]
|
||||
size_t counterDataImageSize;
|
||||
} NVPW_D3D11_Profiler_CounterDataImage_CalculateSize_Params;
|
||||
#define NVPW_D3D11_Profiler_CounterDataImage_CalculateSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_CounterDataImage_CalculateSize_Params, counterDataImageSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_CounterDataImage_CalculateSize(NVPW_D3D11_Profiler_CounterDataImage_CalculateSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_CounterDataImage_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_D3D11_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in] The buffer to be written.
|
||||
uint8_t* pCounterDataImage;
|
||||
} NVPW_D3D11_Profiler_CounterDataImage_Initialize_Params;
|
||||
#define NVPW_D3D11_Profiler_CounterDataImage_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_CounterDataImage_Initialize_Params, pCounterDataImage)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_CounterDataImage_Initialize(NVPW_D3D11_Profiler_CounterDataImage_Initialize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_CounterDataImage_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [out]
|
||||
size_t counterDataScratchBufferSize;
|
||||
} NVPW_D3D11_Profiler_CounterDataImage_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_D3D11_Profiler_CounterDataImage_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_CounterDataImage_CalculateScratchBufferSize_Params, counterDataScratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_CounterDataImage_CalculateScratchBufferSize(NVPW_D3D11_Profiler_CounterDataImage_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_CounterDataImage_InitializeScratchBuffer_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in] The scratch buffer to be written.
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
} NVPW_D3D11_Profiler_CounterDataImage_InitializeScratchBuffer_Params;
|
||||
#define NVPW_D3D11_Profiler_CounterDataImage_InitializeScratchBuffer_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_CounterDataImage_InitializeScratchBuffer_Params, pCounterDataScratchBuffer)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_CounterDataImage_InitializeScratchBuffer(NVPW_D3D11_Profiler_CounterDataImage_InitializeScratchBuffer_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_LoadDriver_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_D3D11_LoadDriver_Params;
|
||||
#define NVPW_D3D11_LoadDriver_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_LoadDriver_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_LoadDriver(NVPW_D3D11_LoadDriver_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_GetLUID_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
LUID* luid;
|
||||
} NVPW_D3D11_GetLUID_Params;
|
||||
#define NVPW_D3D11_GetLUID_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_GetLUID_Params, luid)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_GetLUID(NVPW_D3D11_GetLUID_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Device_GetDeviceIndex_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11Device* pDevice;
|
||||
/// [in]
|
||||
size_t sliIndex;
|
||||
/// [out]
|
||||
size_t deviceIndex;
|
||||
} NVPW_D3D11_Device_GetDeviceIndex_Params;
|
||||
#define NVPW_D3D11_Device_GetDeviceIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Device_GetDeviceIndex_Params, deviceIndex)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Device_GetDeviceIndex(NVPW_D3D11_Device_GetDeviceIndex_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_CalcTraceBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] Maximum number of Push/Pop pairs that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] for sizing internal buffers
|
||||
size_t avgRangeNameLength;
|
||||
/// [out] TraceBuffer size for a single pass. Pass this to
|
||||
/// NVPW_D3D11_Profiler_BeginSession_Params::traceBufferSize.
|
||||
size_t traceBufferSize;
|
||||
} NVPW_D3D11_Profiler_CalcTraceBufferSize_Params;
|
||||
#define NVPW_D3D11_Profiler_CalcTraceBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_CalcTraceBufferSize_Params, traceBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_CalcTraceBufferSize(NVPW_D3D11_Profiler_CalcTraceBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_BeginSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
/// [in] Set to 1 if every pass is synchronized with CPU; for asynchronous collection, increase to
|
||||
/// (softwarePipelineDepth + 2).
|
||||
size_t numTraceBuffers;
|
||||
/// [in] Size of the per-pass TraceBuffer in bytes. The profiler allocates a numTraceBuffers * traceBufferSize
|
||||
/// internally.
|
||||
size_t traceBufferSize;
|
||||
/// [in] Maximum number of ranges that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] Maximum number of kernel launches that can be recorded in a single pass. Must be >= maxRangesPerPass.
|
||||
size_t maxLaunchesPerPass;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_BeginSession_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_BeginSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_BeginSession_Params, maxLaunchesPerPass)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_BeginSession(NVPW_D3D11_Profiler_DeviceContext_BeginSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_EndSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_EndSession_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_EndSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_EndSession_Params, pDeviceContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_EndSession(NVPW_D3D11_Profiler_DeviceContext_EndSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_SetConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
/// [in] Config created by e.g. NVPW_RawMetricsConfig_GetConfigImage(). Must be align(8).
|
||||
const uint8_t* pConfig;
|
||||
size_t configSize;
|
||||
/// [in] the lowest nesting level to be profiled; must be >= 1
|
||||
uint16_t minNestingLevel;
|
||||
/// [in] the number of nesting levels to profile; must be >= 1
|
||||
uint16_t numNestingLevels;
|
||||
/// [in] Set this to zero for in-app replay. Set this to the output of EndPass() for application replay.
|
||||
size_t passIndex;
|
||||
/// [in] Set this to minNestingLevel for in-app replay. Set this to the output of EndPass() for application
|
||||
/// replay.
|
||||
uint16_t targetNestingLevel;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_SetConfig_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_SetConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_SetConfig_Params, targetNestingLevel)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_SetConfig(NVPW_D3D11_Profiler_DeviceContext_SetConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_ClearConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_ClearConfig_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_ClearConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_ClearConfig_Params, pDeviceContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_ClearConfig(NVPW_D3D11_Profiler_DeviceContext_ClearConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_BeginPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_BeginPass_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_BeginPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_BeginPass_Params, pDeviceContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_BeginPass(NVPW_D3D11_Profiler_DeviceContext_BeginPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_EndPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_EndPass_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_EndPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_EndPass_Params, pDeviceContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_EndPass(NVPW_D3D11_Profiler_DeviceContext_EndPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_PushRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
/// [in] specifies the range that subsequent launches' counters will be assigned to; must not be NULL
|
||||
const char* pRangeName;
|
||||
/// [in] assign to strlen(pRangeName) if known; if set to zero, the library will call strlen()
|
||||
size_t rangeNameLength;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_PushRange_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_PushRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_PushRange_Params, rangeNameLength)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_PushRange(NVPW_D3D11_Profiler_DeviceContext_PushRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_PopRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_PopRange_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_PopRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_PopRange_Params, pDeviceContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_PopRange(NVPW_D3D11_Profiler_DeviceContext_PopRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
/// [out] number of ranges whose data was dropped in the processed pass
|
||||
size_t numRangesDropped;
|
||||
/// [out] number of bytes not written to TraceBuffer due to buffer full
|
||||
size_t numTraceBytesDropped;
|
||||
/// [out] true if a pass was successfully decoded
|
||||
NVPA_Bool onePassCollected;
|
||||
/// [out] becomes true when the last pass has been decoded
|
||||
NVPA_Bool allPassesCollected;
|
||||
/// [out] the Config decoded by this call
|
||||
const uint8_t* pConfigDecoded;
|
||||
/// [out] the passIndex decoded
|
||||
size_t passIndexDecoded;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params, passIndexDecoded)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_DecodeCounters(NVPW_D3D11_Profiler_DeviceContext_DecodeCounters_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_IsGpuSupported_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
NVPA_Bool isSupported;
|
||||
/// [out]
|
||||
NVPW_GpuArchitectureSupportLevel gpuArchitectureSupportLevel;
|
||||
/// [out]
|
||||
NVPW_SliSupportLevel sliSupportLevel;
|
||||
} NVPW_D3D11_Profiler_IsGpuSupported_Params;
|
||||
#define NVPW_D3D11_Profiler_IsGpuSupported_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_IsGpuSupported_Params, sliSupportLevel)
|
||||
|
||||
/// NVPW_D3D11_LoadDriver must be called prior to this API
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_IsGpuSupported(NVPW_D3D11_Profiler_IsGpuSupported_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D11_Profiler_DeviceContext_GetCounterAvailability_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D11DeviceContext* pDeviceContext;
|
||||
/// [in/out] If `pCounterAvailabilityImage` is NULL, then the required size is returned in
|
||||
/// `counterAvailabilityImageSize`, otherwise `counterAvailabilityImageSize` should be set to the size of
|
||||
/// `pCounterAvailabilityImage`, and on return it would be overwritten with number of actual bytes copied
|
||||
size_t counterAvailabilityImageSize;
|
||||
/// [in] buffer receiving counter availability image, may be NULL
|
||||
uint8_t* pCounterAvailabilityImage;
|
||||
} NVPW_D3D11_Profiler_DeviceContext_GetCounterAvailability_Params;
|
||||
#define NVPW_D3D11_Profiler_DeviceContext_GetCounterAvailability_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D11_Profiler_DeviceContext_GetCounterAvailability_Params, pCounterAvailabilityImage)
|
||||
|
||||
/// This API may fail, if any profiling or sampling session is active on the specified ID3D11DeviceContext or its
|
||||
/// device
|
||||
NVPA_Status NVAPI NVPW_D3D11_Profiler_DeviceContext_GetCounterAvailability(NVPW_D3D11_Profiler_DeviceContext_GetCounterAvailability_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_D3D11_TARGET_H
|
||||
337
ruins64k/tools/NvPerf/include/nvperf_d3d12_host.h
Normal file
337
ruins64k/tools/NvPerf/include/nvperf_d3d12_host.h
Normal file
@@ -0,0 +1,337 @@
|
||||
#ifndef NVPERF_D3D12_HOST_H
|
||||
#define NVPERF_D3D12_HOST_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_d3d12_host.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_D3D12_RawMetricsConfig_Create_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
NVPA_ActivityKind activityKind;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out] new NVPA_RawMetricsConfig object
|
||||
struct NVPA_RawMetricsConfig* pRawMetricsConfig;
|
||||
} NVPW_D3D12_RawMetricsConfig_Create_Params;
|
||||
#define NVPW_D3D12_RawMetricsConfig_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_RawMetricsConfig_Create_Params, pRawMetricsConfig)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_RawMetricsConfig_Create(NVPW_D3D12_RawMetricsConfig_Create_Params* pParams);
|
||||
|
||||
typedef struct NVPW_MetricsEvaluator NVPW_MetricsEvaluator;
|
||||
|
||||
typedef struct NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out]
|
||||
size_t scratchBufferSize;
|
||||
} NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize_Params, scratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize(NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_MetricsEvaluator_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
uint8_t* pScratchBuffer;
|
||||
/// [in] the size of the 'pScratchBuffer' array, should be at least the size of the 'scratchBufferSize' returned
|
||||
/// by 'NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize'
|
||||
size_t scratchBufferSize;
|
||||
/// [in] use either 'pChipName' or 'pCounterDataImage', 'pChipName' will create the metrics evaluator based on a
|
||||
/// virtual device while 'pCounterDataImage' will create the metrics evaluator based on the actual device. If
|
||||
/// both are provided, 'pCounterDataImage' will be used
|
||||
const char* pChipName;
|
||||
/// [in]
|
||||
const uint8_t* pCounterDataImage;
|
||||
/// [in] must be provided if 'pCounterDataImage' is not NULL
|
||||
size_t counterDataImageSize;
|
||||
/// [out]
|
||||
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
||||
} NVPW_D3D12_MetricsEvaluator_Initialize_Params;
|
||||
#define NVPW_D3D12_MetricsEvaluator_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_MetricsEvaluator_Initialize_Params, pMetricsEvaluator)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_MetricsEvaluator_Initialize(NVPW_D3D12_MetricsEvaluator_Initialize_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_D3D12_HOST_H
|
||||
754
ruins64k/tools/NvPerf/include/nvperf_d3d12_target.h
Normal file
754
ruins64k/tools/NvPerf/include/nvperf_d3d12_target.h
Normal file
@@ -0,0 +1,754 @@
|
||||
#ifndef NVPERF_D3D12_TARGET_H
|
||||
#define NVPERF_D3D12_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_d3d12_target.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
// Device enumeration functions must be preceded by NVPA_<API>_LoadDriver(); any API is fine.
|
||||
|
||||
|
||||
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
/// GPU architecture support level
|
||||
typedef enum NVPW_GpuArchitectureSupportLevel
|
||||
{
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
||||
} NVPW_GpuArchitectureSupportLevel;
|
||||
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
/// SLI configuration support level
|
||||
typedef enum NVPW_SliSupportLevel
|
||||
{
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
/// Only Non-SLI configurations are supported.
|
||||
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
||||
} NVPW_SliSupportLevel;
|
||||
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
|
||||
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
||||
((pParams_)->structSize >= (const size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name External Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
struct ID3D12CommandQueue;
|
||||
struct ID3D12GraphicsCommandList;
|
||||
typedef struct _LUID LUID;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct NVPW_D3D12_LoadDriver_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_D3D12_LoadDriver_Params;
|
||||
#define NVPW_D3D12_LoadDriver_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_LoadDriver_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_LoadDriver(NVPW_D3D12_LoadDriver_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Device_GetDeviceIndex_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12Device* pDevice;
|
||||
/// [in]
|
||||
size_t sliIndex;
|
||||
/// [out]
|
||||
size_t deviceIndex;
|
||||
} NVPW_D3D12_Device_GetDeviceIndex_Params;
|
||||
#define NVPW_D3D12_Device_GetDeviceIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Device_GetDeviceIndex_Params, deviceIndex)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Device_GetDeviceIndex(NVPW_D3D12_Device_GetDeviceIndex_Params* pParams);
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_D3D12_GetLUID_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
LUID* luid;
|
||||
} NVPW_D3D12_GetLUID_Params;
|
||||
#define NVPW_D3D12_GetLUID_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_GetLUID_Params, luid)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_GetLUID(NVPW_D3D12_GetLUID_Params* pParams);
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Range Profiler
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CounterDataImageOptions
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// The CounterDataPrefix generated from e.g. NVPW_CounterDataBuilder_GetCounterDataPrefix(). Must be align(8).
|
||||
const uint8_t* pCounterDataPrefix;
|
||||
size_t counterDataPrefixSize;
|
||||
/// max number of ranges that can be specified
|
||||
uint32_t maxNumRanges;
|
||||
/// max number of RangeTree nodes; must be >= maxNumRanges
|
||||
uint32_t maxNumRangeTreeNodes;
|
||||
/// max string length of each RangeName, including the trailing NUL character
|
||||
uint32_t maxRangeNameLength;
|
||||
} NVPW_D3D12_Profiler_CounterDataImageOptions;
|
||||
#define NVPW_D3D12_Profiler_CounterDataImageOptions_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CounterDataImageOptions, maxRangeNameLength)
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CounterDataImage_CalculateSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_D3D12_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [out]
|
||||
size_t counterDataImageSize;
|
||||
} NVPW_D3D12_Profiler_CounterDataImage_CalculateSize_Params;
|
||||
#define NVPW_D3D12_Profiler_CounterDataImage_CalculateSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CounterDataImage_CalculateSize_Params, counterDataImageSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CounterDataImage_CalculateSize(NVPW_D3D12_Profiler_CounterDataImage_CalculateSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CounterDataImage_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_D3D12_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in] The buffer to be written.
|
||||
uint8_t* pCounterDataImage;
|
||||
} NVPW_D3D12_Profiler_CounterDataImage_Initialize_Params;
|
||||
#define NVPW_D3D12_Profiler_CounterDataImage_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CounterDataImage_Initialize_Params, pCounterDataImage)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CounterDataImage_Initialize(NVPW_D3D12_Profiler_CounterDataImage_Initialize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CounterDataImage_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [out]
|
||||
size_t counterDataScratchBufferSize;
|
||||
} NVPW_D3D12_Profiler_CounterDataImage_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_D3D12_Profiler_CounterDataImage_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CounterDataImage_CalculateScratchBufferSize_Params, counterDataScratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CounterDataImage_CalculateScratchBufferSize(NVPW_D3D12_Profiler_CounterDataImage_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CounterDataImage_InitializeScratchBuffer_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in] The scratch buffer to be written.
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
} NVPW_D3D12_Profiler_CounterDataImage_InitializeScratchBuffer_Params;
|
||||
#define NVPW_D3D12_Profiler_CounterDataImage_InitializeScratchBuffer_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CounterDataImage_InitializeScratchBuffer_Params, pCounterDataScratchBuffer)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CounterDataImage_InitializeScratchBuffer(NVPW_D3D12_Profiler_CounterDataImage_InitializeScratchBuffer_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CalcTraceBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] Maximum number of Push/Pop pairs that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] for sizing internal buffers
|
||||
size_t avgRangeNameLength;
|
||||
/// [out] TraceBuffer size for a single pass. Pass this to
|
||||
/// NVPW_D3D12_Profiler_BeginSession_Params::traceBufferSize.
|
||||
size_t traceBufferSize;
|
||||
} NVPW_D3D12_Profiler_CalcTraceBufferSize_Params;
|
||||
#define NVPW_D3D12_Profiler_CalcTraceBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CalcTraceBufferSize_Params, traceBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CalcTraceBufferSize(NVPW_D3D12_Profiler_CalcTraceBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_BeginSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in] Set to 1 if every pass is synchronized with CPU; for asynchronous collection, increase to
|
||||
/// (softwarePipelineDepth + 2).
|
||||
size_t numTraceBuffers;
|
||||
/// [in] Size of the per-pass TraceBuffer in bytes. The profiler allocates a numTraceBuffers * traceBufferSize
|
||||
/// internally.
|
||||
size_t traceBufferSize;
|
||||
/// [in] Maximum number of ranges that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] Maximum number of kernel launches that can be recorded in a single pass. Must be >= maxRangesPerPass.
|
||||
size_t maxLaunchesPerPass;
|
||||
} NVPW_D3D12_Profiler_Queue_BeginSession_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_BeginSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_BeginSession_Params, maxLaunchesPerPass)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_BeginSession(NVPW_D3D12_Profiler_Queue_BeginSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_EndSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in] Maximum number of milliseconds to wait for pending GPU operations. Pass 0xFFFFFFFF to wait forever
|
||||
uint32_t timeout;
|
||||
/// [out]
|
||||
NVPA_Bool timeoutExpired;
|
||||
} NVPW_D3D12_Profiler_Queue_EndSession_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_EndSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_EndSession_Params, timeoutExpired)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_EndSession(NVPW_D3D12_Profiler_Queue_EndSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Queue_ServicePendingGpuOperations_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in] The number of operations to process. Passing `0` will block until EndSession is called
|
||||
uint32_t numOperations;
|
||||
/// [in] Maximum number of milliseconds to wait for pending GPU operations. Pass 0xFFFFFFFF to wait forever
|
||||
uint32_t timeout;
|
||||
/// [out]
|
||||
NVPA_Bool timeoutExpired;
|
||||
} NVPW_D3D12_Queue_ServicePendingGpuOperations_Params;
|
||||
#define NVPW_D3D12_Queue_ServicePendingGpuOperations_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Queue_ServicePendingGpuOperations_Params, timeoutExpired)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Queue_ServicePendingGpuOperations(NVPW_D3D12_Queue_ServicePendingGpuOperations_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_SetConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in] Config created by e.g. NVPW_RawMetricsConfig_GetConfigImage(). Must be align(8).
|
||||
const uint8_t* pConfig;
|
||||
size_t configSize;
|
||||
/// [in] the lowest nesting level to be profiled; must be >= 1
|
||||
uint16_t minNestingLevel;
|
||||
/// [in] the number of nesting levels to profile; must be >= 1
|
||||
uint16_t numNestingLevels;
|
||||
/// [in] Set this to zero for in-app replay. Set this to the output of EndPass() for application replay.
|
||||
size_t passIndex;
|
||||
/// [in] Set this to minNestingLevel for in-app replay. Set this to the output of EndPass() for application
|
||||
/// replay.
|
||||
uint16_t targetNestingLevel;
|
||||
} NVPW_D3D12_Profiler_Queue_SetConfig_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_SetConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_SetConfig_Params, targetNestingLevel)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_SetConfig(NVPW_D3D12_Profiler_Queue_SetConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_ClearConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
} NVPW_D3D12_Profiler_Queue_ClearConfig_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_ClearConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_ClearConfig_Params, pCommandQueue)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_ClearConfig(NVPW_D3D12_Profiler_Queue_ClearConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_BeginPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
} NVPW_D3D12_Profiler_Queue_BeginPass_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_BeginPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_BeginPass_Params, pCommandQueue)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_BeginPass(NVPW_D3D12_Profiler_Queue_BeginPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_EndPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [out] The passIndex that will be collected by the *next* BeginPass.
|
||||
size_t passIndex;
|
||||
/// [out] The targetNestingLevel that will be collected by the *next* BeginPass.
|
||||
uint16_t targetNestingLevel;
|
||||
/// [out] becomes true when the last pass has been queued to the GPU
|
||||
NVPA_Bool allPassesSubmitted;
|
||||
} NVPW_D3D12_Profiler_Queue_EndPass_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_EndPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_EndPass_Params, allPassesSubmitted)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_EndPass(NVPW_D3D12_Profiler_Queue_EndPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_PushRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in] specifies the range that subsequent launches' counters will be assigned to; must not be NULL
|
||||
const char* pRangeName;
|
||||
/// [in] assign to strlen(pRangeName) if known; if set to zero, the library will call strlen()
|
||||
size_t rangeNameLength;
|
||||
} NVPW_D3D12_Profiler_Queue_PushRange_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_PushRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_PushRange_Params, rangeNameLength)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_PushRange(NVPW_D3D12_Profiler_Queue_PushRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_PopRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
} NVPW_D3D12_Profiler_Queue_PopRange_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_PopRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_PopRange_Params, pCommandQueue)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_PopRange(NVPW_D3D12_Profiler_Queue_PopRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CommandList_PushRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12GraphicsCommandList* pCommandList;
|
||||
/// [in] specifies the range that subsequent launches' counters will be assigned to; must not be NULL
|
||||
const char* pRangeName;
|
||||
/// [in] assign to strlen(pRangeName) if known; if set to zero, the library will call strlen()
|
||||
size_t rangeNameLength;
|
||||
} NVPW_D3D12_Profiler_CommandList_PushRange_Params;
|
||||
#define NVPW_D3D12_Profiler_CommandList_PushRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CommandList_PushRange_Params, rangeNameLength)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CommandList_PushRange(NVPW_D3D12_Profiler_CommandList_PushRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_CommandList_PopRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12GraphicsCommandList* pCommandList;
|
||||
} NVPW_D3D12_Profiler_CommandList_PopRange_Params;
|
||||
#define NVPW_D3D12_Profiler_CommandList_PopRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_CommandList_PopRange_Params, pCommandList)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_CommandList_PopRange(NVPW_D3D12_Profiler_CommandList_PopRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_DecodeCounters_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
/// [out] number of ranges whose data was dropped in the processed pass
|
||||
size_t numRangesDropped;
|
||||
/// [out] number of bytes not written to TraceBuffer due to buffer full
|
||||
size_t numTraceBytesDropped;
|
||||
/// [out] true if a pass was successfully decoded
|
||||
NVPA_Bool onePassCollected;
|
||||
/// [out] becomes true when the last pass has been decoded
|
||||
NVPA_Bool allPassesCollected;
|
||||
/// [out] the Config decoded by this call
|
||||
const uint8_t* pConfigDecoded;
|
||||
/// [out] the passIndex decoded
|
||||
size_t passIndexDecoded;
|
||||
} NVPW_D3D12_Profiler_Queue_DecodeCounters_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_DecodeCounters_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_DecodeCounters_Params, passIndexDecoded)
|
||||
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_DecodeCounters(NVPW_D3D12_Profiler_Queue_DecodeCounters_Params* pParams);
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_Queue_GetCounterAvailability_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct ID3D12CommandQueue* pCommandQueue;
|
||||
/// [in/out] If `pCounterAvailabilityImage` is NULL, then the required size is returned in
|
||||
/// `counterAvailabilityImageSize`, otherwise `counterAvailabilityImageSize` should be set to the size of
|
||||
/// `pCounterAvailabilityImage`, and on return it would be overwritten with number of actual bytes copied
|
||||
size_t counterAvailabilityImageSize;
|
||||
/// [in] buffer receiving counter availability image, may be NULL
|
||||
uint8_t* pCounterAvailabilityImage;
|
||||
} NVPW_D3D12_Profiler_Queue_GetCounterAvailability_Params;
|
||||
#define NVPW_D3D12_Profiler_Queue_GetCounterAvailability_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_Queue_GetCounterAvailability_Params, pCounterAvailabilityImage)
|
||||
|
||||
/// This API may fail, if any profiling or sampling session is active on the specified ID3D12CommandQueue or its
|
||||
/// device
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_Queue_GetCounterAvailability(NVPW_D3D12_Profiler_Queue_GetCounterAvailability_Params* pParams);
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_D3D12_Profiler_IsGpuSupported_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
NVPA_Bool isSupported;
|
||||
/// [out]
|
||||
NVPW_GpuArchitectureSupportLevel gpuArchitectureSupportLevel;
|
||||
/// [out]
|
||||
NVPW_SliSupportLevel sliSupportLevel;
|
||||
} NVPW_D3D12_Profiler_IsGpuSupported_Params;
|
||||
#define NVPW_D3D12_Profiler_IsGpuSupported_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_D3D12_Profiler_IsGpuSupported_Params, sliSupportLevel)
|
||||
|
||||
/// NVPW_D3D12_LoadDriver must be called prior to this API
|
||||
NVPA_Status NVAPI NVPW_D3D12_Profiler_IsGpuSupported(NVPW_D3D12_Profiler_IsGpuSupported_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_D3D12_TARGET_H
|
||||
277
ruins64k/tools/NvPerf/include/nvperf_device_host.h
Normal file
277
ruins64k/tools/NvPerf/include/nvperf_device_host.h
Normal file
@@ -0,0 +1,277 @@
|
||||
#ifndef NVPERF_DEVICE_HOST_H
|
||||
#define NVPERF_DEVICE_HOST_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_device_host.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_DEVICE_HOST_H
|
||||
309
ruins64k/tools/NvPerf/include/nvperf_device_target.h
Normal file
309
ruins64k/tools/NvPerf/include/nvperf_device_target.h
Normal file
@@ -0,0 +1,309 @@
|
||||
#ifndef NVPERF_DEVICE_TARGET_H
|
||||
#define NVPERF_DEVICE_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_device_target.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
// Device enumeration functions must be preceded by NVPA_<API>_LoadDriver(); any API is fine.
|
||||
|
||||
|
||||
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
/// GPU architecture support level
|
||||
typedef enum NVPW_GpuArchitectureSupportLevel
|
||||
{
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
||||
} NVPW_GpuArchitectureSupportLevel;
|
||||
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
/// SLI configuration support level
|
||||
typedef enum NVPW_SliSupportLevel
|
||||
{
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
/// Only Non-SLI configurations are supported.
|
||||
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
||||
} NVPW_SliSupportLevel;
|
||||
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
|
||||
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
||||
((pParams_)->structSize >= (const size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_DEVICE_TARGET_H
|
||||
1184
ruins64k/tools/NvPerf/include/nvperf_host.h
Normal file
1184
ruins64k/tools/NvPerf/include/nvperf_host.h
Normal file
File diff suppressed because it is too large
Load Diff
355
ruins64k/tools/NvPerf/include/nvperf_opengl_host.h
Normal file
355
ruins64k/tools/NvPerf/include/nvperf_opengl_host.h
Normal file
@@ -0,0 +1,355 @@
|
||||
#ifndef NVPERF_OPENGL_HOST_H
|
||||
#define NVPERF_OPENGL_HOST_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_opengl_host.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
/// 'NVPA_MetricsContext' and its APIs are deprecated, please use 'NVPW_MetricsEvaluator' and its APIs instead.
|
||||
typedef struct NVPA_MetricsContext NVPA_MetricsContext;
|
||||
|
||||
typedef struct NVPW_OpenGL_MetricsContext_Create_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out]
|
||||
struct NVPA_MetricsContext* pMetricsContext;
|
||||
} NVPW_OpenGL_MetricsContext_Create_Params;
|
||||
#define NVPW_OpenGL_MetricsContext_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_MetricsContext_Create_Params, pMetricsContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_MetricsContext_Create(NVPW_OpenGL_MetricsContext_Create_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_RawMetricsConfig_Create_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
NVPA_ActivityKind activityKind;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out] new NVPA_RawMetricsConfig object
|
||||
struct NVPA_RawMetricsConfig* pRawMetricsConfig;
|
||||
} NVPW_OpenGL_RawMetricsConfig_Create_Params;
|
||||
#define NVPW_OpenGL_RawMetricsConfig_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_RawMetricsConfig_Create_Params, pRawMetricsConfig)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_RawMetricsConfig_Create(NVPW_OpenGL_RawMetricsConfig_Create_Params* pParams);
|
||||
|
||||
typedef struct NVPW_MetricsEvaluator NVPW_MetricsEvaluator;
|
||||
|
||||
typedef struct NVPW_OpenGL_MetricsEvaluator_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out]
|
||||
size_t scratchBufferSize;
|
||||
} NVPW_OpenGL_MetricsEvaluator_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_OpenGL_MetricsEvaluator_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_MetricsEvaluator_CalculateScratchBufferSize_Params, scratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_MetricsEvaluator_CalculateScratchBufferSize(NVPW_OpenGL_MetricsEvaluator_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_MetricsEvaluator_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
uint8_t* pScratchBuffer;
|
||||
/// [in] the size of the 'pScratchBuffer' array, should be at least the size of the 'scratchBufferSize' returned
|
||||
/// by 'NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize'
|
||||
size_t scratchBufferSize;
|
||||
/// [in] use either 'pChipName' or 'pCounterDataImage', 'pChipName' will create the metrics evaluator based on a
|
||||
/// virtual device while 'pCounterDataImage' will create the metrics evaluator based on the actual device. If
|
||||
/// both are provided, 'pCounterDataImage' will be used
|
||||
const char* pChipName;
|
||||
/// [in]
|
||||
const uint8_t* pCounterDataImage;
|
||||
/// [in] must be provided if 'pCounterDataImage' is not NULL
|
||||
size_t counterDataImageSize;
|
||||
/// [out]
|
||||
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
||||
} NVPW_OpenGL_MetricsEvaluator_Initialize_Params;
|
||||
#define NVPW_OpenGL_MetricsEvaluator_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_MetricsEvaluator_Initialize_Params, pMetricsEvaluator)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_MetricsEvaluator_Initialize(NVPW_OpenGL_MetricsEvaluator_Initialize_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_OPENGL_HOST_H
|
||||
652
ruins64k/tools/NvPerf/include/nvperf_opengl_target.h
Normal file
652
ruins64k/tools/NvPerf/include/nvperf_opengl_target.h
Normal file
@@ -0,0 +1,652 @@
|
||||
#ifndef NVPERF_OPENGL_TARGET_H
|
||||
#define NVPERF_OPENGL_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_opengl_target.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
// Device enumeration functions must be preceded by NVPA_<API>_LoadDriver(); any API is fine.
|
||||
|
||||
|
||||
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
/// GPU architecture support level
|
||||
typedef enum NVPW_GpuArchitectureSupportLevel
|
||||
{
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
||||
} NVPW_GpuArchitectureSupportLevel;
|
||||
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
/// SLI configuration support level
|
||||
typedef enum NVPW_SliSupportLevel
|
||||
{
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
/// Only Non-SLI configurations are supported.
|
||||
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
||||
} NVPW_SliSupportLevel;
|
||||
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
|
||||
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
||||
((pParams_)->structSize >= (const size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name External Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
struct NVPW_OpenGL_GraphicsContext;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_OpenGL_LoadDriver_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_OpenGL_LoadDriver_Params;
|
||||
#define NVPW_OpenGL_LoadDriver_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_LoadDriver_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_LoadDriver(NVPW_OpenGL_LoadDriver_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_GetCurrentGraphicsContext_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [out]
|
||||
struct NVPW_OpenGL_GraphicsContext* pGraphicsContext;
|
||||
} NVPW_OpenGL_GetCurrentGraphicsContext_Params;
|
||||
#define NVPW_OpenGL_GetCurrentGraphicsContext_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_GetCurrentGraphicsContext_Params, pGraphicsContext)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_GetCurrentGraphicsContext(NVPW_OpenGL_GetCurrentGraphicsContext_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_GraphicsContext_GetDeviceIndex_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t sliIndex;
|
||||
/// [out]
|
||||
size_t deviceIndex;
|
||||
} NVPW_OpenGL_GraphicsContext_GetDeviceIndex_Params;
|
||||
#define NVPW_OpenGL_GraphicsContext_GetDeviceIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_GraphicsContext_GetDeviceIndex_Params, deviceIndex)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_GraphicsContext_GetDeviceIndex(NVPW_OpenGL_GraphicsContext_GetDeviceIndex_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_IsGpuSupported_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
NVPA_Bool isSupported;
|
||||
/// [out]
|
||||
NVPW_GpuArchitectureSupportLevel gpuArchitectureSupportLevel;
|
||||
/// [out]
|
||||
NVPW_SliSupportLevel sliSupportLevel;
|
||||
} NVPW_OpenGL_Profiler_IsGpuSupported_Params;
|
||||
#define NVPW_OpenGL_Profiler_IsGpuSupported_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_IsGpuSupported_Params, sliSupportLevel)
|
||||
|
||||
/// NVPW_OpenGL_LoadDriver must be called prior to this API
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_IsGpuSupported(NVPW_OpenGL_Profiler_IsGpuSupported_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_CounterDataImageOptions
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// The CounterDataPrefix generated from e.g. NVPW_CounterDataBuilder_GetCounterDataPrefix(). Must be align(8).
|
||||
const uint8_t* pCounterDataPrefix;
|
||||
size_t counterDataPrefixSize;
|
||||
/// max number of ranges that can be specified
|
||||
uint32_t maxNumRanges;
|
||||
/// max number of RangeTree nodes; must be >= maxNumRanges
|
||||
uint32_t maxNumRangeTreeNodes;
|
||||
/// max string length of each RangeName, including the trailing NUL character
|
||||
uint32_t maxRangeNameLength;
|
||||
} NVPW_OpenGL_Profiler_CounterDataImageOptions;
|
||||
#define NVPW_OpenGL_Profiler_CounterDataImageOptions_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_CounterDataImageOptions, maxRangeNameLength)
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_CounterDataImage_CalculateSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_OpenGL_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [out]
|
||||
size_t counterDataImageSize;
|
||||
} NVPW_OpenGL_Profiler_CounterDataImage_CalculateSize_Params;
|
||||
#define NVPW_OpenGL_Profiler_CounterDataImage_CalculateSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_CounterDataImage_CalculateSize_Params, counterDataImageSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_CounterDataImage_CalculateSize(NVPW_OpenGL_Profiler_CounterDataImage_CalculateSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_CounterDataImage_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_OpenGL_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in] The buffer to be written.
|
||||
uint8_t* pCounterDataImage;
|
||||
} NVPW_OpenGL_Profiler_CounterDataImage_Initialize_Params;
|
||||
#define NVPW_OpenGL_Profiler_CounterDataImage_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_CounterDataImage_Initialize_Params, pCounterDataImage)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_CounterDataImage_Initialize(NVPW_OpenGL_Profiler_CounterDataImage_Initialize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_CounterDataImage_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [out]
|
||||
size_t counterDataScratchBufferSize;
|
||||
} NVPW_OpenGL_Profiler_CounterDataImage_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_OpenGL_Profiler_CounterDataImage_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_CounterDataImage_CalculateScratchBufferSize_Params, counterDataScratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_CounterDataImage_CalculateScratchBufferSize(NVPW_OpenGL_Profiler_CounterDataImage_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_CounterDataImage_InitializeScratchBuffer_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in] The scratch buffer to be written.
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
} NVPW_OpenGL_Profiler_CounterDataImage_InitializeScratchBuffer_Params;
|
||||
#define NVPW_OpenGL_Profiler_CounterDataImage_InitializeScratchBuffer_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_CounterDataImage_InitializeScratchBuffer_Params, pCounterDataScratchBuffer)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_CounterDataImage_InitializeScratchBuffer(NVPW_OpenGL_Profiler_CounterDataImage_InitializeScratchBuffer_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_CalcTraceBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] Maximum number of Push/Pop pairs that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] for sizing internal buffers
|
||||
size_t avgRangeNameLength;
|
||||
/// [out] TraceBuffer size for a single pass. Pass this to
|
||||
/// NVPW_OpenGL_Profiler_BeginSession_Params::traceBufferSize.
|
||||
size_t traceBufferSize;
|
||||
} NVPW_OpenGL_Profiler_CalcTraceBufferSize_Params;
|
||||
#define NVPW_OpenGL_Profiler_CalcTraceBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_CalcTraceBufferSize_Params, traceBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_CalcTraceBufferSize(NVPW_OpenGL_Profiler_CalcTraceBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_BeginSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] Set to 1 if every pass is synchronized with CPU; for asynchronous collection, increase to
|
||||
/// (softwarePipelineDepth + 2).
|
||||
size_t numTraceBuffers;
|
||||
/// [in] Size of the per-pass TraceBuffer in bytes. The profiler allocates a numTraceBuffers * traceBufferSize
|
||||
/// internally.
|
||||
size_t traceBufferSize;
|
||||
/// [in] Maximum number of ranges that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] Maximum number of kernel launches that can be recorded in a single pass. Must be >= maxRangesPerPass.
|
||||
size_t maxLaunchesPerPass;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_BeginSession_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_BeginSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_BeginSession_Params, maxLaunchesPerPass)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_BeginSession(NVPW_OpenGL_Profiler_GraphicsContext_BeginSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_EndSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_EndSession_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_EndSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_EndSession_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_EndSession(NVPW_OpenGL_Profiler_GraphicsContext_EndSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_SetConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] Config created by e.g. NVPW_RawMetricsConfig_GetConfigImage(). Must be align(8).
|
||||
const uint8_t* pConfig;
|
||||
size_t configSize;
|
||||
/// [in] the lowest nesting level to be profiled; must be >= 1
|
||||
uint16_t minNestingLevel;
|
||||
/// [in] the number of nesting levels to profile; must be >= 1
|
||||
uint16_t numNestingLevels;
|
||||
/// [in] Set this to zero for in-app replay. Set this to the output of EndPass() for application replay.
|
||||
size_t passIndex;
|
||||
/// [in] Set this to minNestingLevel for in-app replay. Set this to the output of EndPass() for application
|
||||
/// replay.
|
||||
uint16_t targetNestingLevel;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_SetConfig_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_SetConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_SetConfig_Params, targetNestingLevel)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_SetConfig(NVPW_OpenGL_Profiler_GraphicsContext_SetConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_ClearConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_ClearConfig_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_ClearConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_ClearConfig_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_ClearConfig(NVPW_OpenGL_Profiler_GraphicsContext_ClearConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_BeginPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_BeginPass_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_BeginPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_BeginPass_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_BeginPass(NVPW_OpenGL_Profiler_GraphicsContext_BeginPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_EndPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_EndPass_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_EndPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_EndPass_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_EndPass(NVPW_OpenGL_Profiler_GraphicsContext_EndPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_PushRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] specifies the range that subsequent launches' counters will be assigned to; must not be NULL
|
||||
const char* pRangeName;
|
||||
/// [in] assign to strlen(pRangeName) if known; if set to zero, the library will call strlen()
|
||||
size_t rangeNameLength;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_PushRange_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_PushRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_PushRange_Params, rangeNameLength)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_PushRange(NVPW_OpenGL_Profiler_GraphicsContext_PushRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_PopRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_PopRange_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_PopRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_PopRange_Params, pPriv)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_PopRange(NVPW_OpenGL_Profiler_GraphicsContext_PopRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct NVPW_OpenGL_GraphicsContext* pGraphicsContext;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
/// [out] number of ranges whose data was dropped in the processed pass
|
||||
size_t numRangesDropped;
|
||||
/// [out] number of bytes not written to TraceBuffer due to buffer full
|
||||
size_t numTraceBytesDropped;
|
||||
/// [out] true if a pass was successfully decoded
|
||||
NVPA_Bool onePassCollected;
|
||||
/// [out] becomes true when the last pass has been decoded
|
||||
NVPA_Bool allPassesCollected;
|
||||
/// [out] the Config decoded by this call
|
||||
const uint8_t* pConfigDecoded;
|
||||
/// [out] the passIndex decoded
|
||||
size_t passIndexDecoded;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params, passIndexDecoded)
|
||||
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters(NVPW_OpenGL_Profiler_GraphicsContext_DecodeCounters_Params* pParams);
|
||||
|
||||
typedef struct NVPW_OpenGL_Profiler_GraphicsContext_GetCounterAvailability_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in/out] If `pCounterAvailabilityImage` is NULL, then the required size is returned in
|
||||
/// `counterAvailabilityImageSize`, otherwise `counterAvailabilityImageSize` should be set to the size of
|
||||
/// `pCounterAvailabilityImage`, and on return it would be overwritten with number of actual bytes copied
|
||||
size_t counterAvailabilityImageSize;
|
||||
/// [in] buffer receiving counter availability image, may be NULL
|
||||
uint8_t* pCounterAvailabilityImage;
|
||||
} NVPW_OpenGL_Profiler_GraphicsContext_GetCounterAvailability_Params;
|
||||
#define NVPW_OpenGL_Profiler_GraphicsContext_GetCounterAvailability_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_OpenGL_Profiler_GraphicsContext_GetCounterAvailability_Params, pCounterAvailabilityImage)
|
||||
|
||||
/// This API may fail, if any profiling or sampling session is active on the device
|
||||
NVPA_Status NVAPI NVPW_OpenGL_Profiler_GraphicsContext_GetCounterAvailability(NVPW_OpenGL_Profiler_GraphicsContext_GetCounterAvailability_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_OPENGL_TARGET_H
|
||||
593
ruins64k/tools/NvPerf/include/nvperf_target.h
Normal file
593
ruins64k/tools/NvPerf/include/nvperf_target.h
Normal file
@@ -0,0 +1,593 @@
|
||||
#ifndef NVPERF_TARGET_H
|
||||
#define NVPERF_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_target.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
// Device enumeration functions must be preceded by NVPA_<API>_LoadDriver(); any API is fine.
|
||||
|
||||
|
||||
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
/// GPU architecture support level
|
||||
typedef enum NVPW_GpuArchitectureSupportLevel
|
||||
{
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
||||
} NVPW_GpuArchitectureSupportLevel;
|
||||
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
/// SLI configuration support level
|
||||
typedef enum NVPW_SliSupportLevel
|
||||
{
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
/// Only Non-SLI configurations are supported.
|
||||
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
||||
} NVPW_SliSupportLevel;
|
||||
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
|
||||
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
||||
((pParams_)->structSize >= (const size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
||||
|
||||
|
||||
typedef struct NVPW_InitializeTarget_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
} NVPW_InitializeTarget_Params;
|
||||
#define NVPW_InitializeTarget_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_InitializeTarget_Params, pPriv)
|
||||
|
||||
/// Load the target library.
|
||||
NVPA_Status NVAPI NVPW_InitializeTarget(NVPW_InitializeTarget_Params* pParams);
|
||||
|
||||
typedef struct NVPW_GetDeviceCount_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
size_t numDevices;
|
||||
} NVPW_GetDeviceCount_Params;
|
||||
#define NVPW_GetDeviceCount_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_GetDeviceCount_Params, numDevices)
|
||||
|
||||
NVPA_Status NVAPI NVPW_GetDeviceCount(NVPW_GetDeviceCount_Params* pParams);
|
||||
|
||||
typedef struct NVPW_Device_GetNames_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
size_t deviceIndex;
|
||||
const char* pDeviceName;
|
||||
const char* pChipName;
|
||||
} NVPW_Device_GetNames_Params;
|
||||
#define NVPW_Device_GetNames_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetNames_Params, pChipName)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Device_GetNames(NVPW_Device_GetNames_Params* pParams);
|
||||
|
||||
typedef struct NVPW_PciBusId
|
||||
{
|
||||
/// The PCI domain on which the device bus resides.
|
||||
uint32_t domain;
|
||||
/// The bus on which the device resides.
|
||||
uint16_t bus;
|
||||
/// device ID.
|
||||
uint16_t device;
|
||||
} NVPW_PciBusId;
|
||||
#define NVPW_PciBusId_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PciBusId, device)
|
||||
|
||||
typedef struct NVPW_Device_GetPciBusIds_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] caller-allocated array of NVPW_PciBusId, indexed by NVPW deviceIndex
|
||||
NVPW_PciBusId* pBusIds;
|
||||
/// [in] size of the pBusIDs array; use result from NVPW_GetDeviceCount
|
||||
size_t numDevices;
|
||||
} NVPW_Device_GetPciBusIds_Params;
|
||||
#define NVPW_Device_GetPciBusIds_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetPciBusIds_Params, numDevices)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Device_GetPciBusIds(NVPW_Device_GetPciBusIds_Params* pParams);
|
||||
|
||||
|
||||
#define NVPW_DEVICE_MIG_GPU_INSTANCE_ID_INVALID 0xFFFFFFFFu
|
||||
#define NVPW_DEVICE_MIG_GPU_INSTANCE_ID_FULLCHIP 0xFFFFFFFEu
|
||||
|
||||
|
||||
typedef struct NVPW_Device_GetMigAttributes_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
NVPA_Bool isMigPartition;
|
||||
/// [out]
|
||||
uint32_t gpuInstanceId;
|
||||
/// [out]
|
||||
uint32_t computeInstanceId;
|
||||
} NVPW_Device_GetMigAttributes_Params;
|
||||
#define NVPW_Device_GetMigAttributes_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetMigAttributes_Params, computeInstanceId)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Device_GetMigAttributes(NVPW_Device_GetMigAttributes_Params* pParams);
|
||||
|
||||
typedef struct NVPW_Adapter_GetDeviceIndex_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
struct IDXGIAdapter* pAdapter;
|
||||
/// [in]
|
||||
size_t sliIndex;
|
||||
/// [out]
|
||||
size_t deviceIndex;
|
||||
} NVPW_Adapter_GetDeviceIndex_Params;
|
||||
#define NVPW_Adapter_GetDeviceIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Adapter_GetDeviceIndex_Params, deviceIndex)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Adapter_GetDeviceIndex(NVPW_Adapter_GetDeviceIndex_Params* pParams);
|
||||
|
||||
typedef struct NVPW_CounterData_GetNumRanges_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
const uint8_t* pCounterDataImage;
|
||||
size_t numRanges;
|
||||
} NVPW_CounterData_GetNumRanges_Params;
|
||||
#define NVPW_CounterData_GetNumRanges_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_GetNumRanges_Params, numRanges)
|
||||
|
||||
NVPA_Status NVAPI NVPW_CounterData_GetNumRanges(NVPW_CounterData_GetNumRanges_Params* pParams);
|
||||
|
||||
typedef struct NVPW_CounterData_GetChipName_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [out]
|
||||
const char* pChipName;
|
||||
} NVPW_CounterData_GetChipName_Params;
|
||||
#define NVPW_CounterData_GetChipName_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_GetChipName_Params, pChipName)
|
||||
|
||||
NVPA_Status NVAPI NVPW_CounterData_GetChipName(NVPW_CounterData_GetChipName_Params* pParams);
|
||||
|
||||
typedef struct NVPW_Config_GetNumPasses_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const uint8_t* pConfig;
|
||||
/// [out]
|
||||
size_t numPipelinedPasses;
|
||||
/// [out]
|
||||
size_t numIsolatedPasses;
|
||||
} NVPW_Config_GetNumPasses_Params;
|
||||
#define NVPW_Config_GetNumPasses_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Config_GetNumPasses_Params, numIsolatedPasses)
|
||||
|
||||
/// Total num passes = numPipelinedPasses + numIsolatedPasses * numNestingLevels
|
||||
NVPA_Status NVAPI NVPW_Config_GetNumPasses(NVPW_Config_GetNumPasses_Params* pParams);
|
||||
|
||||
#define NVPW_API_SET_D3D11_PROFILER 0xca55c6738445db2bULL
|
||||
|
||||
#define NVPW_API_SET_D3D12_PROFILER 0xc0c2d46dd7c7ad78ULL
|
||||
|
||||
#define NVPW_API_SET_METRICSEVALUATOR 0x0368a8768d811af9ULL
|
||||
|
||||
#define NVPW_API_SET_METRICS_GA10X_GRFX 0x6ebc121178b5ce0bULL
|
||||
|
||||
#define NVPW_API_SET_METRICS_GV100_GRFX 0x9900da75d164fecfULL
|
||||
|
||||
#define NVPW_API_SET_METRICS_GV11B_GRFX 0xeb8e26220106e227ULL
|
||||
|
||||
#define NVPW_API_SET_METRICS_TU10X_GRFX 0xdf219cb838db6968ULL
|
||||
|
||||
#define NVPW_API_SET_METRICS_TU11X_GRFX 0x0977d9342bd62743ULL
|
||||
|
||||
#define NVPW_API_SET_OPENGL_PROFILER 0xe4cd9ea40f2ee777ULL
|
||||
|
||||
#define NVPW_API_SET_VULKAN_PROFILER 0x8c56b6a03d779689ULL
|
||||
|
||||
typedef struct NVPW_QueryVersionNumber_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
uint64_t apiSet;
|
||||
/// [out]
|
||||
uint32_t major;
|
||||
/// [out]
|
||||
uint32_t minor;
|
||||
/// [out]
|
||||
uint32_t patch;
|
||||
/// [out]
|
||||
uint32_t relMajor;
|
||||
/// [out]
|
||||
uint32_t relMinor;
|
||||
/// [out]
|
||||
uint32_t relPatch;
|
||||
} NVPW_QueryVersionNumber_Params;
|
||||
#define NVPW_QueryVersionNumber_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_QueryVersionNumber_Params, relPatch)
|
||||
|
||||
/// Query version number of an API set
|
||||
NVPA_Status NVAPI NVPW_QueryVersionNumber(NVPW_QueryVersionNumber_Params* pParams);
|
||||
|
||||
typedef enum NVPW_Device_ClockStatus
|
||||
{
|
||||
/// clock status is unknown
|
||||
NVPW_DEVICE_CLOCK_STATUS_UNKNOWN,
|
||||
/// clocks are locked to rated tdp values
|
||||
NVPW_DEVICE_CLOCK_STATUS_LOCKED_TO_RATED_TDP,
|
||||
/// clocks are not locked and can boost above rated tdp
|
||||
NVPW_DEVICE_CLOCK_STATUS_BOOST_ENABLED,
|
||||
/// clocks are not locked and will not go above rated tdp
|
||||
NVPW_DEVICE_CLOCK_STATUS_BOOST_DISABLED,
|
||||
NVPW_DEVICE_CLOCK_STATUS__COUNT
|
||||
} NVPW_Device_ClockStatus;
|
||||
|
||||
typedef struct NVPW_Device_GetClockStatus_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
size_t deviceIndex;
|
||||
/// [in]
|
||||
NVPW_Device_ClockStatus clockStatus;
|
||||
} NVPW_Device_GetClockStatus_Params;
|
||||
#define NVPW_Device_GetClockStatus_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetClockStatus_Params, clockStatus)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Device_GetClockStatus(NVPW_Device_GetClockStatus_Params* pParams);
|
||||
|
||||
typedef enum NVPW_Device_ClockSetting
|
||||
{
|
||||
/// invalid op, specify valid clocks operation during profiling
|
||||
NVPW_DEVICE_CLOCK_SETTING_INVALID,
|
||||
/// default to driver/application config (normally unlocked and not boosted, but could be unlocked boosted, or
|
||||
/// locked to rated TDP)
|
||||
NVPW_DEVICE_CLOCK_SETTING_DEFAULT,
|
||||
/// lock clocks at rated tdp base values
|
||||
NVPW_DEVICE_CLOCK_SETTING_LOCK_TO_RATED_TDP,
|
||||
NVPW_DEVICE_CLOCK_SETTING__COUNT
|
||||
} NVPW_Device_ClockSetting;
|
||||
|
||||
typedef struct NVPW_Device_SetClockSetting_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
size_t deviceIndex;
|
||||
/// [in]
|
||||
NVPW_Device_ClockSetting clockSetting;
|
||||
} NVPW_Device_SetClockSetting_Params;
|
||||
#define NVPW_Device_SetClockSetting_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_SetClockSetting_Params, clockSetting)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Device_SetClockSetting(NVPW_Device_SetClockSetting_Params* pParams);
|
||||
|
||||
typedef struct NVPW_CounterData_GetRangeDescriptions_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
const uint8_t* pCounterDataImage;
|
||||
size_t rangeIndex;
|
||||
/// [inout] Number of descriptions allocated in ppDescriptions
|
||||
size_t numDescriptions;
|
||||
const char** ppDescriptions;
|
||||
} NVPW_CounterData_GetRangeDescriptions_Params;
|
||||
#define NVPW_CounterData_GetRangeDescriptions_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_GetRangeDescriptions_Params, ppDescriptions)
|
||||
|
||||
NVPA_Status NVAPI NVPW_CounterData_GetRangeDescriptions(NVPW_CounterData_GetRangeDescriptions_Params* pParams);
|
||||
|
||||
typedef struct NVPW_Profiler_CounterData_GetRangeDescriptions_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
const uint8_t* pCounterDataImage;
|
||||
size_t rangeIndex;
|
||||
/// [inout] Number of descriptions allocated in ppDescriptions
|
||||
size_t numDescriptions;
|
||||
const char** ppDescriptions;
|
||||
} NVPW_Profiler_CounterData_GetRangeDescriptions_Params;
|
||||
#define NVPW_Profiler_CounterData_GetRangeDescriptions_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Profiler_CounterData_GetRangeDescriptions_Params, ppDescriptions)
|
||||
|
||||
NVPA_Status NVAPI NVPW_Profiler_CounterData_GetRangeDescriptions(NVPW_Profiler_CounterData_GetRangeDescriptions_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_TARGET_H
|
||||
163
ruins64k/tools/NvPerf/include/nvperf_versions_target.h
Normal file
163
ruins64k/tools/NvPerf/include/nvperf_versions_target.h
Normal file
@@ -0,0 +1,163 @@
|
||||
#ifndef NVPERF_VERSIONS_TARGET_H
|
||||
#define NVPERF_VERSIONS_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_versions_target.h
|
||||
*/
|
||||
|
||||
/// D3D11_PROFILER versions
|
||||
#define NVPW_D3D11_PROFILER_VERSION_MAJOR 0
|
||||
#define NVPW_D3D11_PROFILER_VERSION_MINOR 1
|
||||
#define NVPW_D3D11_PROFILER_VERSION_PATCH 0
|
||||
|
||||
/// D3D12_PROFILER versions
|
||||
#define NVPW_D3D12_PROFILER_VERSION_MAJOR 0
|
||||
#define NVPW_D3D12_PROFILER_VERSION_MINOR 1
|
||||
#define NVPW_D3D12_PROFILER_VERSION_PATCH 0
|
||||
|
||||
/// METRICSEVALUATOR versions
|
||||
#define NVPW_METRICSEVALUATOR_VERSION_MAJOR 0
|
||||
#define NVPW_METRICSEVALUATOR_VERSION_MINOR 1
|
||||
#define NVPW_METRICSEVALUATOR_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_GA10X_GRFX versions
|
||||
#define NVPW_METRICS_GA10X_GRFX_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_GA10X_GRFX_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_GA10X_GRFX_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_GV100_GRFX versions
|
||||
#define NVPW_METRICS_GV100_GRFX_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_GV100_GRFX_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_GV100_GRFX_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_TU10X_GRFX versions
|
||||
#define NVPW_METRICS_TU10X_GRFX_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_TU10X_GRFX_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_TU10X_GRFX_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_TU11X_GRFX versions
|
||||
#define NVPW_METRICS_TU11X_GRFX_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_TU11X_GRFX_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_TU11X_GRFX_VERSION_PATCH 0
|
||||
|
||||
/// OPENGL_PROFILER versions
|
||||
#define NVPW_OPENGL_PROFILER_VERSION_MAJOR 0
|
||||
#define NVPW_OPENGL_PROFILER_VERSION_MINOR 1
|
||||
#define NVPW_OPENGL_PROFILER_VERSION_PATCH 0
|
||||
|
||||
/// VULKAN_PROFILER versions
|
||||
#define NVPW_VULKAN_PROFILER_VERSION_MAJOR 0
|
||||
#define NVPW_VULKAN_PROFILER_VERSION_MINOR 1
|
||||
#define NVPW_VULKAN_PROFILER_VERSION_PATCH 0
|
||||
|
||||
/// D3D11_PROFILER versions
|
||||
#define NVPW_D3D11_PROFILER_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_D3D11_PROFILER_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_D3D11_PROFILER_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// D3D12_PROFILER versions
|
||||
#define NVPW_D3D12_PROFILER_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_D3D12_PROFILER_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_D3D12_PROFILER_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// METRICSEVALUATOR versions
|
||||
#define NVPW_METRICSEVALUATOR_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_METRICSEVALUATOR_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_METRICSEVALUATOR_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_GA10X_GRFX versions
|
||||
#define NVPW_METRICS_GA10X_GRFX_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_GA10X_GRFX_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_GA10X_GRFX_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_GV100_GRFX versions
|
||||
#define NVPW_METRICS_GV100_GRFX_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_GV100_GRFX_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_GV100_GRFX_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_TU10X_GRFX versions
|
||||
#define NVPW_METRICS_TU10X_GRFX_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_TU10X_GRFX_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_TU10X_GRFX_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// METRICS_TU11X_GRFX versions
|
||||
#define NVPW_METRICS_TU11X_GRFX_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_METRICS_TU11X_GRFX_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_METRICS_TU11X_GRFX_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// OPENGL_PROFILER versions
|
||||
#define NVPW_OPENGL_PROFILER_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_OPENGL_PROFILER_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_OPENGL_PROFILER_RELEASE_VERSION_PATCH 0
|
||||
|
||||
/// VULKAN_PROFILER versions
|
||||
#define NVPW_VULKAN_PROFILER_RELEASE_VERSION_MAJOR 0
|
||||
#define NVPW_VULKAN_PROFILER_RELEASE_VERSION_MINOR 1
|
||||
#define NVPW_VULKAN_PROFILER_RELEASE_VERSION_PATCH 0
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_VERSIONS_TARGET_H
|
||||
337
ruins64k/tools/NvPerf/include/nvperf_vulkan_host.h
Normal file
337
ruins64k/tools/NvPerf/include/nvperf_vulkan_host.h
Normal file
@@ -0,0 +1,337 @@
|
||||
#ifndef NVPERF_VULKAN_HOST_H
|
||||
#define NVPERF_VULKAN_HOST_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_vulkan_host.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_VK_RawMetricsConfig_Create_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
NVPA_ActivityKind activityKind;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out] new NVPA_RawMetricsConfig object
|
||||
struct NVPA_RawMetricsConfig* pRawMetricsConfig;
|
||||
} NVPW_VK_RawMetricsConfig_Create_Params;
|
||||
#define NVPW_VK_RawMetricsConfig_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_RawMetricsConfig_Create_Params, pRawMetricsConfig)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_RawMetricsConfig_Create(NVPW_VK_RawMetricsConfig_Create_Params* pParams);
|
||||
|
||||
typedef struct NVPW_MetricsEvaluator NVPW_MetricsEvaluator;
|
||||
|
||||
typedef struct NVPW_VK_MetricsEvaluator_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
const char* pChipName;
|
||||
/// [out]
|
||||
size_t scratchBufferSize;
|
||||
} NVPW_VK_MetricsEvaluator_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_VK_MetricsEvaluator_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_MetricsEvaluator_CalculateScratchBufferSize_Params, scratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_MetricsEvaluator_CalculateScratchBufferSize(NVPW_VK_MetricsEvaluator_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_MetricsEvaluator_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
uint8_t* pScratchBuffer;
|
||||
/// [in] the size of the 'pScratchBuffer' array, should be at least the size of the 'scratchBufferSize' returned
|
||||
/// by 'NVPW_D3D12_MetricsEvaluator_CalculateScratchBufferSize'
|
||||
size_t scratchBufferSize;
|
||||
/// [in] use either 'pChipName' or 'pCounterDataImage', 'pChipName' will create the metrics evaluator based on a
|
||||
/// virtual device while 'pCounterDataImage' will create the metrics evaluator based on the actual device. If
|
||||
/// both are provided, 'pCounterDataImage' will be used
|
||||
const char* pChipName;
|
||||
/// [in]
|
||||
const uint8_t* pCounterDataImage;
|
||||
/// [in] must be provided if 'pCounterDataImage' is not NULL
|
||||
size_t counterDataImageSize;
|
||||
/// [out]
|
||||
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
||||
} NVPW_VK_MetricsEvaluator_Initialize_Params;
|
||||
#define NVPW_VK_MetricsEvaluator_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_MetricsEvaluator_Initialize_Params, pMetricsEvaluator)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_MetricsEvaluator_Initialize(NVPW_VK_MetricsEvaluator_Initialize_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_VULKAN_HOST_H
|
||||
775
ruins64k/tools/NvPerf/include/nvperf_vulkan_target.h
Normal file
775
ruins64k/tools/NvPerf/include/nvperf_vulkan_target.h
Normal file
@@ -0,0 +1,775 @@
|
||||
#ifndef NVPERF_VULKAN_TARGET_H
|
||||
#define NVPERF_VULKAN_TARGET_H
|
||||
|
||||
/*
|
||||
* Copyright 2014-2021 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* NOTICE TO USER:
|
||||
*
|
||||
* This source code is subject to NVIDIA ownership rights under U.S. and
|
||||
* international Copyright laws.
|
||||
*
|
||||
* This software and the information contained herein is PROPRIETARY and
|
||||
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
||||
* of a form of NVIDIA software license agreement.
|
||||
*
|
||||
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
||||
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
||||
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||
* OR PERFORMANCE OF THIS SOURCE CODE.
|
||||
*
|
||||
* U.S. Government End Users. This source code is a "commercial item" as
|
||||
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
||||
* "commercial computer software" and "commercial computer software
|
||||
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
||||
* and is provided to the U.S. Government only as a commercial end item.
|
||||
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
||||
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
||||
* source code with only those rights set forth herein.
|
||||
*
|
||||
* Any use of this source code in individual and commercial software must
|
||||
* include, in the user documentation and internal comments to the code,
|
||||
* the above Disclaimer and U.S. Government End Users Notice.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility push(default)
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
||||
#endif
|
||||
#else
|
||||
#if !defined(NVPW_LOCAL)
|
||||
#define NVPW_LOCAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file nvperf_vulkan_target.h
|
||||
*/
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name Common Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
||||
#define NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
/// Error codes.
|
||||
typedef enum NVPA_Status
|
||||
{
|
||||
/// Success
|
||||
NVPA_STATUS_SUCCESS = 0,
|
||||
/// Generic error.
|
||||
NVPA_STATUS_ERROR = 1,
|
||||
/// Internal error. Please file a bug!
|
||||
NVPA_STATUS_INTERNAL_ERROR = 2,
|
||||
/// NVPW_InitializeTarget() has not been called yet.
|
||||
NVPA_STATUS_NOT_INITIALIZED = 3,
|
||||
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*.
|
||||
NVPA_STATUS_NOT_LOADED = 4,
|
||||
/// The function was not found in this version of the NvPerf DLL/DSO.
|
||||
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
||||
/// The request was intentionally not supported.
|
||||
NVPA_STATUS_NOT_SUPPORTED = 6,
|
||||
/// The request was not implemented by this version.
|
||||
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
||||
/// Invalid argument.
|
||||
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
||||
/// No driver has been loaded via NVPW_*_LoadDriver().
|
||||
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
||||
/// Failed memory allocation.
|
||||
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
||||
/// The specified GPU is not supported.
|
||||
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
||||
/// The installed NVIDIA driver is too old.
|
||||
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
||||
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
||||
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
||||
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
||||
/// The request could not be fulfilled because a system resource is already in use.
|
||||
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
||||
/// The provided buffer is not large enough.
|
||||
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
||||
/// UNUSED
|
||||
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
||||
/// Virtualized GPU (vGPU) is not supported.
|
||||
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
||||
/// Profiling permission on a vGPU was not granted.
|
||||
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
||||
NVPA_STATUS__COUNT
|
||||
} NVPA_Status;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_STATUS_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
/// The configuration's activity-kind dictates which types of data may be collected.
|
||||
typedef enum NVPA_ActivityKind
|
||||
{
|
||||
/// Invalid value.
|
||||
NVPA_ACTIVITY_KIND_INVALID = 0,
|
||||
/// A workload-centric activity for serialized and pipelined collection.
|
||||
///
|
||||
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
||||
/// synchronization required to collect serialized metrics.
|
||||
NVPA_ACTIVITY_KIND_PROFILER,
|
||||
/// A realtime activity for sampling counters from the CPU or GPU.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
||||
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
||||
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
||||
NVPA_ACTIVITY_KIND__COUNT
|
||||
} NVPA_ActivityKind;
|
||||
|
||||
|
||||
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
||||
#define NVPERF_NVPA_BOOL_DEFINED
|
||||
/// The type used for boolean values.
|
||||
typedef uint8_t NVPA_Bool;
|
||||
#endif // NVPERF_NVPA_BOOL_DEFINED
|
||||
|
||||
#ifndef NVPA_STRUCT_SIZE
|
||||
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
||||
#endif // NVPA_STRUCT_SIZE
|
||||
|
||||
|
||||
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
||||
|
||||
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
||||
|
||||
|
||||
///
|
||||
/// Gets the address of an NvPerf API function.
|
||||
///
|
||||
/// \return A function pointer to the function, or NULL if the function is not available.
|
||||
///
|
||||
/// \param pFunctionName [in] Name of the function to retrieve.
|
||||
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
||||
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPaths_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const char** ppPaths;
|
||||
} NVPW_SetLibraryLoadPaths_Params;
|
||||
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const char* paths[] = {
|
||||
/// "path1", "path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
||||
/// params.ppPaths = paths;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPaths(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
||||
|
||||
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] number of paths in ppwPaths
|
||||
size_t numPaths;
|
||||
/// [in] array of null-terminated paths
|
||||
const wchar_t** ppwPaths;
|
||||
} NVPW_SetLibraryLoadPathsW_Params;
|
||||
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
||||
|
||||
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
||||
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
||||
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
||||
/// If load paths are set by this function, the default set of load paths
|
||||
/// will not be attempted.
|
||||
/// Each path must point at a directory (not a file name).
|
||||
/// This function is not thread-safe.
|
||||
/// Example Usage:
|
||||
/// \code
|
||||
/// const wchar_t* wpaths[] = {
|
||||
/// L"path1", L"path2", etc
|
||||
/// };
|
||||
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
||||
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
||||
/// params.ppwPaths = wpaths;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// NVPW_InitializeHost();
|
||||
/// params.numPaths = 0;
|
||||
/// params.ppwPaths = NULL;
|
||||
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
||||
/// \endcode
|
||||
NVPA_Status NVAPI NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
// Device enumeration functions must be preceded by NVPA_<API>_LoadDriver(); any API is fine.
|
||||
|
||||
|
||||
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
/// GPU architecture support level
|
||||
typedef enum NVPW_GpuArchitectureSupportLevel
|
||||
{
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
||||
} NVPW_GpuArchitectureSupportLevel;
|
||||
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
/// SLI configuration support level
|
||||
typedef enum NVPW_SliSupportLevel
|
||||
{
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
||||
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
||||
/// Only Non-SLI configurations are supported.
|
||||
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
||||
} NVPW_SliSupportLevel;
|
||||
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
||||
|
||||
|
||||
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
||||
((pParams_)->structSize >= (const size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
||||
|
||||
|
||||
/***************************************************************************//**
|
||||
* @name External Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
struct VkInstance_T;
|
||||
typedef struct VkInstance_T* VkInstance;
|
||||
struct VkPhysicalDevice_T;
|
||||
typedef struct VkPhysicalDevice_T* VkPhysicalDevice;
|
||||
struct VkDevice_T;
|
||||
typedef struct VkDevice_T* VkDevice;
|
||||
struct VkQueue_T;
|
||||
typedef struct VkQueue_T* VkQueue;
|
||||
struct VkCommandBuffer_T;
|
||||
typedef struct VkCommandBuffer_T* VkCommandBuffer;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CounterDataImageOptions
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// The CounterDataPrefix generated from e.g. NVPW_CounterDataBuilder_GetCounterDataPrefix(). Must be align(8).
|
||||
const uint8_t* pCounterDataPrefix;
|
||||
size_t counterDataPrefixSize;
|
||||
/// max number of ranges that can be specified
|
||||
uint32_t maxNumRanges;
|
||||
/// max number of RangeTree nodes; must be >= maxNumRanges
|
||||
uint32_t maxNumRangeTreeNodes;
|
||||
/// max string length of each RangeName, including the trailing NUL character
|
||||
uint32_t maxRangeNameLength;
|
||||
} NVPW_VK_Profiler_CounterDataImageOptions;
|
||||
#define NVPW_VK_Profiler_CounterDataImageOptions_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CounterDataImageOptions, maxRangeNameLength)
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CounterDataImage_CalculateSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_VK_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [out]
|
||||
size_t counterDataImageSize;
|
||||
} NVPW_VK_Profiler_CounterDataImage_CalculateSize_Params;
|
||||
#define NVPW_VK_Profiler_CounterDataImage_CalculateSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CounterDataImage_CalculateSize_Params, counterDataImageSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CounterDataImage_CalculateSize(NVPW_VK_Profiler_CounterDataImage_CalculateSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CounterDataImage_Initialize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageOptionsSize;
|
||||
/// [in]
|
||||
const NVPW_VK_Profiler_CounterDataImageOptions* pOptions;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in] The buffer to be written.
|
||||
uint8_t* pCounterDataImage;
|
||||
} NVPW_VK_Profiler_CounterDataImage_Initialize_Params;
|
||||
#define NVPW_VK_Profiler_CounterDataImage_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CounterDataImage_Initialize_Params, pCounterDataImage)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CounterDataImage_Initialize(NVPW_VK_Profiler_CounterDataImage_Initialize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CounterDataImage_CalculateScratchBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [out]
|
||||
size_t counterDataScratchBufferSize;
|
||||
} NVPW_VK_Profiler_CounterDataImage_CalculateScratchBufferSize_Params;
|
||||
#define NVPW_VK_Profiler_CounterDataImage_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CounterDataImage_CalculateScratchBufferSize_Params, counterDataScratchBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CounterDataImage_CalculateScratchBufferSize(NVPW_VK_Profiler_CounterDataImage_CalculateScratchBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CounterDataImage_InitializeScratchBuffer_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in] The scratch buffer to be written.
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
} NVPW_VK_Profiler_CounterDataImage_InitializeScratchBuffer_Params;
|
||||
#define NVPW_VK_Profiler_CounterDataImage_InitializeScratchBuffer_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CounterDataImage_InitializeScratchBuffer_Params, pCounterDataScratchBuffer)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CounterDataImage_InitializeScratchBuffer(NVPW_VK_Profiler_CounterDataImage_InitializeScratchBuffer_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_LoadDriver_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkInstance instance;
|
||||
} NVPW_VK_LoadDriver_Params;
|
||||
#define NVPW_VK_LoadDriver_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_LoadDriver_Params, instance)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_LoadDriver(NVPW_VK_LoadDriver_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Device_GetDeviceIndex_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkPhysicalDevice physicalDevice;
|
||||
/// [in]
|
||||
size_t sliIndex;
|
||||
/// [out]
|
||||
size_t deviceIndex;
|
||||
/// [in]
|
||||
VkInstance instance;
|
||||
/// [in]
|
||||
VkDevice device;
|
||||
/// [in] Either a pointer to the loaders vkGetInstanceProcAddr or a pointer to the next layers
|
||||
/// vkGetInstanceProcAddr
|
||||
void* pfnGetInstanceProcAddr;
|
||||
/// [in] Either a pointer to the loaders vkGetDeviceProcAddr or a pointer to the next layers vkGetDeviceProcAddr
|
||||
void* pfnGetDeviceProcAddr;
|
||||
} NVPW_VK_Device_GetDeviceIndex_Params;
|
||||
#define NVPW_VK_Device_GetDeviceIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Device_GetDeviceIndex_Params, pfnGetDeviceProcAddr)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Device_GetDeviceIndex(NVPW_VK_Device_GetDeviceIndex_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_GetRequiredInstanceExtensions_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [out]
|
||||
const char* const* ppInstanceExtensionNames;
|
||||
/// [out]
|
||||
size_t numInstanceExtensionNames;
|
||||
/// [in] Vulkan API version (VK_API_VERSION_*)
|
||||
uint32_t apiVersion;
|
||||
/// [out] is apiVersion officially supported by the NvPerf API
|
||||
NVPA_Bool isOfficiallySupportedVersion;
|
||||
} NVPW_VK_Profiler_GetRequiredInstanceExtensions_Params;
|
||||
#define NVPW_VK_Profiler_GetRequiredInstanceExtensions_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_GetRequiredInstanceExtensions_Params, isOfficiallySupportedVersion)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_GetRequiredInstanceExtensions(NVPW_VK_Profiler_GetRequiredInstanceExtensions_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_GetRequiredDeviceExtensions_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [out]
|
||||
const char* const* ppDeviceExtensionNames;
|
||||
/// [out]
|
||||
size_t numDeviceExtensionNames;
|
||||
/// [in] Vulkan API version (VK_API_VERSION_*)
|
||||
uint32_t apiVersion;
|
||||
/// [out] is apiVersion officially supported by the NvPerf API
|
||||
NVPA_Bool isOfficiallySupportedVersion;
|
||||
/// [in] [optional]
|
||||
VkInstance instance;
|
||||
/// [in] [optional]
|
||||
VkPhysicalDevice physicalDevice;
|
||||
/// [in] [optional] Either a pointer to the loaders vkGetInstanceProcAddr or a pointer to the next layers
|
||||
/// vkGetInstanceProcAddr
|
||||
void* pfnGetInstanceProcAddr;
|
||||
} NVPW_VK_Profiler_GetRequiredDeviceExtensions_Params;
|
||||
#define NVPW_VK_Profiler_GetRequiredDeviceExtensions_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_GetRequiredDeviceExtensions_Params, pfnGetInstanceProcAddr)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_GetRequiredDeviceExtensions(NVPW_VK_Profiler_GetRequiredDeviceExtensions_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CalcTraceBufferSize_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in] Maximum number of Push/Pop pairs that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] for sizing internal buffers
|
||||
size_t avgRangeNameLength;
|
||||
/// [out] TraceBuffer size for a single pass. Pass this to
|
||||
/// NVPW_VK_Profiler_BeginSession_Params::traceBufferSize.
|
||||
size_t traceBufferSize;
|
||||
} NVPW_VK_Profiler_CalcTraceBufferSize_Params;
|
||||
#define NVPW_VK_Profiler_CalcTraceBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CalcTraceBufferSize_Params, traceBufferSize)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CalcTraceBufferSize(NVPW_VK_Profiler_CalcTraceBufferSize_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_BeginSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkDevice device;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [in] Set to 1 if every pass is synchronized with CPU; for asynchronous collection, increase to
|
||||
/// (softwarePipelineDepth + 2).
|
||||
size_t numTraceBuffers;
|
||||
/// [in] Size of the per-pass TraceBuffer in bytes. The profiler allocates a numTraceBuffers * traceBufferSize
|
||||
/// internally.
|
||||
size_t traceBufferSize;
|
||||
/// [in] Maximum number of ranges that can be recorded in a single pass.
|
||||
size_t maxRangesPerPass;
|
||||
/// [in] Maximum number of kernel launches that can be recorded in a single pass. Must be >= maxRangesPerPass.
|
||||
size_t maxLaunchesPerPass;
|
||||
/// [in]
|
||||
VkInstance instance;
|
||||
/// [in]
|
||||
VkPhysicalDevice physicalDevice;
|
||||
/// [in] Either a pointer to the loaders vkGetInstanceProcAddr or a pointer to the next layers
|
||||
/// vkGetInstanceProcAddr
|
||||
void* pfnGetInstanceProcAddr;
|
||||
/// [in] Either a pointer to the loaders vkGetDeviceProcAddr or a pointer to the next layers vkGetDeviceProcAddr
|
||||
void* pfnGetDeviceProcAddr;
|
||||
} NVPW_VK_Profiler_Queue_BeginSession_Params;
|
||||
#define NVPW_VK_Profiler_Queue_BeginSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_BeginSession_Params, pfnGetDeviceProcAddr)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_BeginSession(NVPW_VK_Profiler_Queue_BeginSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_EndSession_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [in] Maximum number of milliseconds to wait for pending GPU operations. Pass 0xFFFFFFFF to wait forever
|
||||
uint32_t timeout;
|
||||
/// [out] becomes true if timeout is reached while waiting for pending GPU operations.
|
||||
NVPA_Bool timeoutExpired;
|
||||
} NVPW_VK_Profiler_Queue_EndSession_Params;
|
||||
#define NVPW_VK_Profiler_Queue_EndSession_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_EndSession_Params, timeoutExpired)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_EndSession(NVPW_VK_Profiler_Queue_EndSession_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Queue_ServicePendingGpuOperations_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [in] The number of operations to process. Passing `0` will block until EndSession is called
|
||||
uint32_t numOperations;
|
||||
/// [in] Maximum number of milliseconds to wait for pending GPU operations. Pass 0xFFFFFFFF to wait forever
|
||||
uint32_t timeout;
|
||||
/// [out] becomes true if timeout is reached while waiting for pending GPU operations.
|
||||
NVPA_Bool timeoutExpired;
|
||||
} NVPW_VK_Queue_ServicePendingGpuOperations_Params;
|
||||
#define NVPW_VK_Queue_ServicePendingGpuOperations_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Queue_ServicePendingGpuOperations_Params, timeoutExpired)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Queue_ServicePendingGpuOperations(NVPW_VK_Queue_ServicePendingGpuOperations_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_SetConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [in] Config created by e.g. NVPW_RawMetricsConfig_GetConfigImage(). Must be align(8).
|
||||
const uint8_t* pConfig;
|
||||
size_t configSize;
|
||||
/// [in] the lowest nesting level to be profiled; must be >= 1
|
||||
uint16_t minNestingLevel;
|
||||
/// [in] the number of nesting levels to profile; must be >= 1
|
||||
uint16_t numNestingLevels;
|
||||
/// [in] Set this to zero for in-app replay. Set this to the output of EndPass() for application replay.
|
||||
size_t passIndex;
|
||||
/// [in] Set this to minNestingLevel for in-app replay. Set this to the output of EndPass() for application
|
||||
/// replay.
|
||||
uint16_t targetNestingLevel;
|
||||
} NVPW_VK_Profiler_Queue_SetConfig_Params;
|
||||
#define NVPW_VK_Profiler_Queue_SetConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_SetConfig_Params, targetNestingLevel)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_SetConfig(NVPW_VK_Profiler_Queue_SetConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_ClearConfig_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
} NVPW_VK_Profiler_Queue_ClearConfig_Params;
|
||||
#define NVPW_VK_Profiler_Queue_ClearConfig_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_ClearConfig_Params, queue)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_ClearConfig(NVPW_VK_Profiler_Queue_ClearConfig_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_BeginPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
} NVPW_VK_Profiler_Queue_BeginPass_Params;
|
||||
#define NVPW_VK_Profiler_Queue_BeginPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_BeginPass_Params, queue)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_BeginPass(NVPW_VK_Profiler_Queue_BeginPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_EndPass_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [out] The passIndex that will be collected by the *next* BeginPass.
|
||||
size_t passIndex;
|
||||
/// [out] The targetNestingLevel that will be collected by the *next* BeginPass.
|
||||
uint16_t targetNestingLevel;
|
||||
/// [out] becomes true when the last pass has been queued to the GPU
|
||||
NVPA_Bool allPassesSubmitted;
|
||||
} NVPW_VK_Profiler_Queue_EndPass_Params;
|
||||
#define NVPW_VK_Profiler_Queue_EndPass_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_EndPass_Params, allPassesSubmitted)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_EndPass(NVPW_VK_Profiler_Queue_EndPass_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CommandBuffer_PushRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkCommandBuffer commandBuffer;
|
||||
/// [in] specifies the range that subsequent launches' counters will be assigned to; must not be NULL
|
||||
const char* pRangeName;
|
||||
/// [in] assign to strlen(pRangeName) if known; if set to zero, the library will call strlen()
|
||||
size_t rangeNameLength;
|
||||
} NVPW_VK_Profiler_CommandBuffer_PushRange_Params;
|
||||
#define NVPW_VK_Profiler_CommandBuffer_PushRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CommandBuffer_PushRange_Params, rangeNameLength)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CommandBuffer_PushRange(NVPW_VK_Profiler_CommandBuffer_PushRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_CommandBuffer_PopRange_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkCommandBuffer commandBuffer;
|
||||
} NVPW_VK_Profiler_CommandBuffer_PopRange_Params;
|
||||
#define NVPW_VK_Profiler_CommandBuffer_PopRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_CommandBuffer_PopRange_Params, commandBuffer)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_CommandBuffer_PopRange(NVPW_VK_Profiler_CommandBuffer_PopRange_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_DecodeCounters_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [in]
|
||||
size_t counterDataImageSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataImage;
|
||||
/// [in]
|
||||
size_t counterDataScratchBufferSize;
|
||||
/// [in]
|
||||
uint8_t* pCounterDataScratchBuffer;
|
||||
/// [out] number of ranges whose data was dropped in the processed pass
|
||||
size_t numRangesDropped;
|
||||
/// [out] number of bytes not written to TraceBuffer due to buffer full
|
||||
size_t numTraceBytesDropped;
|
||||
/// [out] true if a pass was successfully decoded
|
||||
NVPA_Bool onePassCollected;
|
||||
/// [out] becomes true when the last pass has been decoded
|
||||
NVPA_Bool allPassesCollected;
|
||||
/// [out] the Config decoded by this call
|
||||
const uint8_t* pConfigDecoded;
|
||||
/// [out] the passIndex decoded
|
||||
size_t passIndexDecoded;
|
||||
} NVPW_VK_Profiler_Queue_DecodeCounters_Params;
|
||||
#define NVPW_VK_Profiler_Queue_DecodeCounters_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_DecodeCounters_Params, passIndexDecoded)
|
||||
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_DecodeCounters(NVPW_VK_Profiler_Queue_DecodeCounters_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_IsGpuSupported_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
size_t deviceIndex;
|
||||
/// [out]
|
||||
NVPA_Bool isSupported;
|
||||
/// [out]
|
||||
NVPW_GpuArchitectureSupportLevel gpuArchitectureSupportLevel;
|
||||
/// [out]
|
||||
NVPW_SliSupportLevel sliSupportLevel;
|
||||
} NVPW_VK_Profiler_IsGpuSupported_Params;
|
||||
#define NVPW_VK_Profiler_IsGpuSupported_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_IsGpuSupported_Params, sliSupportLevel)
|
||||
|
||||
/// NVPW_VK_LoadDriver must be called prior to this API
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_IsGpuSupported(NVPW_VK_Profiler_IsGpuSupported_Params* pParams);
|
||||
|
||||
typedef struct NVPW_VK_Profiler_Queue_GetCounterAvailability_Params
|
||||
{
|
||||
/// [in]
|
||||
size_t structSize;
|
||||
/// [in] assign to NULL
|
||||
void* pPriv;
|
||||
/// [in]
|
||||
VkInstance instance;
|
||||
/// [in]
|
||||
VkPhysicalDevice physicalDevice;
|
||||
/// [in]
|
||||
VkDevice device;
|
||||
/// [in]
|
||||
VkQueue queue;
|
||||
/// [in] Either a pointer to the loaders vkGetInstanceProcAddr or a pointer to the next layers
|
||||
/// vkGetInstanceProcAddr
|
||||
void* pfnGetInstanceProcAddr;
|
||||
/// [in] Either a pointer to the loaders vkGetDeviceProcAddr or a pointer to the next layers vkGetDeviceProcAddr
|
||||
void* pfnGetDeviceProcAddr;
|
||||
/// [in/out] If `pCounterAvailabilityImage` is NULL, then the required size is returned in
|
||||
/// `counterAvailabilityImageSize`, otherwise `counterAvailabilityImageSize` should be set to the size of
|
||||
/// `pCounterAvailabilityImage`, and on return it would be overwritten with number of actual bytes copied
|
||||
size_t counterAvailabilityImageSize;
|
||||
/// [in] buffer receiving counter availability image, may be NULL
|
||||
uint8_t* pCounterAvailabilityImage;
|
||||
} NVPW_VK_Profiler_Queue_GetCounterAvailability_Params;
|
||||
#define NVPW_VK_Profiler_Queue_GetCounterAvailability_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_VK_Profiler_Queue_GetCounterAvailability_Params, pCounterAvailabilityImage)
|
||||
|
||||
/// This API may fail, if any profiling or sampling session is active on the specified VkQueue or its device
|
||||
NVPA_Status NVAPI NVPW_VK_Profiler_Queue_GetCounterAvailability(NVPW_VK_Profiler_Queue_GetCounterAvailability_Params* pParams);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif // NVPERF_VULKAN_TARGET_H
|
||||
2348
ruins64k/tools/NvPerf/include/windows-desktop-x64/nvperf_host_impl.h
Normal file
2348
ruins64k/tools/NvPerf/include/windows-desktop-x64/nvperf_host_impl.h
Normal file
File diff suppressed because it is too large
Load Diff
2348
ruins64k/tools/NvPerf/include/windows-desktop-x86/nvperf_host_impl.h
Normal file
2348
ruins64k/tools/NvPerf/include/windows-desktop-x86/nvperf_host_impl.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user