Exemple #1
0
 def read_top_card_memory_in_bytes():
     # pylint: disable=no-member
     # pylint incorrectly detects that function nvmlDeviceGetMemoryInfo returns str
     return self.__nvml_get_or_else(lambda: [
         nvmlDeviceGetMemoryInfo(nvmlDeviceGetHandleByIndex(card_index))
         .total for card_index in range(nvmlDeviceGetCount())
     ],
                                    default=0)
Exemple #2
0
 def get_card_used_memory_in_bytes(self, card_index):
     # pylint: disable=no-member
     # pylint incorrectly detects that function nvmlDeviceGetMemoryInfo returns str
     return self.__nvml_get_or_else(lambda: nvmlDeviceGetMemoryInfo(
         nvmlDeviceGetHandleByIndex(card_index)).used)