535.43.02

This commit is contained in:
Andy Ritger
2023-05-30 10:11:36 -07:00
parent 6dd092ddb7
commit eb5c7665a1
1403 changed files with 295367 additions and 86235 deletions

View File

@@ -76,6 +76,12 @@ typedef struct
/* Add more caps as need in the future */
#define NVLINK_INBAND_BW_MODE_FULL 0
#define NVLINK_INBAND_BW_MODE_OFF 1
#define NVLINK_INBAND_BW_MODE_MIN 2
#define NVLINK_INBAND_BW_MODE_HALF 3
#define NVLINK_INBAND_BW_MODE_3QUARTER 4
typedef struct
{
NvU64 pciInfo; /* Encoded as Domain(63:32):Bus(15:8):Device(0:7). (debug only) */
@@ -85,7 +91,8 @@ typedef struct
NvU64 enabledLinkMask; /* GPU's currently enabled NvLink mask info. (debug only) */
NvU32 gpuCapMask; /* GPU capabilities, one of NVLINK_INBAND_GPU_PROBE_CAPS */
NvU8 reserved[32]; /* For future use. Must be initialized to zero */
NvU8 bwMode; /* NVLink bandwidth mode, one of NVLINK_INBAND_BW_MODE */
NvU8 reserved[31]; /* For future use. Must be initialized to zero */
} nvlink_inband_gpu_probe_req_t;
typedef struct
@@ -96,6 +103,9 @@ typedef struct
#define NVLINK_INBAND_FM_CAPS_MC_TEAM_SETUP_V1 NVBIT64(0)
#define NVLINK_INBAND_FM_CAPS_MC_TEAM_RELEASE_V1 NVBIT64(1)
#define NVLINK_INBAND_FM_CAPS_BW_MODE_MIN NVBIT64(2)
#define NVLINK_INBAND_FM_CAPS_BW_MODE_HALF NVBIT64(3)
#define NVLINK_INBAND_FM_CAPS_BW_MODE_3QUARTER NVBIT64(4)
typedef struct
{
@@ -108,7 +118,8 @@ typedef struct
NvU64 gpaAddressRange; /* GPU GPA address range */
NvU64 flaAddress; /* FLA starting address for the GPU */
NvU64 flaAddressRange; /* GPU FLA address range */
NvU8 reserved[32]; /* For future use. Must be initialized to zero */
NvU32 linkMaskToBeReduced; /* bit mask of unused NVLink ports for P2P */
NvU8 reserved[28]; /* For future use. Must be initialized to zero */
} nvlink_inband_gpu_probe_rsp_t;
typedef struct

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
Copyright (c) 2014-2022 NVidia Corporation
Copyright (c) 2014-2023 NVidia Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -120,6 +120,12 @@ struct nvlink_device
NvU32 numLinksPerIoctrl;
NvU32 numActiveLinksPerIoctrl;
//
// boolean indicating if a given device
// is a reduced nvlink config
//
NvBool bReducedNvlinkConfig;
// Client private information
void *pDevInfo;
};
@@ -397,6 +403,10 @@ NvBool nvlink_lib_is_initialized(void);
*/
NvBool nvlink_lib_is_device_list_empty(void);
/*
* Get if a device registerd to the nvlink corelib has a reduced nvlink config
*/
NvBool nvlink_lib_is_registerd_device_with_reduced_config(void);
/************************************************************************************************/
/************************** NVLink library driver-side interface ********************************/
@@ -456,15 +466,11 @@ NvlStatus nvlink_lib_set_link_master(nvlink_link *link);
*/
NvlStatus nvlink_lib_get_link_master(nvlink_link *link, nvlink_link **master);
/*
* Set the training state for the given link as non-ALI or ALI
*/
NvlStatus nvlink_lib_is_link_using_ALI(nvlink_link *link, NvBool *usingALI);
/*
* Set the training state for the given link as non-ALI or ALI
*/
NvlStatus nvlink_lib_link_set_training_mode(nvlink_link *link, NvBool enableALI);
/************************************************************************************************/
/*************************** NVLink topology discovery functions ********************************/
/************************************************************************************************/

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
Copyright (c) 2016-2022 NVidia Corporation
Copyright (c) 2016-2023 NVidia Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -154,7 +154,7 @@ typedef enum
nvlink_link_mode_enable_pm,
nvlink_link_mode_disable_pm,
nvlink_link_mode_traffic_setup,
nvlink_link_mode_contain
nvlink_link_mode_contain,
} nvlink_link_mode;
/* sublink tx modes */

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
Copyright (c) 2017-2020 NVidia Corporation
Copyright (c) 2017-2023 NVidia Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -297,7 +297,6 @@ nvlink_core_get_endpoint_state
NvU64 state = NVLINK_LINKSTATE_INVALID;
NvU64 dlState = NVLINK_LINKSTATE_INVALID;
NvU64 tlState = NVLINK_LINKSTATE_INVALID;
if ((link == NULL) || (linkState == NULL))
{
return;
@@ -309,7 +308,7 @@ nvlink_core_get_endpoint_state
// unless the corresponding HAL/Callbacks are not registered, which can
// happen during early development cycle. Adding an assert to catch that
// in debug builds.
//
//
status = link->link_handlers->get_dl_link_mode(link, &dlState);
nvlink_assert(status == NVL_SUCCESS);

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
Copyright (c) 2017-2020 NVidia Corporation
Copyright (c) 2017-2023 NVidia Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -3614,15 +3614,12 @@ nvlink_lib_ctrl_get_device_link_states
for (i = 0; i < numLinks; ++i)
{
// Check RxDet status of the link and repopulate as necessary
nvlink_core_get_rx_detect(&links[i], 1, 0);
// Get the endpoint states of the link
nvlink_core_get_endpoint_state(links[i], &(params->endStates[i]));
NVLINK_PRINT((DBG_MODULE_NVLINK_CORE, NVLINK_DBG_LEVEL_INFO,
"%s: link 0x%x -- rxDet status 0x%x, linkMode 0x%x,\n",
__FUNCTION__, i, links[i]->bRxDetected, params->endStates[i].linkMode));
"%s: link 0x%x -- linkMode 0x%x,\n",
__FUNCTION__, i, params->endStates[i].linkMode));
}

View File

@@ -384,70 +384,3 @@ nvlink_lib_link_set_training_mode
return status;
}
/**
* Get whether the link is using ALI for training.
*
* @param[in] link NVLink Link pointer
* @param[out] usingAli Boolean on whether ALI training is being used
*
* return NVL_SUCCESS if getting the variable is successful
*/
NvlStatus
nvlink_lib_is_link_using_ALI
(
nvlink_link *link,
NvBool *usingALI
)
{
NvlStatus status = NVL_SUCCESS;
usingALI = NV_FALSE;
if (link == NULL)
{
NVLINK_PRINT((DBG_MODULE_NVLINK_CORE, NVLINK_DBG_LEVEL_ERRORS,
"%s: Bad link pointer specified.\n",
__FUNCTION__));
return NVL_ERR_GENERIC;
}
// Acquire the top-level lock
status = nvlink_lib_top_lock_acquire();
if (status != NVL_SUCCESS)
{
NVLINK_PRINT((DBG_MODULE_NVLINK_CORE, NVLINK_DBG_LEVEL_ERRORS,
"%s: Failed to acquire top-level lock\n",
__FUNCTION__));
return status;
}
// Acquire the per-link lock
status = nvlink_lib_link_locks_acquire(&link, 1);
if (status != NVL_SUCCESS)
{
NVLINK_PRINT((DBG_MODULE_NVLINK_CORE, NVLINK_DBG_LEVEL_ERRORS,
"%s: Failed to acquire per-link locks\n",
__FUNCTION__));
// Release the top-level lock
nvlink_lib_top_lock_release();
return status;
}
//
// All the required per-link locks are successfully acquired
// The connection list traversal is also complete now
// Release the top level-lock
//
nvlink_lib_top_lock_release();
// TODO: Add Getter for per-link enableALI state variable
// Release the per-link lock
nvlink_lib_link_locks_release(&link, 1);
return status;
}

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
Copyright (c) 2019-2020 NVidia Corporation
Copyright (c) 2019-2023 NVidia Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -127,8 +127,8 @@ nvlink_lib_unload(void)
}
// Release and free top-level lock
nvlink_lib_top_lock_release();
nvlink_lib_top_lock_free();
nvlink_lib_top_lock_release();
nvlink_lib_top_lock_free();
}
return NVL_SUCCESS;
@@ -160,3 +160,40 @@ nvlink_lib_is_device_list_empty(void)
return isEmpty;
}
/*
* Get if a device registerd to the nvlink corelib has a reduced nvlink config
*
* return NV_TRUE if there is a device registered to the core library that is a reduced
* nvlink config device
*/
NvBool
nvlink_lib_is_registerd_device_with_reduced_config(void)
{
NvlStatus lock_status = NVL_SUCCESS;
nvlink_device *dev = NULL;
// Acquire top-level lock
lock_status = nvlink_lib_top_lock_acquire();
if (lock_status != NVL_SUCCESS)
{
NVLINK_PRINT((DBG_MODULE_NVLINK_CORE, NVLINK_DBG_LEVEL_ERRORS,
"%s: Failed to acquire top-level lock\n",
__FUNCTION__));
return NV_FALSE;
}
FOR_EACH_DEVICE_REGISTERED(dev, nvlinkLibCtx.nv_devicelist_head, node)
{
if (dev->bReducedNvlinkConfig == NV_TRUE)
{
return NV_TRUE;
}
}
// Release and free top-level lock
nvlink_lib_top_lock_release();
nvlink_lib_top_lock_free();
return NV_FALSE;
}