[SYCL] use malloc to support both iGPU and dGPU in same time #18992
+18
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the issue: #9241.
The host_buffer is used to create the copy of memory on devices.
The original code use the malloc_host() which bind with queue/devices.
When copy the memory from another device which has different context of malloc_host, the memcpy() is forbidden:
SYCL need both queues' context are same when copy memory between devices.
It's same for the memory created by malloc_host().
In the issue case, two dGPU belong to different context, the malloc_host() will be executed on the queue of second GPU.
When set the -ngl 48 (total 49), during load model, the tensor of first GPU will be copied to host_buffer based on queue of second GPU. It will trigger the error of L0.
To support iGPU+dGPU, we can't resolve it by add both GPUs' queue to same context. (iGPU and dGPU are different family and can't belong to same context).
So, we use the malloc() to replace the malloc_host() to support more multiple GPUs cases.
It won't impact the performance.