Bugfix: don't use gpu if the user doesn't want to

This commit is contained in:
Laurent Clouet
2016-10-10 00:03:40 +02:00
parent 0873eec17e
commit 09eb650da2

View File

@@ -37,6 +37,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
import com.sheepit.client.Configuration.ComputeType;
import com.sheepit.client.Error.Type; import com.sheepit.client.Error.Type;
import com.sheepit.client.hardware.gpu.GPUDevice; import com.sheepit.client.hardware.gpu.GPUDevice;
import com.sheepit.client.os.OS; import com.sheepit.client.os.OS;
@@ -207,7 +208,7 @@ public class Job {
gui.status("Rendering project \"" + this.name + "\""); gui.status("Rendering project \"" + this.name + "\"");
RenderProcess process = getProcessRender(); RenderProcess process = getProcessRender();
String core_script = "import bpy\n" + "bpy.context.user_preferences.system.compute_device_type = \"%s\"\n" + "bpy.context.scene.cycles.device = \"%s\"\n" + "bpy.context.user_preferences.system.compute_device = \"%s\"\n"; String core_script = "import bpy\n" + "bpy.context.user_preferences.system.compute_device_type = \"%s\"\n" + "bpy.context.scene.cycles.device = \"%s\"\n" + "bpy.context.user_preferences.system.compute_device = \"%s\"\n";
if (getUseGPU() && config.getGPUDevice() != null) { if (getUseGPU() && config.getGPUDevice() != null && config.getComputeMethod() != ComputeType.CPU) {
core_script = String.format(core_script, "CUDA", "GPU", config.getGPUDevice().getCudaName()); core_script = String.format(core_script, "CUDA", "GPU", config.getGPUDevice().getCudaName());
} }
else { else {