Cycles: oneAPI: Fix DPC++ level issues for multi GPU execution

These changes introduce modifications to the SYCL queue creation
in OneapiDevice::create_queue. In case several DPC++ devices are
detected by Blender and exposed through it, we are now creating
a new SYCL context for each device, which allows us to prevent
execution failures due to some known issues in the DPC++ runtime
regarding multi GPU support. As this would have some small
performance impact, few percents, it is only applied to
multi GPU configurations, while the behavior for a single
GPU configuration remains the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/141834
This commit is contained in:
Nikita Sirgienko
2025-07-14 14:33:42 +02:00
committed by Nikita Sirgienko
parent 33973970a5
commit 609f8ddbef

View File

@@ -995,9 +995,19 @@ bool OneapiDevice::create_queue(SyclQueue *&external_queue,
if (device_index < 0 || device_index >= devices.size()) {
return false;
}
sycl::queue *created_queue = new sycl::queue(devices[device_index],
sycl::property::queue::in_order());
sycl::queue *created_queue = nullptr;
if (devices.size() == 1) {
created_queue = new sycl::queue(devices[device_index], sycl::property::queue::in_order());
}
else {
sycl::context device_context(devices[device_index]);
created_queue = new sycl::queue(
device_context, devices[device_index], sycl::property::queue::in_order());
LOG_DEBUG << "Separate context was generated for the new queue, as several available SYCL devices were detected";
}
external_queue = reinterpret_cast<SyclQueue *>(created_queue);
# ifdef WITH_EMBREE_GPU
if (embree_device_pointer) {
RTCDevice *device_object_ptr = reinterpret_cast<RTCDevice *>(embree_device_pointer);