Injection API


Data Structures

struct  NGFX_Injection_Activity
 Reports information about a specified activity. More...
struct  NGFX_Injection_InstallationInfo
 Reports information about a particular Nsight installation. More...

Enumerations

enum  NGFX_Injection_ActivityType
 Specifies a particular activity that is available from Nsight Graphics. More...
enum  NGFX_Injection_Result {
  NGFX_INJECTION_RESULT_OK = 0,
  NGFX_INJECTION_RESULT_FAILURE = -1,
  NGFX_INJECTION_RESULT_INVALID_ARGUMENT = -2,
  NGFX_INJECTION_RESULT_INJECTION_FAILED = -3,
  NGFX_INJECTION_RESULT_ALREADY_INJECTED = -4,
  NGFX_INJECTION_RESULT_NOT_INJECTED = -5,
  NGFX_INJECTION_RESULT_DRIVER_STILL_LOADED = -6,
  NGFX_INJECTION_RESULT_INVALID_PROJECT = -7
}
 Reports success or failure of an injection operation. More...
enum  NGFX_Nsight_SKU
 Identifies the SKU of a particular Nsight installation. More...

Functions

NGFX_Injection_API
NGFX_Injection_Result 
NGFX_Injection_EnumerateActivities (const NGFX_Injection_InstallationInfo *pInstallation, uint32_t *pCount, NGFX_Injection_Activity *pActivities)
 Enumerates the activities that are available for the particular installation of Nsight Graphics.
NGFX_Injection_API
NGFX_Injection_Result 
NGFX_Injection_EnumerateInstallations (uint32_t *pCount, NGFX_Injection_InstallationInfo *pInstallations)
 Enumerates the installations of Nsight that are installed on the current system.
NGFX_Injection_API
NGFX_Injection_Result 
NGFX_Injection_ExecuteActivityCommand ()
 Performs the primary command for the injected activity.
NGFX_Injection_API
NGFX_Injection_Result 
NGFX_Injection_InjectToProcess (const NGFX_Injection_InstallationInfo *pInstallation, const NGFX_Injection_Activity *pActivity)
 Performs an injection into the current process with the specified installation and activity.
NGFX_Injection_API
NGFX_Injection_Result 
NGFX_Injection_SetActivitySettingsFromProjectFile (const NGFX_Injection_InstallationInfo *pInstallation, const NGFX_Injection_PathChar *pProjectFilePath)
 Globally configures the activity settings based off an existing Nsight Graphics project file.
NGFX_Injection_API
NGFX_Injection_Result 
NGFX_Injection_SetActivitySettingsFromProjectJson (const NGFX_Injection_InstallationInfo *pInstallation, const char *pJson)
 Globally configures the activity settings based off the contents of an existing Nsight Graphics project file.

Detailed Description

The Injection API contains methods for programmatic injection of Nsight tools from target applications. This provides an alternative mechanism to the Nsight Host for launching and injecting applications.

Enumeration Type Documentation

The activity specifies the type of operations that can be performed when analyzing the application. Only one activity may be selected for a given session.

All functions within the NGFX Injection API will report a result code that idenfies the success or failure of the operation. Negative values generally indicate a failed operation.

Enumerator:
NGFX_INJECTION_RESULT_OK  Success.
NGFX_INJECTION_RESULT_FAILURE  Generic failure.
NGFX_INJECTION_RESULT_INVALID_ARGUMENT  Invalid argument.
NGFX_INJECTION_RESULT_INJECTION_FAILED  Generic injection failure.
NGFX_INJECTION_RESULT_ALREADY_INJECTED  Cannot inject because already injected.
NGFX_INJECTION_RESULT_NOT_INJECTED  Cannot execute activity because not injected.
NGFX_INJECTION_RESULT_DRIVER_STILL_LOADED  Cannot inject because a graphics driver is already or still loaded.
NGFX_INJECTION_RESULT_INVALID_PROJECT  Project file specified was malformed.

The sku is the distribution of Nsight.


Function Documentation

NGFX_Injection_API NGFX_Injection_Result NGFX_Injection_EnumerateActivities ( const NGFX_Injection_InstallationInfo pInstallation,
uint32_t *  pCount,
NGFX_Injection_Activity pActivities 
)

This method must be called to identify the activities that may be injected for a particular installation of Nsight Graphics. If installation is valid, a count of activities will be returned and when pActivities is non-null, a list of activities of size *pCount will be populated. It is the responsibilities of the user application to point pActivities to valid memory for writing.

Parameters:
pInstallation - A pointer to an installation that was previously identified by NGFX_Injection_EnumerateInstallations.
pCount - Returns the count of activities available for the specified installation
pActivities - Returns the list of activities for the specified installation. This parameter may be null when querying the installation count. If non-null the array of activities will be written here.
Returns:
An injection result that reports whether the activities could be queried

NGFX_Injection_API NGFX_Injection_Result NGFX_Injection_EnumerateInstallations ( uint32_t *  pCount,
NGFX_Injection_InstallationInfo pInstallations 
)

When Nsight Graphics is installed, this method will discover one or more installations and report them for possible injection. When no installations are present, pCount will be assigned to 0. It is the responsibility of the user application to point pInstallations to valid memory for writing.

Parameters:
pCount - Returns the count of Nsight installations found on the system.
pInstallations - Returns the list of Nsight installation. This parameter may be null when querying the installation count. If non-null the array of installations will be written here.
Returns:
An injection result that reports whether the installations could be queried

NGFX_Injection_API NGFX_Injection_Result NGFX_Injection_ExecuteActivityCommand (  ) 

This command is typically a 'capture' command. The prerequisite for this is that NGFX_Injection_InjectToProcess succeeded, i.e., that the application has previously selected a valid installation and activity and successfully injected via NGFX_Injection_InjectToProcess.

This function is currently experimental and may be revised, replaced, or eliminated in a future version.

NGFX_Injection_API NGFX_Injection_Result NGFX_Injection_InjectToProcess ( const NGFX_Injection_InstallationInfo pInstallation,
const NGFX_Injection_Activity pActivity 
)

To perform an injection into the current process, a valid installation and activity must have been queried. Additionally, the NVIDIA driver must not be actively loaded, otherwise NGFX_INJECTION_RESULT_DRIVER_STILL_LOADED will be returned.

Parameters:
pInstallation - A pointer to an installation that was previously identified by NGFX_Injection_EnumerateInstallations.
pActivity - A pointer to the activity to select when injecting that was queried by NGFX_Injection_EnumerateActivities.
Returns:
An injection result that reports whether the process could be injected.

NGFX_Injection_API NGFX_Injection_Result NGFX_Injection_SetActivitySettingsFromProjectFile ( const NGFX_Injection_InstallationInfo pInstallation,
const NGFX_Injection_PathChar *  pProjectFilePath 
)

Parameters:
pInstallation - A pointer to an installation that was previously identified by NGFX_Injection_EnumerateInstallations.
pProjectFilePath - Path of an Nsight Graphics project file to load. This file is created by the Nsight Graphics UI and saved for consumption by the NGFX Injection API.
Returns:
An injection result that reports whether the activities settings object was successfully created.

NGFX_Injection_API NGFX_Injection_Result NGFX_Injection_SetActivitySettingsFromProjectJson ( const NGFX_Injection_InstallationInfo pInstallation,
const char *  pJson 
)

Parameters:
pInstallation - A pointer to an installation that was previously identified by NGFX_Injection_EnumerateInstallations.
pJson - JSON contents of an Nsight Graphics project file to load.
Returns:
An injection result that reports whether the activities settings object was successfully created.


Generated on Tue Aug 8 15:10:24 2023 for NsightGraphicsSDK by  doxygen 1.5.8