Commit e890c9e9 authored by Andreas Beckmann's avatar Andreas Beckmann

Merge tag 'upstream/410.104'

Upstream version 410.104
parents 23dee38a 9549e140
NVIDIA_VERSION = 410.93
NVIDIA_VERSION = 410.104
NVIDIA_VERSION = 410.93
NVIDIA_VERSION = 410.104
......@@ -2,7 +2,7 @@
* nvidia-settings: A tool for configuring the NVIDIA X driver on Unix
* and Linux systems.
*
* Copyright (C) 2017 NVIDIA Corporation.
* Copyright (C) 2019 NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
......@@ -43,17 +43,17 @@
#include <unistd.h>
#include <errno.h>
#define DEFAULT_UPDATE_GRID_LICENSE_STATUS_INFO_TIME_INTERVAL 1000
#define GRID_CONFIG_FILE "/etc/nvidia/gridd.conf"
#define GRID_CONFIG_FILE_TEMPLATE "/etc/nvidia/gridd.conf.template"
#define DEFAULT_UPDATE_GRID_LICENSE_STATUS_INFO_TIME_INTERVAL 1000
#define GRID_CONFIG_FILE "/etc/nvidia/gridd.conf"
#define GRID_CONFIG_FILE_TEMPLATE "/etc/nvidia/gridd.conf.template"
static const char * __manage_grid_licenses_help =
"Use the Manage GRID License page to obtain licenses "
"for GRID vGPU or Quadro Virtual Datacenter Workstation on supported Tesla products.";
"for GRID vGPU or Quadro Virtual Data Center Workstation on supported Tesla products.";
static const char * __grid_virtual_workstation_help =
"Select this option to enable Quadro Virtual Datacenter Workstation license.";
"Select this option to enable Quadro Virtual Data Center Workstation license.";
static const char * __grid_vapp_help =
"Select this option to disable the Quadro Virtual Datacenter Workstation license.";
"Select this option to disable the Quadro Virtual Data Center Workstation license.";
static const char * __license_edition_help =
"This section indicates the status of GRID licensing for the system.";
static const char * __license_server_help =
......@@ -119,7 +119,7 @@ static gboolean allow_digits(GtkWidget *widget, GdkEvent *event, gpointer user_d
static gboolean enable_disable_ui_controls(GtkWidget *widget, GdkEvent *event, gpointer user_data);
static void update_gui_from_griddconfig(gpointer user_data);
static gboolean licenseStateQueryFailed = FALSE;
static void get_licensed_feature_code(gpointer user_data);
static void get_licensed_feature_information(gpointer user_data);
static gboolean is_restart_required(gpointer user_data);
static gboolean queryLicensedFeatureCode = TRUE;
int64_t licensedFeatureCode = NV_GRID_LICENSE_FEATURE_TYPE_VAPP;
......@@ -739,16 +739,15 @@ done:
return ret;
}
/*
* update_manage_grid_license_state_info() - update manage_grid_license state
*/
static gboolean update_manage_grid_license_state_info(gpointer user_data)
{
CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data);
gchar *licenseStatusMessage = "";
gboolean ret = TRUE;
char licenseStatusMsgTmp[GRID_MESSAGE_MAX_BUFFER_SIZE] = {0};
int licenseStatus = NV_GRID_UNLICENSED_VGPU;
int licenseState = NV_GRID_UNLICENSED;
......@@ -844,7 +843,7 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
break;
}
if (queryLicensedFeatureCode == TRUE) {
get_licensed_feature_code(ctk_manage_grid_license);
get_licensed_feature_information(ctk_manage_grid_license);
queryLicensedFeatureCode = FALSE;
}
}
......@@ -925,58 +924,47 @@ static gboolean update_manage_grid_license_state_info(gpointer user_data)
switch (licenseStatus) {
case NV_GRID_UNLICENSED_VGPU:
licenseStatusMessage = "Your system does not have a valid GRID vGPU license.\n"
"Enter license server details and apply.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system does not have a valid %s license.\n"
"Enter license server details and apply.", ctk_manage_grid_license->productName);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_UNLICENSED_VAPP:
licenseStatusMessage = "Your system is currently configured for "
"GRID Virtual Apps.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system is currently configured for %s.", GRID_VIRTUAL_APPLICATIONS);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_UNLICENSED_QDWS_SELECTED:
licenseStatusMessage = "Your system is currently configured for GRID Virtual Apps.\n"
"Enter license server details and apply.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system is currently configured for %s.\n"
"Enter license server details and apply.", GRID_VIRTUAL_APPLICATIONS);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_LICENSE_ACQUIRED_VGPU:
licenseStatusMessage = "Your system is licensed for GRID vGPU.";
break;
case NV_GRID_LICENSE_ACQUIRED_QDWS:
licenseStatusMessage = "Your system is licensed for Quadro Virtual Datacenter "
"Workstation.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Your system is licensed for %s.", ctk_manage_grid_license->productName);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_LICENSE_REQUESTING_VGPU:
licenseStatusMessage = "Acquiring license for GRID vGPU.\n"
"Your system does not have a valid GRID vGPU license.";
break;
case NV_GRID_LICENSE_REQUESTING_QDWS:
licenseStatusMessage = "Acquiring license for Quadro Virtual Datacenter "
"Workstation.\n"
" Your system is currently configured for GRID Virtual Apps.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Acquiring license for %s.", ctk_manage_grid_license->productName);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_LICENSE_FAILED_VGPU:
licenseStatusMessage = "Failed to acquire GRID vGPU license.";
break;
case NV_GRID_LICENSE_FAILED_QDWS:
licenseStatusMessage = "Failed to acquire Quadro Virtual Datacenter "
"Worstation license.\n"
" Your system is currently configured for GRID Virtual Apps.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Failed to acquire %s license.", ctk_manage_grid_license->productName);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_LICENSE_EXPIRED_VGPU:
licenseStatusMessage = "GRID vGPU license has expired.\n"
"Your system does not have a valid GRID vGPU license.";
break;
case NV_GRID_LICENSE_EXPIRED_QDWS:
licenseStatusMessage = "License for Quadro Virtual Datacenter Workstation "
"has expired.\n"
"Your system does not have a valid Quadro Virtual Datacenter "
"Workstation license.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "%s license has expired.", ctk_manage_grid_license->productName);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_LICENSE_RESTART_REQUIRED:
licenseStatusMessage = "Restart your system for GRID Virtual Apps.\n"
"Your system is currently licensed for Quadro Virtual Datacenter "
"Workstation.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Restart your system for %s.\n"
"Your system is currently licensed for %s.", GRID_VIRTUAL_APPLICATIONS, ctk_manage_grid_license->productName);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_LICENSE_RESTART_REQUIRED_VAPP:
licenseStatusMessage = "Restart your system for GRID Virtual Apps.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "Restart your system for %s.",GRID_VIRTUAL_APPLICATIONS);
licenseStatusMessage = licenseStatusMsgTmp;
break;
case NV_GRID_UNLICENSED_REQUEST_DETAILS:
default:
......@@ -1010,7 +998,6 @@ static gboolean is_restart_required(gpointer user_data)
/*
* apply_clicked() - Called when the user clicks on the "Apply" button.
*/
static void apply_clicked(GtkWidget *widget, gpointer user_data)
{
CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data);
......@@ -1093,9 +1080,9 @@ static void apply_clicked(GtkWidget *widget, gpointer user_data)
}
/*
* get_licensed_feature_code() - Get the feature code of the feature that is licensed on this system.
* get_licensed_feature_information() - Get the details of the feature that is licensed on this system.
*/
static void get_licensed_feature_code(gpointer user_data)
static void get_licensed_feature_information(gpointer user_data)
{
CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data);
nvmlGridLicensableFeatures_t *gridLicensableFeatures;
......@@ -1110,6 +1097,11 @@ static void get_licensed_feature_code(gpointer user_data)
for (i = 0; i < gridLicensableFeatures->licensableFeaturesCount; i++)
{
strncpy(ctk_manage_grid_license->productName,
gridLicensableFeatures->gridLicensableFeatures[i].productName,
sizeof(ctk_manage_grid_license->productName) - 1);
ctk_manage_grid_license->productName[sizeof(ctk_manage_grid_license->productName) - 1] = '\0';
if (gridLicensableFeatures->gridLicensableFeatures[i].featureState != 0)
{
licensedFeatureCode = gridLicensableFeatures->gridLicensableFeatures[i].featureCode;
......@@ -1122,7 +1114,6 @@ static void get_licensed_feature_code(gpointer user_data)
/*
* cancel_clicked() - Called when the user clicks on the "Cancel" button.
*/
static void cancel_clicked(GtkWidget *widget, gpointer user_data)
{
CtkManageGridLicense *ctk_manage_grid_license = CTK_MANAGE_GRID_LICENSE(user_data);
......@@ -1157,7 +1148,7 @@ static void update_gui_from_griddconfig(gpointer user_data)
gtk_entry_set_text(GTK_ENTRY(ctk_manage_grid_license->txt_secondary_server_port),
griddConfig->str[NV_GRIDD_BACKUP_SERVER_PORT]);
/* set default value for feature type based on the user configured parameter or virtualization mode */
/* Check Feature type "2" for Quadro Virtual Datacenter Workstation. */
/* Check Feature type "2" for Quadro Virtual Data Center Workstation. */
if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "2") == 0) {
ctk_manage_grid_license->feature_type = NV_GRID_LICENSE_FEATURE_TYPE_QDWS;
}
......@@ -1174,11 +1165,11 @@ static void update_gui_from_griddconfig(gpointer user_data)
/* Set license edition toggle button active */
if (ctk_manage_grid_license->radio_btn_qdws && ctk_manage_grid_license->radio_btn_vapp) {
if (ctk_manage_grid_license->feature_type == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) {
/* Set 'Quadro Virtual Datacenter Workstation' toggle button active */
/* Set 'Quadro Virtual Data Center Workstation' toggle button active */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctk_manage_grid_license->radio_btn_qdws), TRUE);
}
else {
/* Set 'GRID Virtual Apps' toggle button active */
/* Set 'GRID Virtual Applications' toggle button active */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctk_manage_grid_license->radio_btn_vapp), TRUE);
}
}
......@@ -1216,6 +1207,7 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
gboolean enabled;
gchar *statusBarMsg = "";
NvGriddConfigParams *griddConfig;
char licenseStatusMsgTmp[GRID_MESSAGE_MAX_BUFFER_SIZE] = {0};
const char *textBoxServerStr, *textBoxServerPortStr, *textBoxSecondaryServerStr, *textBoxSecondaryServerPortStr;
griddConfig = GetNvGriddConfigParams();
......@@ -1237,7 +1229,8 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
if (GPOINTER_TO_INT(user_data) == NV_GRID_LICENSE_FEATURE_TYPE_QDWS) {
gtk_widget_set_sensitive(ctk_manage_grid_license->box_server_info, TRUE);
statusBarMsg = "You selected Quadro Virtual Datacenter Workstation Edition.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "You selected %s", ctk_manage_grid_license->productName);
statusBarMsg = licenseStatusMsgTmp;
ctk_manage_grid_license->feature_type =
NV_GRID_LICENSE_FEATURE_TYPE_QDWS;
/* Enable Apply/Cancel button if the feature type selection has changed*/
......@@ -1268,7 +1261,8 @@ static void license_edition_toggled(GtkWidget *widget, gpointer user_data)
gtk_widget_set_sensitive(ctk_manage_grid_license->box_server_info, FALSE);
ctk_manage_grid_license->feature_type =
NV_GRID_LICENSE_FEATURE_TYPE_VAPP;
statusBarMsg = "You selected GRID Virtual Apps Edition.";
snprintf(licenseStatusMsgTmp, sizeof(licenseStatusMsgTmp), "You selected %s", GRID_VIRTUAL_APPLICATIONS);
statusBarMsg = licenseStatusMsgTmp;
/* Enable Apply/Cancel button if the feature type selection has changed*/
if (strcmp(griddConfig->str[NV_GRIDD_FEATURE_TYPE], "0") != 0) {
gtk_widget_set_sensitive(ctk_manage_grid_license->btn_apply, TRUE);
......@@ -1451,11 +1445,9 @@ done:
if (configFile) {
fclose(configFile);
}
return ret;
return ret;
}
GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
CtkConfig *ctk_config)
{
......@@ -1505,10 +1497,10 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
}
/* GRID M6 is licensable gpu so we want to allow users to choose
* Quadro Virtual Datacenter Workstation and GRID Virtual Apps on baremetal setup.
* Quadro Virtual Data Center Workstation and GRID Virtual Applications on baremetal setup.
* When virtualization mode is NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_NONE
* treat it same way like NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH.
* So that it will show the Quadro Virtual Datacenter Workstation interface in case of
* So that it will show the Quadro Virtual Data Center Workstation interface in case of
* baremetal setup.
*/
if (mode == NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_NONE) {
......@@ -1566,6 +1558,8 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
gtk_box_set_spacing(GTK_BOX(ctk_manage_grid_license), 5);
get_licensed_feature_information(ctk_manage_grid_license);
/* banner */
banner = ctk_banner_image_new(BANNER_ARTWORK_SERVER_LICENSING);
......@@ -1594,7 +1588,7 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
gtk_container_set_border_width(GTK_CONTAINER(vbox3), 5);
ctk_manage_grid_license->radio_btn_qdws = gtk_radio_button_new_with_label(NULL,
"Quadro Virtual Datacenter Workstation");
ctk_manage_grid_license->productName);
slist = gtk_radio_button_get_group(GTK_RADIO_BUTTON(ctk_manage_grid_license->radio_btn_qdws));
gtk_box_pack_start(GTK_BOX(vbox3), ctk_manage_grid_license->radio_btn_qdws, FALSE, FALSE, 0);
g_object_set_data(G_OBJECT(ctk_manage_grid_license->radio_btn_qdws), "button_id",
......@@ -1603,7 +1597,7 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
G_CALLBACK(license_edition_toggled),
(gpointer) ctk_manage_grid_license);
ctk_manage_grid_license->radio_btn_vapp = gtk_radio_button_new_with_label(slist, "GRID Virtual Apps");
ctk_manage_grid_license->radio_btn_vapp = gtk_radio_button_new_with_label(slist, GRID_VIRTUAL_APPLICATIONS);
gtk_box_pack_start(GTK_BOX(vbox3), ctk_manage_grid_license->radio_btn_vapp, FALSE, FALSE, 0);
g_object_set_data(G_OBJECT(ctk_manage_grid_license->radio_btn_vapp), "button_id",
GINT_TO_POINTER(NV_GRID_LICENSE_FEATURE_TYPE_VAPP));
......@@ -1785,8 +1779,6 @@ GtkWidget* ctk_manage_grid_license_new(CtrlTarget *target,
/* Update GUI with information from the nvidia-gridd config file */
update_gui_from_griddconfig(ctk_manage_grid_license);
get_licensed_feature_code(ctk_manage_grid_license);
/* Set the license feature type fetched from nvidia-gridd */
ctk_manage_grid_license->gridd_feature_type = ctk_manage_grid_license->feature_type;
......@@ -1835,10 +1827,10 @@ GtkTextBuffer *ctk_manage_grid_license_create_help(GtkTextTagTable *table,
if (ctk_manage_grid_license->license_edition_state ==
NV_CTRL_ATTR_NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH) {
ctk_help_heading(b, &i, "Quadro Virtual Datacenter Workstation");
ctk_help_heading(b, &i, "%s", ctk_manage_grid_license->productName);
ctk_help_para(b, &i, "%s", __grid_virtual_workstation_help);
ctk_help_heading(b, &i, "GRID Virtual Apps");
ctk_help_heading(b, &i, "%s", GRID_VIRTUAL_APPLICATIONS);
ctk_help_para(b, &i, "%s", __grid_vapp_help);
}
......
......@@ -39,6 +39,10 @@ G_BEGIN_DECLS
#define CTK_MANAGE_GRID_LICENSE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CTK_TYPE_MANAGE_GRID_LICENSE, CtkMANAGE_GRID_LICENSEClass))
#define GRID_LICENSE_INFO_MAX_LENGTH 128
#define GRID_MESSAGE_MAX_BUFFER_SIZE 512
#define GRID_VIRTUAL_APPLICATIONS "GRID Virtual Applications"
typedef struct _CtkManageGridLicense CtkManageGridLicense;
typedef struct _CtkManageGridLicenseClass CtkManageGridLicenseClass;
......@@ -64,8 +68,9 @@ struct _CtkManageGridLicense
DbusData *dbusData;
CtrlTarget *target;
gint license_edition_state;
gint feature_type; // Feature type from UI/gridd.conf.
int gridd_feature_type; // Feature type fetched from nvidia-gridd.
gint feature_type; // Feature type from UI/gridd.conf.
int gridd_feature_type; // Feature type fetched from nvidia-gridd.
char productName[GRID_LICENSE_INFO_MAX_LENGTH]; // GRID product name fetched from nvml.
};
/*
......
NVIDIA_VERSION = 410.93
NVIDIA_VERSION = 410.104
......@@ -206,7 +206,7 @@ static Bool LoadNvml(NvCtrlNvmlAttributes *nvml)
#define GET_SYMBOL_OPTIONAL(_proc, _name) \
nvml->lib._proc = dlsym(nvml->lib.handle, _name);
GET_SYMBOL_OPTIONAL(deviceGetGridLicensableFeatures, "nvmlDeviceGetGridLicensableFeatures");
GET_SYMBOL_OPTIONAL(deviceGetGridLicensableFeatures, "nvmlDeviceGetGridLicensableFeatures_v2");
#undef GET_SYMBOL_OPTIONAL
ret = nvml->lib.init();
......
......@@ -164,21 +164,21 @@ struct __NvCtrlNvmlAttributes {
struct {
void *handle;
typeof(nvmlInit) (*init);
typeof(nvmlShutdown) (*shutdown);
typeof(nvmlDeviceGetHandleByIndex) (*deviceGetHandleByIndex);
typeof(nvmlDeviceGetUUID) (*deviceGetUUID);
typeof(nvmlDeviceGetCount) (*deviceGetCount);
typeof(nvmlDeviceGetTemperature) (*deviceGetTemperature);
typeof(nvmlDeviceGetFanSpeed) (*deviceGetFanSpeed);
typeof(nvmlDeviceGetName) (*deviceGetName);
typeof(nvmlDeviceGetVbiosVersion) (*deviceGetVbiosVersion);
typeof(nvmlDeviceGetMemoryInfo) (*deviceGetMemoryInfo);
typeof(nvmlDeviceGetPciInfo) (*deviceGetPciInfo);
typeof(nvmlDeviceGetMaxPcieLinkGeneration) (*deviceGetMaxPcieLinkGeneration);
typeof(nvmlDeviceGetMaxPcieLinkWidth) (*deviceGetMaxPcieLinkWidth);
typeof(nvmlDeviceGetVirtualizationMode) (*deviceGetVirtualizationMode);
typeof(nvmlDeviceGetGridLicensableFeatures) (*deviceGetGridLicensableFeatures);
typeof(nvmlInit) (*init);
typeof(nvmlShutdown) (*shutdown);
typeof(nvmlDeviceGetHandleByIndex) (*deviceGetHandleByIndex);
typeof(nvmlDeviceGetUUID) (*deviceGetUUID);
typeof(nvmlDeviceGetCount) (*deviceGetCount);
typeof(nvmlDeviceGetTemperature) (*deviceGetTemperature);
typeof(nvmlDeviceGetFanSpeed) (*deviceGetFanSpeed);
typeof(nvmlDeviceGetName) (*deviceGetName);
typeof(nvmlDeviceGetVbiosVersion) (*deviceGetVbiosVersion);
typeof(nvmlDeviceGetMemoryInfo) (*deviceGetMemoryInfo);
typeof(nvmlDeviceGetPciInfo) (*deviceGetPciInfo);
typeof(nvmlDeviceGetMaxPcieLinkGeneration) (*deviceGetMaxPcieLinkGeneration);
typeof(nvmlDeviceGetMaxPcieLinkWidth) (*deviceGetMaxPcieLinkWidth);
typeof(nvmlDeviceGetVirtualizationMode) (*deviceGetVirtualizationMode);
typeof(nvmlDeviceGetGridLicensableFeatures_v2) (*deviceGetGridLicensableFeatures);
} lib;
......
/*
* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
* Copyright 1993-2018 NVIDIA Corporation. All rights reserved.
*
* NOTICE TO USER:
*
......@@ -95,13 +95,16 @@ extern "C" {
/**
* NVML API versioning support
*/
#define NVML_API_VERSION 8
#define NVML_API_VERSION_STR "8"
#define NVML_API_VERSION 10
#define NVML_API_VERSION_STR "10"
#define nvmlInit nvmlInit_v2
#define nvmlDeviceGetPciInfo nvmlDeviceGetPciInfo_v2
#define nvmlDeviceGetPciInfo nvmlDeviceGetPciInfo_v3
#define nvmlDeviceGetCount nvmlDeviceGetCount_v2
#define nvmlDeviceGetHandleByIndex nvmlDeviceGetHandleByIndex_v2
#define nvmlDeviceGetHandleByPciBusId nvmlDeviceGetHandleByPciBusId_v2
#define nvmlDeviceGetNvLinkRemotePciInfo nvmlDeviceGetNvLinkRemotePciInfo_v2
#define nvmlDeviceRemoveGpu nvmlDeviceRemoveGpu_v2
#define nvmlDeviceGetGridLicensableFeatures nvmlDeviceGetGridLicensableFeatures_v2
/***************************************************************************************************/
/** @defgroup nvmlDeviceStructs Device Structs
......@@ -122,29 +125,47 @@ typedef struct nvmlDevice_st* nvmlDevice_t;
/**
* Buffer size guaranteed to be large enough for pci bus id
*/
#define NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE 16
#define NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE 32
/**
* Buffer size guaranteed to be large enough for pci bus id for ::busIdLegacy
*/
#define NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE 16
/**
* PCI information about a GPU device.
*/
typedef struct nvmlPciInfo_st
typedef struct nvmlPciInfo_st
{
char busId[NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; //!< The tuple domain:bus:device.function PCI identifier (&amp; NULL terminator)
unsigned int domain; //!< The PCI domain on which the device's bus resides, 0 to 0xffff
char busIdLegacy[NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE]; //!< The legacy tuple domain:bus:device.function PCI identifier (&amp; NULL terminator)
unsigned int domain; //!< The PCI domain on which the device's bus resides, 0 to 0xffffffff
unsigned int bus; //!< The bus on which the device resides, 0 to 0xff
unsigned int device; //!< The device's id on the bus, 0 to 31
unsigned int pciDeviceId; //!< The combined 16-bit device id and 16-bit vendor id
// Added in NVML 2.285 API
unsigned int pciSubSystemId; //!< The 32-bit Sub System Device ID
// NVIDIA reserved for internal use only
unsigned int reserved0;
unsigned int reserved1;
unsigned int reserved2;
unsigned int reserved3;
char busId[NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE]; //!< The tuple domain:bus:device.function PCI identifier (&amp; NULL terminator)
} nvmlPciInfo_t;
/**
* PCI format string for ::busIdLegacy
*/
#define NVML_DEVICE_PCI_BUS_ID_LEGACY_FMT "%04X:%02X:%02X.0"
/**
* PCI format string for ::busId
*/
#define NVML_DEVICE_PCI_BUS_ID_FMT "%08X:%02X:%02X.0"
/**
* Utility macro for filling the pci bus id format from a nvmlPciInfo_t
*/
#define NVML_DEVICE_PCI_BUS_ID_FMT_ARGS(pciInfo) (pciInfo)->domain, \
(pciInfo)->bus, \
(pciInfo)->device
/**
* Detailed ECC error counts for a device.
*
......@@ -295,12 +316,15 @@ typedef enum nvmlGpuLevel_enum
NVML_TOPOLOGY_SINGLE = 10, // all devices that only need traverse a single PCIe switch
NVML_TOPOLOGY_MULTIPLE = 20, // all devices that need not traverse a host bridge
NVML_TOPOLOGY_HOSTBRIDGE = 30, // all devices that are connected to the same host bridge
NVML_TOPOLOGY_CPU = 40, // all devices that are connected to the same CPU but possibly multiple host bridges
NVML_TOPOLOGY_NODE = 40, // all devices that are connected to the same NUMA node but possibly multiple host bridges
NVML_TOPOLOGY_SYSTEM = 50, // all devices in the system
// there is purposefully no COUNT here because of the need for spacing above
} nvmlGpuTopologyLevel_t;
/* Compatibility for CPU->NODE renaming */
#define NVML_TOPOLOGY_CPU NVML_TOPOLOGY_NODE
/* P2P Capability Index Status*/
typedef enum nvmlGpuP2PStatus_enum
{
......@@ -476,6 +500,7 @@ typedef enum nvmlBrandType_enum
NVML_BRAND_NVS = 3,
NVML_BRAND_GRID = 4,
NVML_BRAND_GEFORCE = 5,
NVML_BRAND_TITAN = 6,
// Keep this last
NVML_BRAND_COUNT
......@@ -488,7 +513,9 @@ typedef enum nvmlTemperatureThresholds_enum
{
NVML_TEMPERATURE_THRESHOLD_SHUTDOWN = 0, // Temperature at which the GPU will shut down
// for HW protection
NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1, // Temperature at which the GPU will begin slowdown
NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1, // Temperature at which the GPU will begin HW slowdown
NVML_TEMPERATURE_THRESHOLD_MEM_MAX = 2, // Memory Temperature at which the GPU will begin SW slowdown
NVML_TEMPERATURE_THRESHOLD_GPU_MAX = 3, // GPU Temperature at which the GPU can be throttled below base clock
// Keep this last
NVML_TEMPERATURE_THRESHOLD_COUNT
} nvmlTemperatureThresholds_t;
......@@ -599,7 +626,7 @@ typedef enum nvmlClockType_enum
NVML_CLOCK_VIDEO = 3, //!< Video encoder/decoder clock domain
// Keep this last
NVML_CLOCK_COUNT //<! Count of clock types
NVML_CLOCK_COUNT //!< Count of clock types
} nvmlClockType_t;
/**
......@@ -614,7 +641,7 @@ typedef enum nvmlClockId_enum
NVML_CLOCK_ID_CUSTOMER_BOOST_MAX = 3, //!< OEM-defined maximum clock rate
//Keep this last
NVML_CLOCK_ID_COUNT //<! Count of Clock Ids.
NVML_CLOCK_ID_COUNT //!< Count of Clock Ids.
} nvmlClockId_t;
/**
......@@ -715,20 +742,19 @@ typedef enum nvmlReturn_enum
} nvmlReturn_t;
/**
* Memory locations
*
* See \ref nvmlDeviceGetMemoryErrorCounter
*/
typedef enum nvmlMemoryLocation_enum
{
NVML_MEMORY_LOCATION_L1_CACHE = 0, //!< GPU L1 Cache
NVML_MEMORY_LOCATION_L2_CACHE = 1, //!< GPU L2 Cache
NVML_MEMORY_LOCATION_DEVICE_MEMORY = 2, //!< GPU Device Memory
NVML_MEMORY_LOCATION_REGISTER_FILE = 3, //!< GPU Register File
NVML_MEMORY_LOCATION_TEXTURE_MEMORY = 4, //!< GPU Texture Memory
NVML_MEMORY_LOCATION_TEXTURE_SHM = 5, //!< Shared memory
NVML_MEMORY_LOCATION_CBU = 6, //!< CBU
NVML_MEMORY_LOCATION_L1_CACHE = 0, //!< GPU L1 Cache
NVML_MEMORY_LOCATION_L2_CACHE = 1, //!< GPU L2 Cache
NVML_MEMORY_LOCATION_DRAM = 2, //!< Turing+ DRAM
NVML_MEMORY_LOCATION_DEVICE_MEMORY = 2, //!< GPU Device Memory
NVML_MEMORY_LOCATION_REGISTER_FILE = 3, //!< GPU Register File
NVML_MEMORY_LOCATION_TEXTURE_MEMORY = 4, //!< GPU Texture Memory
NVML_MEMORY_LOCATION_TEXTURE_SHM = 5, //!< Shared memory
NVML_MEMORY_LOCATION_CBU = 6, //!< CBU
NVML_MEMORY_LOCATION_SRAM = 7, //!< Turing+ SRAM
// Keep this last
NVML_MEMORY_LOCATION_COUNT //!< This counts the number of memory locations the driver knows about
} nvmlMemoryLocation_t;
......@@ -881,19 +907,39 @@ typedef enum nvmlGpuVirtualizationMode {
#define NVML_FI_DEV_NVLINK_BANDWIDTH_C1_TOTAL 73 //!< NVLink Bandwidth Counter Total for Counter Set 1, All Lanes
/* NVML Perf Policy Counters */
#define NVML_FI_DEV_PERF_POLICY_POWER 74 //!< Perf Policy Counter for Power Policy
#define NVML_FI_DEV_PERF_POLICY_POWER 74 //!< Perf Policy Counter for Power Policy
#define NVML_FI_DEV_PERF_POLICY_THERMAL 75 //!< Perf Policy Counter for Thermal Policy
#define NVML_FI_DEV_PERF_POLICY_SYNC_BOOST 76 //!< Perf Policy Counter for Sync boost Policy
#define NVML_FI_DEV_PERF_POLICY_BOARD_LIMIT 77 //!< Perf Policy Counter for Board Limit
#define NVML_FI_DEV_PERF_POLICY_LOW_UTILIZATION 78 //!< Perf Policy Counter for Low GPU Utilization Policy
#define NVML_FI_DEV_PERF_POLICY_RELIABILITY 79 //!< Perf Policy Counter for Reliability Policy
#define NVML_FI_DEV_PERF_POLICY_TOTAL_APP_CLOCKS 80 //!< Perf Policy Counter for Total App Clock Policy
#define NVML_FI_DEV_PERF_POLICY_TOTAL_BASE_CLOCKS 81 //!< Perf Policy Counter for Total Base Clocks Policy
#define NVML_FI_DEV_PERF_POLICY_TOTAL_APP_CLOCKS 80 //!< Perf Policy Counter for Total App Clock Policy
#define NVML_FI_DEV_PERF_POLICY_TOTAL_BASE_CLOCKS 81 //!< Perf Policy Counter for Total Base Clocks Policy
/* Memory temperatures */
#define NVML_FI_DEV_MEMORY_TEMP 82 //!< Memory temperature for the device
#define NVML_FI_MAX 83 //!< One greater than the largest field ID defined above
/* Energy Counter */
#define NVML_FI_DEV_TOTAL_ENERGY_CONSUMPTION 83 //!< Total energy consumption for the GPU in mJ since the driver was last reloaded
/* NVLink Speed */
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_L0 84 //!< NVLink Speed in MBps for Link 0
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_L1 85 //!< NVLink Speed in MBps for Link 1
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_L2 86 //!< NVLink Speed in MBps for Link 2
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_L3 87 //!< NVLink Speed in MBps for Link 3
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_L4 88 //!< NVLink Speed in MBps for Link 4
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_L5 89 //!< NVLink Speed in MBps for Link 5
#define NVML_FI_DEV_NVLINK_SPEED_MBPS_COMMON 90 //!< Common NVLink Speed in MBps for active links
#define NVML_FI_DEV_NVLINK_LINK_COUNT 91 //!< Number of NVLinks present on the device
#define NVML_FI_DEV_RETIRED_PENDING_SBE 92 //!< If any pages are pending retirement due to SBE. 1=yes. 0=no.
#define NVML_FI_DEV_RETIRED_PENDING_DBE 93 //!< If any pages are pending retirement due to DBE. 1=yes. 0=no.
#define NVML_FI_DEV_PCIE_REPLAY_COUNTER 94 //!< PCIe replay counter
#define NVML_FI_DEV_PCIE_REPLAY_ROLLOVER_COUNTER 95 //!< PCIe replay rollover counter
#define NVML_FI_MAX 96 //!< One greater than the largest field ID defined above
/**
* Information for a Field Value Sample
......@@ -1102,7 +1148,7 @@ typedef struct nvmlEventData_st
* @see nvmlDeviceSetApplicationsClocks
* @see nvmlDeviceGetApplicationsClock
*/
#define nvmlClocksThrottleReasonApplicationsClocksSetting 0x0000000000000002LL
#define nvmlClocksThrottleReasonApplicationsClocksSetting 0x0000000000000002LL
/**
* @deprecated Renamed to \ref nvmlClocksThrottleReasonApplicationsClocksSetting
......@@ -1144,6 +1190,43 @@ typedef struct nvmlEventData_st
*/
#define nvmlClocksThrottleReasonSyncBoost 0x0000000000000010LL
/** SW Thermal Slowdown
*
* This is an indicator of one or more of the following:
* - Current GPU temperature above the GPU Max Operating Temperature
* - Current memory temperature above the Memory Max Operating Temperature
*
*/
#define nvmlClocksThrottleReasonSwThermalSlowdown 0x0000000000000020LL
/** HW Thermal Slowdown (reducing the core clocks by a factor of 2 or more) is engaged
*
* This is an indicator of:
* - temperature being too high
*
* @see nvmlDeviceGetTemperature
* @see nvmlDeviceGetTemperatureThreshold
* @see nvmlDeviceGetPowerUsage
*/
#define nvmlClocksThrottleReasonHwThermalSlowdown 0x0000000000000040LL
/** HW Power Brake Slowdown (reducing the core clocks by a factor of 2 or more) is engaged
*
* This is an indicator of:
* - External Power Brake Assertion being triggered (e.g. by the system power supply)
*
* @see nvmlDeviceGetTemperature
* @see nvmlDeviceGetTemperatureThreshold
* @see nvmlDeviceGetPowerUsage
*/
#define nvmlClocksThrottleReasonHwPowerBrakeSlowdown 0x0000000000000080LL
/** GPU clocks are limited by current setting of Display clocks
*
* @see bug 1997531
*/
#define nvmlClocksThrottleReasonDisplayClockSetting 0x0000000000000100LL
/** Bit mask representing no clocks throttling
*
* Clocks are as high as possible.
......@@ -1159,6 +1242,10 @@ typedef struct nvmlEventData_st
| nvmlClocksThrottleReasonSwPowerCap \
| nvmlClocksThrottleReasonHwSlowdown \
| nvmlClocksThrottleReasonSyncBoost \
| nvmlClocksThrottleReasonSwThermalSlowdown \
| nvmlClocksThrottleReasonHwThermalSlowdown \
| nvmlClocksThrottleReasonHwPowerBrakeSlowdown \
| nvmlClocksThrottleReasonDisplayClockSetting \
)
/** @} */
......@@ -1217,13 +1304,14 @@ typedef struct nvmlAccountingStats_st {
#define NVML_VGPU_NAME_BUFFER_SIZE 64
#define NVML_MAX_VGPU_TYPES_PER_PGPU 18
#define NVML_MAX_VGPU_INSTANCES_PER_PGPU 24
#define NVML_GRID_LICENSE_FEATURE_MAX_COUNT 3
#define NVML_GRID_LICENSE_INFO_MAX_LENGTH 128
/*!
* Macros for pGPU's virtualization capabilities bitfield.
*/
#define NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION 0:0
#define NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION_NO 0x0
#define NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION_YES 0x1
/** @} */
......@@ -1241,17 +1329,21 @@ typedef enum nvmlVgpuVmIdType {
NVML_VGPU_VM_ID_UUID = 1, //!< VM ID represents UUID
} nvmlVgpuVmIdType_t;
// vGPU GUEST info state.
/**
* vGPU GUEST info state.
*/
typedef enum nvmlVgpuGuestInfoState_enum
{
NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED = 0, //<! Guest-dependent fields uninitialized
NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED = 1, //<! Guest-dependent fields initialized
NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED = 0, //!< Guest-dependent fields uninitialized
NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED = 1, //!< Guest-dependent fields initialized
} nvmlVgpuGuestInfoState_t;
// GRID license feature code
/**
* GRID license feature code
*/
typedef enum {
NVML_GRID_LICENSE_FEATURE_CODE_VGPU = 1, // Virtual GPU
NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION = 2 // Virtual Workstation
NVML_GRID_LICENSE_FEATURE_CODE_VGPU = 1, //!< Virtual GPU
NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION = 2 //!< Virtual Workstation
} nvmlGridLicenseFeatureCode_t;
/** @} */
......@@ -1308,20 +1400,24 @@ typedef struct nvmlProcessUtilizationSample_st
} nvmlProcessUtilizationSample_t;
/**
* Structure to store GRID licensable features
* Structure containing GRID licensable feature information
*/
typedef struct nvmlGridLicensableFeature_st
{
nvmlGridLicenseFeatureCode_t featureCode; //<! Licensed feature code
unsigned int featureState; //<! Non-zero if feature is currently licensed, otherwise zero
char licenseInfo[NVML_GRID_LICENSE_INFO_MAX_LENGTH];
nvmlGridLicenseFeatureCode_t featureCode; //!< Licensed feature code
unsigned int featureState; //!< Non-zero if feature is currently licensed, otherwise zero
char licenseInfo[NVML_GRID_LICENSE_BUFFER_SIZE];
char productName[NVML_GRID_LICENSE_BUFFER_SIZE];
} nvmlGridLicensableFeature_t;
/**
* Structure to store GRID licensable features
*/
typedef struct nvmlGridLicensableFeatures_st
{
int isGridLicenseSupported; //<! Non-zero if GRID Software Licensing is supported on the system, otherwise zero
unsigned int licensableFeaturesCount; //<! Entries returned in \a gridLicensableFeatures array
nvmlGridLicensableFeature_t gridLicensableFeatures[NVML_GRID_LICENSE_FEATURE_MAX_COUNT];
int isGridLicenseSupported; //!< Non-zero if GRID Software Licensing is supported on the system, otherwise zero
unsigned int licensableFeaturesCount; //!< Entries returned in \a gridLicensableFeatures array
nvmlGridLicensableFeature_t gridLicensableFeatures[NVML_GRID_LICENSE_FEATURE_MAX_COUNT]; //!< Array of GRID licensable features.
} nvmlGridLicensableFeatures_t;
/** @} */
......@@ -1332,17 +1428,17 @@ typedef struct nvmlGridLicensableFeatures_st
*/
/***************************************************************************************************/
/*
/**
* Represents type of encoder for capacity can be queried
*/
typedef enum nvmlEncoderQueryType_enum
{
NVML_ENCODER_QUERY_H264 = 0,
NVML_ENCODER_QUERY_HEVC = 1,
NVML_ENCODER_QUERY_H264 = 0, //!< H264 encoder
NVML_ENCODER_QUERY_HEVC = 1, <