From 806521f7037a5a50bba9d332ab5de3b0172c5a22 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 31 Oct 2021 13:18:28 +0100 Subject: Fix T92671: confusing Cycles debug logs about CPU architecture Instead of printing debug flags listing various CPU and GPU settings that may or may not be used, print when we are using them. This include CPU kernel types, OptiX debugging and CUDA and HIP adaptive compilation. BVH type was already printed. --- intern/cycles/blender/python.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/python.cpp b/intern/cycles/blender/python.cpp index 20bf6385999..bb9b0a74424 100644 --- a/intern/cycles/blender/python.cpp +++ b/intern/cycles/blender/python.cpp @@ -157,8 +157,6 @@ static PyObject *init_func(PyObject * /*self*/, PyObject *args) DebugFlags().running_inside_blender = true; - VLOG(2) << "Debug flags initialized to:\n" << DebugFlags(); - Py_RETURN_NONE; } @@ -885,8 +883,6 @@ static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args) debug_flags_sync_from_scene(b_scene); - VLOG(2) << "Debug flags set to:\n" << DebugFlags(); - debug_flags_set = true; Py_RETURN_NONE; @@ -896,7 +892,6 @@ static PyObject *debug_flags_reset_func(PyObject * /*self*/, PyObject * /*args*/ { debug_flags_reset(); if (debug_flags_set) { - VLOG(2) << "Debug flags reset to:\n" << DebugFlags(); debug_flags_set = false; } Py_RETURN_NONE; -- cgit v1.2.3 From 6bc54cddfbf78fd880d5183e8949f19236ad0aaa Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 31 Oct 2021 13:30:56 +0100 Subject: Fix Cycles logging some excessive detail with default --debug-cycles --- intern/cycles/blender/camera.cpp | 2 +- intern/cycles/blender/curves.cpp | 25 ++----------------------- intern/cycles/blender/sync.cpp | 4 +++- 3 files changed, 6 insertions(+), 25 deletions(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/camera.cpp b/intern/cycles/blender/camera.cpp index f87ebe39d21..b5afcfa7fda 100644 --- a/intern/cycles/blender/camera.cpp +++ b/intern/cycles/blender/camera.cpp @@ -639,7 +639,7 @@ void BlenderSync::sync_camera_motion( /* TODO(sergey): De-duplicate calculation with camera sync. */ float fov = 2.0f * atanf((0.5f * sensor_size) / bcam.lens / aspectratio); if (fov != cam->get_fov()) { - VLOG(1) << "Camera " << b_ob.name() << " FOV change detected."; + VLOG(3) << "Camera " << b_ob.name() << " FOV change detected."; if (motion_time == 0.0f) { cam->set_fov(fov); } diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp index fb2b329e61d..ffe0c553738 100644 --- a/intern/cycles/blender/curves.cpp +++ b/intern/cycles/blender/curves.cpp @@ -304,10 +304,6 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa } } - if (num_curves > 0) { - VLOG(1) << "Exporting curve segments for mesh " << hair->name; - } - hair->reserve_curves(hair->num_curves() + num_curves, hair->get_curve_keys().size() + num_keys); num_keys = 0; @@ -356,7 +352,7 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa /* check allocation */ if ((hair->get_curve_keys().size() != num_keys) || (hair->num_curves() != num_curves)) { - VLOG(1) << "Allocation failed, clearing data"; + VLOG(1) << "Hair memory allocation failed, clearing data."; hair->clear(true); } } @@ -412,16 +408,11 @@ static void export_hair_motion_validate_attribute(Hair *hair, if (num_motion_keys != num_keys || !have_motion) { /* No motion or hair "topology" changed, remove attributes again. */ if (num_motion_keys != num_keys) { - VLOG(1) << "Hair topology changed, removing attribute."; - } - else { - VLOG(1) << "No motion, removing attribute."; + VLOG(1) << "Hair topology changed, removing motion attribute."; } hair->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION); } else if (motion_step > 0) { - VLOG(1) << "Filling in new motion vertex position for motion_step " << motion_step; - /* Motion, fill up previous steps that we might have skipped because * they had no motion, but we need them anyway now. */ for (int step = 0; step < motion_step; step++) { @@ -437,16 +428,12 @@ static void export_hair_motion_validate_attribute(Hair *hair, static void ExportCurveSegmentsMotion(Hair *hair, ParticleCurveData *CData, int motion_step) { - VLOG(1) << "Exporting curve motion segments for hair " << hair->name << ", motion step " - << motion_step; - /* find attribute */ Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); bool new_attribute = false; /* add new attribute if it doesn't exist already */ if (!attr_mP) { - VLOG(1) << "Creating new motion vertex position attribute"; attr_mP = hair->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION); new_attribute = true; } @@ -682,10 +669,6 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair) const int num_keys = b_hair.points.length(); const int num_curves = b_hair.curves.length(); - if (num_curves > 0) { - VLOG(1) << "Exporting curve segments for hair " << hair->name; - } - hair->reserve_curves(num_curves, num_keys); /* Export curves and points. */ @@ -743,15 +726,11 @@ static void export_hair_curves(Scene *scene, Hair *hair, BL::Hair b_hair) static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_step) { - VLOG(1) << "Exporting curve motion segments for hair " << hair->name << ", motion step " - << motion_step; - /* Find or add attribute. */ Attribute *attr_mP = hair->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); bool new_attribute = false; if (!attr_mP) { - VLOG(1) << "Creating new motion vertex position attribute"; attr_mP = hair->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION); new_attribute = true; } diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp index e0a13625962..cf0b77a9b16 100644 --- a/intern/cycles/blender/sync.cpp +++ b/intern/cycles/blender/sync.cpp @@ -366,7 +366,9 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background) if ((preview && !preview_scrambling_distance) || use_adaptive_sampling) scrambling_distance = 1.0f; - VLOG(1) << "Used Scrambling Distance: " << scrambling_distance; + if (scrambling_distance != 1.0f) { + VLOG(3) << "Using scrambling distance: " << scrambling_distance; + } integrator->set_scrambling_distance(scrambling_distance); if (get_boolean(cscene, "use_fast_gi")) { -- cgit v1.2.3 From cedc80c08d8340cb7db8af52051f9a6f9469fcb7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 31 Oct 2021 21:59:21 +0100 Subject: Fix Cycles denoising depth pass missing in compositor --- intern/cycles/blender/addon/engine.py | 1 + 1 file changed, 1 insertion(+) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index c402df12ba9..e5bb77a834a 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -233,6 +233,7 @@ def list_render_passes(scene, srl): if crl.denoising_store_passes: yield ("Denoising Normal", "XYZ", 'VECTOR') yield ("Denoising Albedo", "RGB", 'COLOR') + yield ("Denoising Depth", "Z", 'VALUE') # Custom AOV passes. for aov in srl.aovs: -- cgit v1.2.3 From 28eaa81f1e9a59c41b58834fcef6b5f3581a2581 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 31 Oct 2021 22:23:37 +0100 Subject: Fix Cycles Python warnings when removed OpenCL device was enabled --- intern/cycles/blender/addon/properties.py | 21 ++++++++++++++------- intern/cycles/blender/addon/version_update.py | 8 +++++++- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 1e98e6d0a7c..c92e0ec65af 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1360,7 +1360,7 @@ class CyclesPreferences(bpy.types.AddonPreferences): elif entry.type == 'CPU': cpu_devices.append(entry) # Extend all GPU devices with CPU. - if compute_device_type != 'CPU': + if len(devices) and compute_device_type != 'CPU': devices.extend(cpu_devices) return devices @@ -1378,12 +1378,18 @@ class CyclesPreferences(bpy.types.AddonPreferences): self.refresh_devices() return None + def get_compute_device_type(self): + if self.compute_device_type == '': + return 'NONE' + return self.compute_device_type + def get_num_gpu_devices(self): import _cycles - device_list = _cycles.available_devices(self.compute_device_type) + compute_device_type = self.get_compute_device_type() + device_list = _cycles.available_devices(compute_device_type) num = 0 for device in device_list: - if device[1] != self.compute_device_type: + if device[1] != compute_device_type: continue for dev in self.devices: if dev.use and dev.id == device[2]: @@ -1425,15 +1431,16 @@ class CyclesPreferences(bpy.types.AddonPreferences): row = layout.row() row.prop(self, "compute_device_type", expand=True) - if self.compute_device_type == 'NONE': + compute_device_type = self.get_compute_device_type() + if compute_device_type == 'NONE': return row = layout.row() - devices = self.get_devices_for_type(self.compute_device_type) - self._draw_devices(row, self.compute_device_type, devices) + devices = self.get_devices_for_type(compute_device_type) + self._draw_devices(row, compute_device_type, devices) import _cycles has_peer_memory = 0 - for device in _cycles.available_devices(self.compute_device_type): + for device in _cycles.available_devices(compute_device_type): if device[3] and self.find_existing_device_entry(device).use: has_peer_memory += 1 if has_peer_memory > 1: diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index b3e8e755903..90ed8873c02 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -86,7 +86,7 @@ def do_versions(self): # Device might not currently be available so this can fail try: if system.legacy_compute_device_type == 1: - prop.compute_device_type = 'OPENCL' + prop.compute_device_type = 'NONE' # Was OpenCL elif system.legacy_compute_device_type == 2: prop.compute_device_type = 'CUDA' else: @@ -97,6 +97,12 @@ def do_versions(self): # Init device list for UI prop.get_devices(prop.compute_device_type) + if bpy.context.preferences.version <= (3, 0, 40): + # Disable OpenCL device + prop = bpy.context.preferences.addons[__package__].preferences + if prop['compute_device_type'] == 4: + prop.compute_device_type = 'NONE' + # We don't modify startup file because it assumes to # have all the default values only. if not bpy.data.is_saved: -- cgit v1.2.3