Mismatch in testing denoise device for Apple Silicon #15

Open
opened 2024-09-24 20:37:54 +02:00 by Mark Bolstad · 1 comment

If you build under debug and try to render scene_monkey.xml, it throws an assertion:

Assertion failed: (id != info.id || (type == info.type && num == info.num && description == info.description)), function operator==, file device.h, line 124.

The call is from Session::Session trying to compare if the device and denoise_device are the same and if so, sets them equal, but the Device::operator== claims that if they're the same it would be "very bad" and throws an assert.

If you build under debug and try to render scene_monkey.xml, it throws an assertion: Assertion failed: (id != info.id || (type == info.type && num == info.num && description == info.description)), function operator==, file device.h, line 124. The call is from Session::Session trying to compare if the device and denoise_device are the same and if so, sets them equal, but the Device::operator== claims that if they're the same it would be "very bad" and throws an assert.
Author

Poking around, the problem is that the denoise_device is partially uninitialized in standalone. I temporarily fixed it with this in cycles_standalone.cpp (it duplicates the default device or picks the first device that's not the default device if there's more than one. The 'tcp' line is from a change I'm making to make cycles run distributed):
diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles>
index f6d05cadc95..bc33b0a39fd 100644
--- a/intern/cycles/app/cycles_standalone.cpp
+++ b/intern/cycles/app/cycles_standalone.cpp
@@ -555,7 +555,16 @@ so it should look something like: -b tcp://*:5555",
bool device_available = false;
if (!devices.empty()) {
options.session_params.device = devices.front();

  • options.session_params.denoise_device = options.session_params.device;
    device_available = true;
  • // Find a suitable denoise device
  • foreach (DeviceType type, types) {
  •  if (type != device_type) {
    
  •    vector<DeviceInfo> compute_devices = Device::available_devices(DEVICE_>
    
  •    options.session_params.denoise_device = compute_devices.front();
    
  •    break;
    
  •  }
    
  • }
    }

/* handle invalid configurations */

Poking around, the problem is that the denoise_device is partially uninitialized in standalone. I temporarily fixed it with this in cycles_standalone.cpp (it duplicates the default device or picks the first device that's not the default device if there's more than one. The 'tcp' line is from a change I'm making to make cycles run distributed): diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles> index f6d05cadc95..bc33b0a39fd 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -555,7 +555,16 @@ so it should look something like: -b tcp://*:5555", bool device_available = false; if (!devices.empty()) { options.session_params.device = devices.front(); + options.session_params.denoise_device = options.session_params.device; device_available = true; + // Find a suitable denoise device + foreach (DeviceType type, types) { + if (type != device_type) { + vector<DeviceInfo> compute_devices = Device::available_devices(DEVICE_> + options.session_params.denoise_device = compute_devices.front(); + break; + } + } } /* handle invalid configurations */
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: blender/cycles#15
No description provided.