mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
commit
8eaef0b367
2 changed files with 17 additions and 6 deletions
|
@ -95,23 +95,34 @@ class ComputerStatistics:
|
|||
return
|
||||
try:
|
||||
p = subprocess.Popen([self.nvidia_smi, "-q", "-x"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
if sys.version_info[0] == 2:
|
||||
# no timeout in python-2
|
||||
xmlGpu, stdError = p.communicate()
|
||||
else:
|
||||
xmlGpu, stdError = p.communicate(timeout=10) # 10 seconds
|
||||
|
||||
smiTree = ET.fromstring(xmlGpu)
|
||||
gpuTree = smiTree.find('gpu')
|
||||
|
||||
try:
|
||||
self._addKV('gpuMemoryUsed', gpuTree.find('fb_memory_usage').find('used').text.split(" ")[0])
|
||||
gpuMemoryUsed = gpuTree.find('fb_memory_usage').find('used').text.split(" ")[0]
|
||||
self._addKV('gpuMemoryUsed', gpuMemoryUsed)
|
||||
except Exception as e:
|
||||
logging.debug('Failed to get gpuMemoryUsed: "{}".'.format(str(e)))
|
||||
pass
|
||||
try:
|
||||
self._addKV('gpuUsed', gpuTree.find('utilization').find('gpu_util').text.split(" ")[0])
|
||||
self.gpuMemoryTotal = gpuTree.find('fb_memory_usage').find('total').text.split(" ")[0]
|
||||
except Exception as e:
|
||||
pass
|
||||
try:
|
||||
gpuUsed = gpuTree.find('utilization').find('gpu_util').text.split(" ")[0]
|
||||
self._addKV('gpuUsed', gpuUsed)
|
||||
except Exception as e:
|
||||
logging.debug('Failed to get gpuUsed: "{}".'.format(str(e)))
|
||||
pass
|
||||
try:
|
||||
self._addKV('gpuTemperature', gpuTree.find('temperature').find('gpu_temp').text.split(" ")[0])
|
||||
gpuTemperature = gpuTree.find('temperature').find('gpu_temp').text.split(" ")[0]
|
||||
self._addKV('gpuTemperature', gpuTemperature)
|
||||
except Exception as e:
|
||||
logging.debug('Failed to get gpuTemperature: "{}".'.format(str(e)))
|
||||
pass
|
||||
|
|
|
@ -360,7 +360,7 @@ class ViewpointWrapper(QObject):
|
|||
return None
|
||||
focalLength = self.solvedIntrinsics["focalLength"]
|
||||
sensorHeight = self.solvedIntrinsics["sensorHeight"]
|
||||
return 2.0 * math.atan(sensorHeight / (2.0 * float(focalLength))) * 180 / math.pi
|
||||
return 2.0 * math.atan(float(sensorHeight) / (2.0 * float(focalLength))) * 180.0 / math.pi
|
||||
|
||||
@Property(type=QUrl, notify=denseSceneParamsChanged)
|
||||
def undistortedImageSource(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue