- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I'm new to sycl. The following code is modified from an example in sycl specification
The code can run on cpu, but when trying to run GPU (use "gpu_selector_v"), it shows run time error:
like Unhandled exception at 0x00007FFC636B051C in XXXXX.exe: Microsoft C++ exception: sycl::_V1::compile_program_error at memory location 0x0000000B7D757A70.
I use Visual Studio 2022 with Intel oneapi base toolkit (2023.0). GPU is Intel Arc A770.
BTW, I do can run oneapi dpc++ example: "oneAPI-samples-2023.0.0\DirectProgramming\DPC++\CombinationalLogic\mandelbrot" on GPU.
Thanks for your help.
Best
___________________
const int N = 1024;
const int L = 256;
sycl::buffer<int> valuesBuf(N);
{
sycl::host_accessor a(valuesBuf,sycl::write_only);
for (int i = 0; i < N; i++) {
a[i] = i;
}
//destruct host_accessor
}
int sumResult = 0;
sycl::buffer<int> sumBuf(&sumResult, 1);
sycl::queue Q(sycl::gpu_selector_v);
Q.submit([&](sycl::handler& cgh) {
auto inputValues = valuesBuf.get_access<sycl::access_mode::read>(cgh);
auto sumReduction = sycl::reduction(sumBuf, cgh, sycl::plus<>());
cgh.parallel_for(sycl::nd_range<1> {N, L}, sumReduction,
[=](sycl::nd_item<1> it, auto& sum) {
sum += inputValues[it.get_global_id()];
});
});
int sum = numeric_limits<int>::max();
{
sycl::host_accessor sumBuf_hacc(sumBuf, sycl::read_only);
sum = sumBuf_hacc[0];
}
___________________________________________________
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel Communities.
Could you please try following the below steps:
1.Try changing your global and local range for example (N=512, L=512 or N=512, L=256).
If your issue still persists, then please provide the below details:
2. Could you please provide your OS and Hardware details
3. Could you please add the below lines of code in the sample code of mandelbrot and provide us with the output/results of the sample mandelbrot code while running it on GPU(visual studio output)?
cout << "Device max work group size: " <<d.get_info<info::device::max_work_group_size>() << "\n";
cout << "Device max work item dimensions: " <<d.get_info<info::device::max_work_item_dimensions>() << "\n";
4. And also, could you please let us know the Visual Studio 2022 version you are using? Please check the below link for the Visual Studio compatibility with Intel Compilers
Thanks & Regards,
Varsha
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel Communities.
Could you please try following the below steps:
1.Try changing your global and local range for example (N=512, L=512 or N=512, L=256).
If your issue still persists, then please provide the below details:
2. Could you please provide your OS and Hardware details
3. Could you please add the below lines of code in the sample code of mandelbrot and provide us with the output/results of the sample mandelbrot code while running it on GPU(visual studio output)?
cout << "Device max work group size: " <<d.get_info<info::device::max_work_group_size>() << "\n";
cout << "Device max work item dimensions: " <<d.get_info<info::device::max_work_item_dimensions>() << "\n";
4. And also, could you please let us know the Visual Studio 2022 version you are using? Please check the below link for the Visual Studio compatibility with Intel Compilers
Thanks & Regards,
Varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply, Varsha. It looks like not a max work group size issue. I compared a DPC++ project example provided by Visual Studio with my SYCL project. After changing some project properties, the code can run on my GPU.
Anyway, I appreciate your help!
Best
PC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Sorry to bother you, but i have met a same problem with the same error.
Could you please tell me how to fix it?
Thanks a lot for your help.
Thanks & Regards
Lzy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Eventually I found that I made a stupid mistake. My GPU does not support "double" (FP64), so do not try to compile "double" on your GPU. Hope this could offer some help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your response. This method has indeed successfully resolved my issue. I sincerely appreciate your assistance. Thank you.
Best wishes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>After changing some project properties, the code can run on my GPU.
Glad to know that your issue is resolved.
>>I appreciate your help!
Thanks for accepting the solution. This thread will no longer be monitored by Intel. If you have any other queries, please start a new thread.
Have a good day!
Thanks & Regards,
Varsha
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page