-1

I have two rtx3090 gpus, and i want to bind them in one context. but below code:

int main() {
    std::vector<sycl::device> devices = sycl::device::get_devices();
    std::vector<sycl::device> gpu_devices;
    for (const auto& device : devices) {
        std::cout<<device.get_info<sycl::info::device::name>()<<std::endl;
        if (device.get_info<sycl::info::device::name>().find("3090") != std::string::npos) {
            gpu_devices.push_back(device);
        }
    }
    sycl::context ctx(gpu_devices);
    return 0;
}

it throw error : what(): Can't add devices across platforms to a single context. -33 (PI_ERROR_INVALID_DEVICE)

And the output of this code is:

Platform: Intel(R) OpenCL 
Device: Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz 
Platform: Intel(R) OpenCL 
Device: Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz 
Platform: Intel(R) FPGA Emulation Platform for OpenCL(TM) 
Device: Intel(R) FPGA Emulation Device 
Platform: NVIDIA CUDA BACKEND 
Device: NVIDIA GeForce RTX 3090 
Platform: NVIDIA CUDA BACKEND 
Device: NVIDIA GeForce RTX 3090 

My expected output is

Platform: NVIDIA CUDA BACKEND
Device: NVIDIA GeForce RTX 3090
Device: NVIDIA GeForce RTX 3090

I want to know why the same GPU at different platform

1 Answer 1

0

It's not clear which version of oneAPI you are using here, but it does look quite old as far as I can tell. Earlier this year this patch was merged which should allow for your use-case to work. It was made available in the 2025.0 release of oneAPI. I don't have a multi-GPU setup here to be able to test this but downloading the new release of oneAPI will hopefully fix your problem!

Sign up to request clarification or add additional context in comments.

3 Comments

I use the latest release from the dpcpp offical and version is 2024.2.1 ,data is Aug. 5, 2024. And not only the gpus, but also the cpu was recognized in different platform.
I should have clarified in the post: oneAPI 2025.0 was released last week, and will have some updates that affect the code you're specifically trying. If that continues not to fix it please update!
... Alice, otherwise if you happen to have an AdaptiveCpp installation around - AdaptiveCpp has supported this use case since ~2020 and should work out of the box :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.