<?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: access violation in ippiCopy_8u_C3P3R in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269228#M27614</link>
    <description>&lt;P&gt;On a real world problem we have the following crash&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SDE ERROR:  TID: 0 executed instruction with an unaligned memory reference to address 0x2b4cc200490 INSTR: 0x7ff70d41829c: IFORM: VMOVNTDQ_MEMu32_YMMu32_AVX512 :: vmovntdq ymmword ptr [rax+r8*1], ymm19&lt;/LI-CODE&gt;
&lt;P&gt;With ImageSize of 1280,x1280 offset 0, step 1280 ; Image address 0x2b4cc200468&lt;/P&gt;
&lt;P&gt;With other images Sizes e.g. {3, 5, 31, 64, 640, 1276, 1284} there is no problem&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 14:11:22 GMT</pubDate>
    <dc:creator>JamesSmith</dc:creator>
    <dc:date>2021-03-30T14:11:22Z</dc:date>
    <item>
      <title>access violation in ippiCopy_8u_C3P3R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269215#M27613</link>
      <description>&lt;P&gt;I've got a strange access violation in the &lt;EM&gt;ippiCopy_8u_C3P3R&lt;/EM&gt; function on special condition.&lt;/P&gt;
&lt;P&gt;Calling the function below with a image-size of 1280 &amp;amp; an offset of 1 (as a starting point of a roi) crashes. The encountered error callstack :&lt;EM&gt; l9_owniCopy_8u_C3P3R_cn&amp;#30;() l9_ippiCopy_8u_C3P3R&amp;#30;()&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Run the application by&lt;EM&gt; sde-external&lt;/EM&gt; (8.63.0-2021-01-18-win) shows more details:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;SDE ERROR:  TID: 0 executed instruction with an unaligned memory reference to address 0x225c13a7056 INSTR: 0x7ff6ee12829c: IFORM: VMOVNTDQ_MEMu32_YMMu32_AVX512 :: vmovntdq ymmword ptr [rax+r8*1], ymm19&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The image Address &lt;EM&gt;dst[0]&lt;/EM&gt; is 0x225c13a7040.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We could meld down the problem to the AVX2 call with IPP 2019, 2020, 2021. Running the code on older hardware (no AVX2) or with IPP 9.0 works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Valid&lt;/STRONG&gt; size are for example {3, 64, 91, 150, 640, 1279, 1281} with any offset e.g. {0, 1, 3, 5, 16, 32, 64, 128}&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Invalid&lt;/STRONG&gt; size are for example {1280, 1280 + 640, 5120} with an offset e.g. not {0, 32, 64, 128}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;  void copy4pTest_Failure(const int size, const int offset)
  {
    IppiSize imageSize{ size, size };

    int stepHSV24;
    Ipp8u* pubHSV24 = ippiMalloc_8u_C3(imageSize.width, imageSize.height, &amp;amp;stepHSV24);

    int bufferOffset = 128;
    int stepDst[3];
    Ipp8u* dst[3];
    dst[0] = new unsigned char[imageSize.height * (imageSize.width + bufferOffset)];
    dst[1] = new unsigned char[imageSize.height * (imageSize.width + bufferOffset)];
    dst[2] = new unsigned char[imageSize.height * (imageSize.width + bufferOffset)];
    stepDst[0] = stepDst[1] = stepDst[2] = imageSize.width; // +bufferOffset;

    Ipp8u* dstRoi[3];
    dstRoi[0] = dst[0] + offset;
    dstRoi[1] = dst[1] + offset;
    dstRoi[2] = dst[2] + offset;

    IppiSize roi{ size, size };
    auto offsetMem = ((size_t) dst[0]) % 64;
    auto offsetMemRoi = ((size_t) dstRoi[0]) % 64;
    std::cout &amp;lt;&amp;lt; "X Offset " &amp;lt;&amp;lt; std::setw(3) &amp;lt;&amp;lt; offset &amp;lt;&amp;lt; " Mem Offset [ " &amp;lt;&amp;lt; std::setw(3) &amp;lt;&amp;lt; offsetMem &amp;lt;&amp;lt; " " &amp;lt;&amp;lt; std::setw(3) &amp;lt;&amp;lt; offsetMemRoi &amp;lt;&amp;lt; " ] Step "
               &amp;lt;&amp;lt; std::setw(5) &amp;lt;&amp;lt; stepDst[0] &amp;lt;&amp;lt; std::setw(5) &amp;lt;&amp;lt; " roi " &amp;lt;&amp;lt; std::setw(5) &amp;lt;&amp;lt; roi.width
               &amp;lt;&amp;lt; " 0x" &amp;lt;&amp;lt; std::hex &amp;lt;&amp;lt; (size_t) dstRoi[0] &amp;lt;&amp;lt; " img 0x" &amp;lt;&amp;lt; std::hex &amp;lt;&amp;lt; (size_t) dst[0] &amp;lt;&amp;lt; std::endl;

    auto state = ippiCopy_8u_C3P3R(pubHSV24, stepHSV24, dstRoi, stepDst[0], roi);
    asserIppReturnCode(state);

    delete[] dst[0];   delete[] dst[1];   delete[] dst[2];
    ippiFree(pubHSV24);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;IPP Version 2021.1.1, 2020.4.311, 2019.5.281, 9.0, Link static x64&lt;/LI&gt;
&lt;LI&gt;Windows Version 10.0.17763 Build 17763&lt;/LI&gt;
&lt;LI&gt;Prozessor Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz, 2592 MHz, 6 Kern(e),&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Visual Studio 2017 15.9.16 x64&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 30 Mar 2021 14:19:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269215#M27613</guid>
      <dc:creator>JamesSmith</dc:creator>
      <dc:date>2021-03-30T14:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: access violation in ippiCopy_8u_C3P3R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269228#M27614</link>
      <description>&lt;P&gt;On a real world problem we have the following crash&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SDE ERROR:  TID: 0 executed instruction with an unaligned memory reference to address 0x2b4cc200490 INSTR: 0x7ff70d41829c: IFORM: VMOVNTDQ_MEMu32_YMMu32_AVX512 :: vmovntdq ymmword ptr [rax+r8*1], ymm19&lt;/LI-CODE&gt;
&lt;P&gt;With ImageSize of 1280,x1280 offset 0, step 1280 ; Image address 0x2b4cc200468&lt;/P&gt;
&lt;P&gt;With other images Sizes e.g. {3, 5, 31, 64, 640, 1276, 1284} there is no problem&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 14:11:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269228#M27614</guid>
      <dc:creator>JamesSmith</dc:creator>
      <dc:date>2021-03-30T14:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: access violation in ippiCopy_8u_C3P3R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269593#M27617</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;
&lt;P&gt;We are looking into this issue and will get back to you as soon as we get any updates related to this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Abhishek&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 11:45:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269593#M27617</guid>
      <dc:creator>AbhishekD_Intel</dc:creator>
      <dc:date>2021-03-31T11:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: access violation in ippiCopy_8u_C3P3R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269979#M27620</link>
      <description>&lt;P&gt;Hi James.&lt;/P&gt;
&lt;P&gt;I confirm this issue with&amp;nbsp;ippiCopy_8u_C3P3R.&lt;/P&gt;
&lt;P&gt;As workaround you can disable IPP AVX2 code in initialization section of your application:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;    {
        Ipp64u features;
        ippInit();
        features = ippGetEnabledCpuFeatures();
        features &amp;amp;= (ippCPUID_AVX2 - 1);
        ippSetCpuFeatures(features);
    }
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;But it affects performance of all subsequent calls of IPP functions.&lt;/P&gt;
&lt;P&gt;The second workaround - to use only 64b aligned destination pointers.&lt;/P&gt;
&lt;P&gt;We will fix this issue in one of next IPP releases.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Andrey B.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 14:25:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1269979#M27620</guid>
      <dc:creator>Andrey_B_Intel</dc:creator>
      <dc:date>2021-04-01T14:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: access violation in ippiCopy_8u_C3P3R</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1271138#M27631</link>
      <description>&lt;P&gt;Hi Andy,&lt;/P&gt;
&lt;P&gt;thanks for your reply.&lt;/P&gt;
&lt;P&gt;The 64b alignment helps, we plan to change this.&lt;/P&gt;
&lt;P&gt;Disabling IPP AVX2 works but as you mentioned is not an option. &lt;/P&gt;
&lt;P&gt;If the IPP Release 2021.2.0.210 should fix this bug, release note "Extended optimizations for Intel® IPP Image Processing and Color Coversions functions for selected algorithms for Intel® Advanced Vector Extensions 512 (Intel® AVX-512)." it doesn't fix the crash on our real-world scenario. Do you need more details?&lt;/P&gt;
&lt;P&gt;I would expect, it shouldn't crash if the alignment is not as expected.&lt;/P&gt;
&lt;P&gt;Thanks a lot for your investigation in this issue.&lt;/P&gt;
&lt;P&gt;James S.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 08:21:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/access-violation-in-ippiCopy-8u-C3P3R/m-p/1271138#M27631</guid>
      <dc:creator>JamesSmith</dc:creator>
      <dc:date>2021-04-06T08:21:47Z</dc:date>
    </item>
  </channel>
</rss>

