- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm developing a fluid simulator using DPC++, but the application's memory consumption grows so rapidly that practical simulation cannot be ran.
As kernel functions executed repeatedly, the memory consumption of my application monotonously grows. And, the memory growth will not reset even if sycl::queue is deleted.
I attached a small source code which reproduced the problem in my environment:
Windows 11 Enterprise
Microsoft Visual Studio Professional 2019 Version 16.11.8
Intel oneAPI 2021.4
Is there any idea for the cause, and possible solutions?
Thank you for your help in advance.
--- source code (which I failed to attach as a file) ---
#include <CL/sycl.hpp>
int main(int argc, char* argv[])
{
for (auto loop = 0; loop < 2; loop++)
{
std::cout << "loop #" << loop << std::endl;
sycl::queue queue(sycl::cpu_selector{});
auto* data = sycl::malloc_device<double>(1024, queue);
sycl::event e;
for (auto i = 0; i < 100000; i++)
{
e = queue.submit([data, e](sycl::handler& cgh)
{
cgh.depends_on(e);
cgh.parallel_for(sycl::range<1>(1024), [data](sycl::item<1> item)
{
data[item.get_linear_id()] = item.get_linear_id();
});
});
}
queue.wait();
sycl::free(data, queue);
}
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello- there has been an update from the development team. With the oneAPI 2022.1.0 compiler they are seeing the following memory consumption graph using massif, which seems to be in line with what is expected:
If you are still able to reproduce this issue with the latest version, could you please provide detailed steps (compilation and run commands) along with the compiler and OpenCL CPU runtime versions?
run commands for above graph:
$dpcpp test.cpp
$valgrind --tool=massif ./a.out
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
>>the memory consumption of my application monotonously grows And, the memory growth will not reset even if sycl::queue is deleted.
Could you please elaborate more about the above statement?
Also please do let us know, how did you test the memory consumption of the application?
Also could you please confirm the issue with the latest version of oneAPI which is 2022.1?
Thanks & Regards,
Noorjahan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Noorjahan.
I've tested my application with Visual Studio's "Diagnostic Tools".
When I change the source code to loop the first for-loop 100 times, the process memory grows from 100MB to 900MB.
I've also confirmed the issue with the latest version (Intel oneAPI 2022.1)
(please see the image attached: 2021.4.png and 2022.1.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found a lead: changing /O* compiler option solved the issue.
/O2 : memory grows monotonously, as reported above.
/Od : memory growth is reasonable (please see the attached file)
I'm wondering if I am missing something important, or if this is a bug in the compiler...
Anyway, I need a more practical solution (other than using /Od option forever),
since /Od option slows down the application compared to /O2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We are working on your issue. We will get back to you soon.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Noorjahan,
I'm glad to hear that. thank you!
If it takes long to fix and you have any workaround for this issue, could you share the workarounds?
Because compile-with-/Od did not work for my project ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Shoeji - I have been looking at this issue. It has been reproduced, and I have gone ahead and filed a ticket on this directly with the development team. I will provide you updates as soon as development takes a look at this. Thank you for your patience.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello- there has been an update from the development team. With the oneAPI 2022.1.0 compiler they are seeing the following memory consumption graph using massif, which seems to be in line with what is expected:
If you are still able to reproduce this issue with the latest version, could you please provide detailed steps (compilation and run commands) along with the compiler and OpenCL CPU runtime versions?
run commands for above graph:
$dpcpp test.cpp
$valgrind --tool=massif ./a.out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the update!
I've confirmed that the memory growth issue seems to be solved on 2022.2.
As well as the code above, my application does not have the memory problem anymore!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page