From df981f5c4d5b690648b05779d6f843d0fcc1c8d0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 16 Nov 2017 15:26:13 +0100 Subject: [PATCH] Correct logic around enabling display-only device configuration --- benchmark/configure.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark/configure.py b/benchmark/configure.py index 844f158..1965c53 100644 --- a/benchmark/configure.py +++ b/benchmark/configure.py @@ -22,6 +22,7 @@ def setUseRequestedDevice(context, # preferably non-display one. if requested_device == "": device_found = False + display_device = None # Try to enable first non-display card. for device in cpref.devices: if device.type != device_type: @@ -29,6 +30,7 @@ def setUseRequestedDevice(context, continue if isDisplayDevice(device): device.use = False + display_device = device elif not device_found or not device_single: # Enable first non-display GPU. device_found = True @@ -38,7 +40,7 @@ def setUseRequestedDevice(context, device.use = False if not device_found: # Only display devices, enable first of them. - cpref.devices[0].use = True + display_device.use = True device_found = True else: device_found = False