def retry()

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


def retry(nonce):
    """This function is used to retry the GPU attestation again in case of occurrence of
    certain types of exceptions.
    """
    global arguments_as_dictionary

    # Clean-up
    NvmlHandler.close_nvml()

    if BaseSettings.is_retry_allowed():
        info_log.info("Retrying the GPU attestation.")
        attest(arguments_as_dictionary)
        time.sleep(BaseSettings.MAX_TIME_DELAY)
    else:
        if NvmlHandler.is_cc_dev_mode():
            info_log.info("\tGPU is running in DevTools mode!!")
            if not arguments_as_dictionary["user_mode"]:
                if not NvmlHandler.get_gpu_ready_state():
                    info_log.info("\tSetting the GPU Ready State to READY")
                    NvmlHandler.set_gpu_ready_state(True)
                else:
                    info_log.info("\tGPU Ready State is already READY")