Coverage for cuda / core / system / _inforom.pxi: 70.00%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-08 01:07 +0000

1# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 

2# 

3# SPDX-License-Identifier: Apache-2.0 

4  

5  

6InforomObject = nvml.InforomObject 

7  

8  

9cdef class InforomInfo: 

10 cdef Device _device 

11  

12 def __init__(self, device: Device): 

13 self._device = device 1a

14  

15 def get_version(self, inforom: InforomObject) -> str: 

16 """ 

17 Retrieves the InfoROM version for a given InfoROM object. 

18  

19 For all products with an InfoROM. 

20  

21 Fermi™ and higher parts have non-volatile on-board memory for persisting 

22 device info, such as aggregate ECC counts. 

23  

24 Parameters 

25 ---------- 

26 inforom: :class:`InforomObject` 

27 The InfoROM object to query. 

28  

29 Returns 

30 ------- 

31 str 

32 The InfoROM version. 

33 """ 

34 return nvml.device_get_inforom_version(self._device._handle, inforom) 1a

35  

36 @property 

37 def image_version(self) -> str: 

38 """ 

39 Retrieves the global InfoROM image version. 

40  

41 For all products with an InfoROM. 

42  

43 Image version just like VBIOS version uniquely describes the exact 

44 version of the InfoROM flashed on the board in contrast to InfoROM 

45 object version which is only an indicator of supported features. 

46  

47 Returns 

48 ------- 

49 str 

50 The InfoROM image version. 

51 """ 

52 return nvml.device_get_inforom_image_version(self._device._handle) 1a

53  

54 @property 

55 def configuration_checksum(self) -> int: 

56 """ 

57 Retrieves the checksum of the configuration stored in the device's InfoROM. 

58  

59 For all products with an InfoROM. 

60  

61 Can be used to make sure that two GPUs have the exact same 

62 configuration. Current checksum takes into account configuration stored 

63 in PWR and ECC InfoROM objects. Checksum can change between driver 

64 releases or when user changes configuration (e.g. disable/enable ECC) 

65  

66 Returns 

67 ------- 

68 int 

69 The InfoROM checksum. 

70 """ 

71 return nvml.device_get_inforom_configuration_checksum(self._device._handle) 1a

72  

73 def validate(self) -> None: 

74 """ 

75 Reads the InfoROM from the flash and verifies the checksums. 

76  

77 For all products with an InfoROM. 

78  

79 Raises 

80 ------ 

81 :class:`cuda.core.system.CorruptedInforomError` 

82 If the device's InfoROM is corrupted. 

83 """ 

84 nvml.device_validate_inforom(self._device._handle) 1a

85  

86 @property 

87 def bbx_flush_time(self) -> tuple[int, int]: 

88 """ 

89 Retrieves the timestamp and duration of the last flush of the BBX 

90 (blackbox) InfoROM object during the current run. 

91  

92 For all products with an InfoROM. 

93  

94 Returns 

95 ------- 

96 tuple[int, int] 

97 - timestamp: The start timestamp of the last BBX flush 

98 - duration_us: The duration (in μs) of the last BBX flush 

99 """ 

100 return nvml.device_get_last_bbx_flush_time(self._device._handle) 1a

101  

102 @property 

103 def board_part_number(self) -> str: 

104 """ 

105 The device board part number which is programmed into the board's InfoROM. 

106 """ 

107 return nvml.device_get_board_part_number(self._device._handle) 1a