<?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>i.MX ProcessorsのトピックThe results I get using GPU (UMAT) are worse than on CPU(MAT)</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070328#M157224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;I'm trying to compare the performance of OpeCV algorithms on CPU and on GPU using OpenCL capabilities on the IMX8M.&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;The results I get using GPU (UMAT) are worse than on CPU(MAT).&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;I was checking the gputop and top tools while running and I saw some activity on GPU while running functions using GPU (UMAT), however, CPU was always between 95% to 100% on CPU and on GPU functions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;I added the above lines to local.conf file:&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;IMAGE_INSTALL_append = " \&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; gputop \&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;"&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;IMAGE_INSTALL_append = " imx-gpu-viv opencv-dev"&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;IMAGE_INSTALL_append = " opencv opencv-samples"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be the problem?&lt;/P&gt;&lt;P&gt;Am I missing some compilation flag?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2020 12:50:30 GMT</pubDate>
    <dc:creator>boris_sch1</dc:creator>
    <dc:date>2020-08-06T12:50:30Z</dc:date>
    <item>
      <title>The results I get using GPU (UMAT) are worse than on CPU(MAT)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070328#M157224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;I'm trying to compare the performance of OpeCV algorithms on CPU and on GPU using OpenCL capabilities on the IMX8M.&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;The results I get using GPU (UMAT) are worse than on CPU(MAT).&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;I was checking the gputop and top tools while running and I saw some activity on GPU while running functions using GPU (UMAT), however, CPU was always between 95% to 100% on CPU and on GPU functions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;I added the above lines to local.conf file:&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;IMAGE_INSTALL_append = " \&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; gputop \&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;"&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;IMAGE_INSTALL_append = " imx-gpu-viv opencv-dev"&lt;/SPAN&gt;&lt;BR style="color: #1c2933; background-color: #ffffff; font-size: 13px;" /&gt;&lt;SPAN style="color: #1c2933; background-color: #ffffff; font-size: 13px;"&gt;IMAGE_INSTALL_append = " opencv opencv-samples"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be the problem?&lt;/P&gt;&lt;P&gt;Am I missing some compilation flag?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2020 12:50:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070328#M157224</guid>
      <dc:creator>boris_sch1</dc:creator>
      <dc:date>2020-08-06T12:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: The results I get using GPU (UMAT) are worse than on CPU(MAT)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070329#M157225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please share the Linux BSP that you are using, and the board that you have, in order to see the amount of memory that you are having in your system.&amp;nbsp; We will like to try to replicate to see this issue. Which version of OpenCV you use with your CPU.&amp;nbsp; Do you use any patch for the GPU?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any details even the example to replicate would be great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2020 15:49:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070329#M157225</guid>
      <dc:creator>jamesbone</dc:creator>
      <dc:date>2020-08-06T15:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: The results I get using GPU (UMAT) are worse than on CPU(MAT)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070330#M157226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using yocto warrior-fsl-4.19.35-mx8mq-v1.0 from:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/varigit/variscite-bsp-platform.git" rel="nofollow" style="color: #3366bb !important; background: none transparent; text-decoration: underline;"&gt;https://github.com/varigit/variscite-bsp-platform.git&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My OpenCV version is 4.0.1&lt;/P&gt;&lt;P&gt;Here is the OpenCL info:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/109853i54F93770B6F9557E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have any patches for GPU.&amp;nbsp;&lt;/P&gt;&lt;P&gt;GPU memory is 256MB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code example:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int testUMAT ()&lt;BR /&gt;{&lt;BR /&gt; int counter = 100;&lt;/P&gt;&lt;P&gt;bool isImshow = true;&lt;BR /&gt; std::chrono::steady_clock::time_point begin;&lt;BR /&gt; std::chrono::steady_clock::time_point end;&lt;/P&gt;&lt;P&gt;cv::Mat testMat (768,1024,CV_8UC1 );&lt;BR /&gt; cv::Mat testNuc (768,1024,CV_8UC1 );&lt;/P&gt;&lt;P&gt;// Defining GPU matrices&lt;BR /&gt; cv::UMat testMatGpu , testNucGpu, testMatTarget;&lt;/P&gt;&lt;P&gt;// Randomizing image&lt;BR /&gt; cv::randu(testMat, 0, (int)pow(2, 8));&lt;BR /&gt; cv::randu(testNuc, 0, (int)pow(2, 8));&lt;/P&gt;&lt;P&gt;testMat.copyTo(testMatGpu);&lt;BR /&gt; testNuc.copyTo(testNucGpu);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; auto start = chrono::high_resolution_clock::now();&lt;BR /&gt; for(int i=0;i&amp;lt;counter;i++)&lt;BR /&gt; {&lt;BR /&gt; cv::multiply(testMatGpu, testNucGpu, testNucGpu);&lt;BR /&gt; }&lt;BR /&gt; auto end = chrono::high_resolution_clock::now();&lt;/P&gt;&lt;P&gt;auto duration = chrono::duration_cast&amp;lt;chrono::microseconds&amp;gt;(end - start);&lt;BR /&gt; cout &amp;lt;&amp;lt; "End test:" &amp;lt;&amp;lt; duration.count() / (1000.0 * counter) &amp;lt;&amp;lt; endl;&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Aug 2020 12:43:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1070330#M157226</guid>
      <dc:creator>boris_sch1</dc:creator>
      <dc:date>2020-08-08T12:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: The results I get using GPU (UMAT) are worse than on CPU(MAT)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1210538#M167640</link>
      <description>&lt;P&gt;OpenCV in the i.MX Linux BSP uses the ARM NEON accelerators and not the GPU. That's why the CPU load is so high. I think when you force it to the GPU with UMat, then you get only little support by the GPU and the rest is done on the CPUs. If you work with Mat, then the CPUs and NEON are used - and this seems to be more efficient.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 16:59:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/The-results-I-get-using-GPU-UMAT-are-worse-than-on-CPU-MAT/m-p/1210538#M167640</guid>
      <dc:creator>bernhardfink</dc:creator>
      <dc:date>2021-01-12T16:59:15Z</dc:date>
    </item>
  </channel>
</rss>

