Various fixes

- Do not enable CPU device together with OpenCL/CUDA when device name is not
  specified.
- Adopt output log parser fr the changed path tracing message.
- Solve issue with using same short name of command line argument for single
  device specification.
- Reshuffle include statements so it's kind of possible to use bundle python.
  Still need to work this properly, but that's for later.
This commit is contained in:
2017-11-01 16:07:46 +01:00
parent efd39a9e86
commit c41658857a
5 changed files with 8 additions and 5 deletions

View File

@@ -24,6 +24,9 @@ def setUseRequestedDevice(context,
device_found = False device_found = False
# Try to enable first non-display card. # Try to enable first non-display card.
for device in cpref.devices: for device in cpref.devices:
if device.type != device_type:
device.use = False
continue
if isDisplayDevice(device): if isDisplayDevice(device):
device.use = False device.use = False
elif not device_found or not device_single: elif not device_found or not device_single:
@@ -31,7 +34,7 @@ def setUseRequestedDevice(context,
device_found = True device_found = True
device.use = True device.use = True
else: else:
# Keep disanling rest of GPUs. # Keep disabling rest of GPUs.
device.use = False device.use = False
if not device_found: if not device_found:
# Only display devices, enable first of them. # Only display devices, enable first of them.

View File

@@ -7,7 +7,7 @@ class Stats:
def __init__(self): def __init__(self):
# Pepare some regex for parsing # Pepare some regex for parsing
self.re_path_tracing = re.compile( self.re_path_tracing = re.compile(
".*Path Tracing Tile ([0-9]+)/([0-9]+)" + ".*Rendered ([0-9]+)/([0-9]+) Tiles" +
"(, Sample ([0-9]+)\/([0-9]+))?$") "(, Sample ([0-9]+)\/([0-9]+))?$")
self.re_total_render_time = re.compile( self.re_total_render_time = re.compile(
".*Total render time: ([0-9]+(\.[0-9]+)?)") ".*Total render time: ([0-9]+(\.[0-9]+)?)")

View File

@@ -1,6 +1,5 @@
import json import json
import platform import platform
import psutil
import subprocess import subprocess
import sys import sys
@@ -77,6 +76,7 @@ def getNumPhysicalCPUs():
def gatherSystemInfo(ctx): def gatherSystemInfo(ctx):
import psutil
system_info = {} system_info = {}
system_info['bitness'] = platform.architecture()[0] system_info['bitness'] = platform.architecture()[0]
system_info['machine'] = platform.machine() system_info['machine'] = platform.machine()

View File

@@ -1,4 +1,3 @@
import dateutil
import foundation import foundation
from foundation import progress from foundation import progress
import os import os
@@ -134,6 +133,7 @@ def blenderCommitUnixTimestamp(commit_date, commit_time):
""" """
Convert commit build time and time to unix timestamp Convert commit build time and time to unix timestamp
""" """
import dateutil
date_time = commit_date + " " + commit_time date_time = commit_date + " " + commit_time
return dateutil.parser.parse(date_time) return dateutil.parser.parse(date_time)

View File

@@ -32,7 +32,7 @@ def configureArgumentParser():
parser.add_argument('-n', '--device-name', parser.add_argument('-n', '--device-name',
help="Device name to render on", help="Device name to render on",
default="") default="")
parser.add_argument('-s', '--device-single', parser.add_argument('-e', '--device-single',
help="Use single device when multiple matches", help="Use single device when multiple matches",
action='store_true', action='store_true',
default=False) default=False)