Merge pull request #1996 from alicevision/fix/gpuName

[core] Stats: Retrieve and set the GPU name if it is found
This commit is contained in:
Loïc Vital 2023-04-26 11:58:14 +02:00 committed by GitHub
commit ad9d549a40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,6 +96,11 @@ class ComputerStatistics:
smiTree = ET.fromstring(xmlGpu)
gpuTree = smiTree.find('gpu')
try:
self.gpuName = gpuTree.find('product_name').text
except Exception as e:
logging.debug('Failed to get gpuName: "{}".'.format(str(e)))
pass
try:
gpuMemoryUsed = gpuTree.find('fb_memory_usage').find('used').text.split(" ")[0]
self._addKV('gpuMemoryUsed', gpuMemoryUsed)
@ -105,6 +110,7 @@ class ComputerStatistics:
try:
self.gpuMemoryTotal = gpuTree.find('fb_memory_usage').find('total').text.split(" ")[0]
except Exception as e:
logging.debug('Failed to get gpuMemoryTotal: "{}".'.format(str(e)))
pass
try:
gpuUsed = gpuTree.find('utilization').find('gpu_util').text.split(" ")[0]