<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: USM Allocations with more than 4G in GPU Compute Software</title>
    <link>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753028#M2402</link>
    <description>&lt;P&gt;I posted the wrong error code. It's&amp;nbsp;CL_INVALID_BUFFER_SIZE instead of&amp;nbsp;CL_OUT_OF_RESOURCES.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2026 13:42:56 GMT</pubDate>
    <dc:creator>marcelld</dc:creator>
    <dc:date>2026-07-03T13:42:56Z</dc:date>
    <item>
      <title>USM Allocations with more than 4G</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753019#M2401</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to learn about how Intel USM works, because it looks similar to Nvidia UVM. I tried to run some code on my Intel ARC A770 in Ubuntu 26.04, but it seems like I am doing something wrong or I misunderstood the concept. Whenever I try to allocate more than 4G using USM it fails with&amp;nbsp;CL_OUT_OF_RESOURCES. Allocating more than 4G without using USM succeeds. I am using the flasg "-ze-intel-greater-than-4GB-buffer-required" as option to build the kernel. Furthermore, I set the 23rd bit in the clBuffer options when using no USM. Allocating memory via&amp;nbsp;clSharedMemAllocINTEL does not have an option to set the 23rd bit.&lt;/P&gt;&lt;P&gt;I have also tried the USM example code&amp;nbsp;300_smemhelloworld from &lt;A href="https://github.com/bashbaug/SimpleOpenCLSamples/" target="_blank" rel="noopener"&gt;https://github.com/bashbaug/SimpleOpenCLSamples/&lt;/A&gt;&amp;nbsp;and this also fails when increasing the buffer size over 4G.&lt;/P&gt;&lt;P&gt;Isn't it supposed to work also for larger buffers? As I understood the idea, the GPU can pagefault using shared memory and the driver will load pages into GPU memory. This looks like a solution for memory oversubscription to me. But when only buffers smaller than 4G are supported, this does not make any sense.&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Marcel&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2026 11:17:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753019#M2401</guid>
      <dc:creator>marcelld</dc:creator>
      <dc:date>2026-07-03T11:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: USM Allocations with more than 4G</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753028#M2402</link>
      <description>&lt;P&gt;I posted the wrong error code. It's&amp;nbsp;CL_INVALID_BUFFER_SIZE instead of&amp;nbsp;CL_OUT_OF_RESOURCES.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2026 13:42:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753028#M2402</guid>
      <dc:creator>marcelld</dc:creator>
      <dc:date>2026-07-03T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: USM Allocations with more than 4G</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753205#M2408</link>
      <description>&lt;P&gt;Hi, you may want to have a look at the RelaxAllocationLimits control in the OpenCL intercept layer to see how to do allocations greater than 4GB on GPUs like your A770:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/intel/opencl-intercept-layer/blob/main/docs/controls.md#relaxallocationlimits-bool" target="_blank"&gt;https://github.com/intel/opencl-intercept-layer/blob/main/docs/controls.md#relaxallocationlimits-bool&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Specifically, you'll need to do two things:&lt;/P&gt;&lt;P&gt;1. When you make your allocation, you'll want to add a CL_MEM_FLAGS property with bit 23 set.&amp;nbsp; This will allow the &amp;gt;4GB allocation to succeed:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/intel/opencl-intercept-layer/blob/12690fa58601cf228ac3e476274460b389e3ca7e/intercept/src/intercept.cpp#L9337" target="_blank"&gt;https://github.com/intel/opencl-intercept-layer/blob/12690fa58601cf228ac3e476274460b389e3ca7e/intercept/src/intercept.cpp#L9337&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2. When you compile a program that uses these &amp;gt;4GB allocations, you'll want to include the build option "-cl-intel-greater-than-4GB-buffer-required".&amp;nbsp; This will instruct the compiler to generate code that supports larger allocations, otherwise you may observe issues accessing the upper parts of your allocation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/intel/opencl-intercept-layer/blob/12690fa58601cf228ac3e476274460b389e3ca7e/intercept/src/intercept.h#L3088" target="_blank"&gt;https://github.com/intel/opencl-intercept-layer/blob/12690fa58601cf228ac3e476274460b389e3ca7e/intercept/src/intercept.h#L3088&lt;/A&gt;&lt;/P&gt;&lt;P&gt;With both of these change you should be able to allocate and use USM allocations greater than 4GB.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2026 16:46:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753205#M2408</guid>
      <dc:creator>Ben_A_Intel</dc:creator>
      <dc:date>2026-07-06T16:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: USM Allocations with more than 4G</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753214#M2409</link>
      <description>&lt;P&gt;Oh, even easier, looks like I have a sample in a branch that shows how to do this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/bashbaug/SimpleOpenCLSamples/compare/main...relaxed-allocations" target="_blank"&gt;https://github.com/bashbaug/SimpleOpenCLSamples/compare/main...relaxed-allocations&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the USM path, the sample uses device USM rather than shared USM, but it should be straightforward to switch it to shared USM if you'd like.&lt;/P&gt;&lt;P&gt;One word of caution: shared USM is intended to support automatic migration between the host and device, but it doesn't necessarily imply page faults and demand paging while the kernel is executing, therefore it's not necessarily a solution for memory oversubscription.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2026 18:52:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753214#M2409</guid>
      <dc:creator>Ben_A_Intel</dc:creator>
      <dc:date>2026-07-06T18:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: USM Allocations with more than 4G</title>
      <link>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753250#M2410</link>
      <description>&lt;P&gt;Thank you so much!&lt;BR /&gt;I was not aware of CL_MEM_FLAGS in cl_mem_properties_intel. It seems like this is not documented here:&amp;nbsp;&lt;A href="https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_unified_shared_memory.html#cl_mem_properties_intel" target="_blank"&gt;https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_unified_shared_memory.html#cl_mem_properties_intel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When I set the 23rd bit, the shared memory allocation succeeds.&lt;/P&gt;&lt;P&gt;USM does indeed not help with memory oversubscription. Does intel provide a solution for this? Or is using host memory the only way?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2026 07:04:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/GPU-Compute-Software/USM-Allocations-with-more-than-4G/m-p/1753250#M2410</guid>
      <dc:creator>marcelld</dc:creator>
      <dc:date>2026-07-07T07:04:31Z</dc:date>
    </item>
  </channel>
</rss>

