def init_nvml()

in src/local_gpu_verifier/src/verifier/cc_admin.py [0:0]


def init_nvml(standalone_mode: bool):
    """Method to Initialize NVML library"""
    try:
        event_log.debug("Initializing the nvml library")
        NvmlHandler.init_nvml()

        # Ensuring that the system is running either in Confidential Compute mode or PPCIE mode
        if not NvmlHandler.is_cc_enabled() and not NvmlHandler.is_ppcie_mode_enabled():
            event_log.debug(
                "The confidential compute is",
                NvmlHandler.is_cc_enabled(),
                "and the PPCIE mode is",
                NvmlHandler.is_ppcie_mode_enabled(),
            )
            err_msg = (
                "The confidential compute feature and PPCIE mode is disabled !! Exiting now. Please enable one of "
                "the feature and try again"
            )
            info_log.error(err_msg)
            sys.exit()

        if NvmlHandler.is_ppcie_mode_enabled() and standalone_mode:
            err_msg = (
                "Attestation Failed! Attestation in standalone mode is not supported for PPCIE system. Exiting "
                "now."
            )
            info_log.error(err_msg)
            sys.exit()

        if NvmlHandler.is_cc_dev_mode():
            info_log.info("The system is running in CC DevTools mode !!")

    except Exception as error:
        info_log.error(
            "Error occurred while initializing the NVML library. Error: %s", error
        )
        sys.exit()