in src/local_gpu_verifier/src/verifier/nvml/__init__.py [0:0]
def fetch_attestation_report(self, index, nonce):
""" Fetches the attestation report of the GPU.
Args:
index (int): index of the GPU.
nonce (bytes): then nonce.
Raises:
AttestationReportFetchError: it is raised if the attestation report
could not be fetched.
Returns:
[bytes]: the raw attestation report data.
"""
try:
attestation_report_struct = function_wrapper_with_timeout([nvmlDeviceGetConfComputeGpuAttestationReport,
self.Handles[index],
nonce,
"nvmlDeviceGetConfComputeGpuAttestationReport"],
BaseSettings.MAX_NVML_TIME_DELAY)
length_of_attestation_report = attestation_report_struct.attestationReportSize
attestation_report = attestation_report_struct.attestationReport
attestation_report_data = list()
for i in range(length_of_attestation_report):
attestation_report_data.append(attestation_report[i])
bin_attestation_report_data = bytes(attestation_report_data)
BaseSettings.mark_attestation_report_as_available()
return bin_attestation_report_data
except TimeoutError as err:
raise TimeoutError("\tThe call to fetch attestation report timed out.")
except Exception as err:
info_log.error(err)
err_msg = "\tSomething went wrong while fetching the attestation report from the gpu."
event_log.error(err_msg)
raise AttestationReportFetchError(err_msg)