speed up S3FD extraction for GPU with >= 11GB vram

This commit is contained in:
Colombo 2019-10-10 13:22:14 +04:00
parent 59ad734b6c
commit 63ecd4ec34

View file

@ -618,11 +618,19 @@ class ExtractSubprocessor(Subprocessor):
dev_name = nnlib.device.getDeviceName(idx) dev_name = nnlib.device.getDeviceName(idx)
dev_vram = nnlib.device.getDeviceVRAMTotalGb(idx) dev_vram = nnlib.device.getDeviceVRAMTotalGb(idx)
if not manual and (type == 'rects-dlib' or type == 'rects-mt' ): count = 1
for i in range ( int (max (1, dev_vram / 2) ) ):
result += [ (idx, 'GPU', '%s #%d' % (dev_name,i) , dev_vram) ] if not manual:
else: if (type == 'rects-dlib' or type == 'rects-mt' ):
count = int (max (1, dev_vram / 2) )
if type == 'rects-s3fd':
count = int (max (1, dev_vram / 5) )
if count == 1:
result += [ (idx, 'GPU', dev_name, dev_vram) ] result += [ (idx, 'GPU', dev_name, dev_vram) ]
else:
for i in range (count):
result += [ (idx, 'GPU', '%s #%d' % (dev_name,i) , dev_vram) ]
return result return result