<?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: iMX8QM Multi-GPU Configuration &amp;amp; OpenCL Support in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1696195#M209980</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/81607"&gt;@sbertrand&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;From the i.MX Graphics User's Guide, page 63-64, you can find the environment variable `VIV_MGPU_AFFINITY`. The GPU is in combined mode by default (if not set). You can set either:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;VIV_MGPU_AFFINITY=1:0, to assign GPU0.&lt;/LI&gt;&lt;LI&gt;VIV_MGPU_AFFINITY=1:1, to assign GPU1.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In GStreamer, if you have multi-capture, you can set a GPU per pipeline. If you need any combination, you can use &lt;A title="gst-interpipe" href="https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_Building_and_Installation_Guide" target="_blank" rel="noopener"&gt;gst-interpipe&lt;/A&gt; as well.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Leon&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2023 00:22:06 GMT</pubDate>
    <dc:creator>luisleon</dc:creator>
    <dc:date>2023-08-01T00:22:06Z</dc:date>
    <item>
      <title>iMX8QM Multi-GPU Configuration &amp; OpenCL Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1694379#M209816</link>
      <description>&lt;P&gt;I am looking for further information about multi-GPU configuration on iMX8QM.&lt;/P&gt;&lt;P&gt;I would like to expand from this&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-Graphics/About-Multi-GPU-Configuration/m-p/1504543" target="_self"&gt;previous post.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the &lt;A href="https://www.nxp.com/docs/en/user-guide/IMX_GRAPHICS_USERS_GUIDE.pdf" target="_self"&gt;i.MX Graphics User's Guide&lt;/A&gt;&amp;nbsp;the following configuration are reported :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;8.2 Multi-GPU configurations&lt;BR /&gt;Vivante Multi-GPU IP may be configured into one of the following behavior model through software:&lt;BR /&gt;• Combined Mode where two (or more) GPU cores in the multi-GPU design behave in concert. Driver presents multi-GPU to SW application as a single logical GPU. The multiple GPUs work in the same virtual address space and share the same MMU page table. The multiple GPUs fetch and execute a shared Command Buffer.&lt;BR /&gt;• Independent Mode where each GPU in the multi-GPU design performs independently. The multiple GPUs work in different virtual address spaces but share the same MMU page table. Each GPU core fetches and executes its own Command Buffer. This enables different SW applications to run simultaneously on different GPU cores.&lt;BR /&gt;• OpenCL API allows application to handle the multi-GPU Independent Mode directly, as each GPU core in a multi-GPU design represents an independent OpenCL Compute Device.&lt;/P&gt;&lt;P&gt;8.4 OpenCL on multi-GPU device&lt;BR /&gt;OpenCL driver works in bridged mode as single logical compute device. In this configuration, multiple GPUs in the device operate as individual OpenCL Compute Devices. The OpenCL application is responsible to assign and dispatch the compute tasks to each GPU (Compute Device). The following OpenCL APIs return the list of compute devices available on a platform, and the device information.&lt;/P&gt;&lt;P&gt;cl_int clGetDeviceIDs (cl_platform_id platform, cl_device_type device_type, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices)&lt;/P&gt;&lt;P&gt;cl_int clGetDeviceInfo (cl_device_id device, cl_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This combined and independent mode can be seen in the kernel driver enum &lt;EM&gt;&lt;U&gt;gceMULTI_GPU_MODE&lt;/U&gt;&lt;/EM&gt;. However those are not referenced anywhere.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;typedef enum _gceMULTI_GPU_MODE&lt;BR /&gt;{&lt;BR /&gt;gcvMULTI_GPU_MODE_COMBINED = 0,&lt;BR /&gt;gcvMULTI_GPU_MODE_INDEPENDENT = 1&lt;BR /&gt;}&lt;BR /&gt;gceMULTI_GPU_MODE;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;From the platform, I get the following OpenCL information&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;$ clinfo -l&lt;BR /&gt;Platform #0: Vivante OpenCL Platform&lt;BR /&gt;`-- Device #0: Vivante OpenCL Device GC7000XSVX.6009.0000 &amp;nbsp;&lt;/P&gt;&lt;P&gt;$ clinfo&lt;/P&gt;&lt;P&gt;Number of platforms 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Platform Name Vivante OpenCL Platform&lt;BR /&gt;Number of devices 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Device Name Vivante OpenCL Device GC7000XSVX.6009.0000&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Device Vendor Vivante Corporation&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Device Vendor ID 0x564956&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Device Version OpenCL 3.0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Device Numeric Version 0xc00000 (3.0.0)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Driver Version OpenCL 3.0 V6.4.3.p4.398061&lt;BR /&gt;[..]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Max compute units 2&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;We do have 1 platform with 1 device providing 2 compute units. This indicates the system is configured in Combined Mode.&lt;/P&gt;&lt;P&gt;Overall I am just a bit confused between Compute Device and Compute Unit.&lt;BR /&gt;The OpenCL API&amp;nbsp;clGetDeviceIDs and&amp;nbsp;clGetDeviceInfo are used by clinfo.&lt;/P&gt;&lt;P&gt;How would we configured the system in Independent Mode ?&lt;BR /&gt;I would expect to see 2 devices being listed with 1 compute unit each. So &lt;EM&gt;&lt;U&gt;The OpenCL application is responsible to assign and dispatch the compute tasks to each GPU (Compute Device)&lt;/U&gt;&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to be able to select the compute device from gstreamer plugings.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Element Properties:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; device : OpenCL device&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; flags: readable, writable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Enum "GstOclDevicesEnum" Default: 0, "Vivante Corporation GPU"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (0): Vivante Corporation GPU - Vivante OpenCL Device GC7000XSVX.6009.0000&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 17:35:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1694379#M209816</guid>
      <dc:creator>sbertrand</dc:creator>
      <dc:date>2023-07-27T17:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM Multi-GPU Configuration &amp; OpenCL Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1696195#M209980</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/81607"&gt;@sbertrand&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;From the i.MX Graphics User's Guide, page 63-64, you can find the environment variable `VIV_MGPU_AFFINITY`. The GPU is in combined mode by default (if not set). You can set either:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;VIV_MGPU_AFFINITY=1:0, to assign GPU0.&lt;/LI&gt;&lt;LI&gt;VIV_MGPU_AFFINITY=1:1, to assign GPU1.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In GStreamer, if you have multi-capture, you can set a GPU per pipeline. If you need any combination, you can use &lt;A title="gst-interpipe" href="https://developer.ridgerun.com/wiki/index.php/GstInterpipe_-_Building_and_Installation_Guide" target="_blank" rel="noopener"&gt;gst-interpipe&lt;/A&gt; as well.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Leon&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 00:22:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1696195#M209980</guid>
      <dc:creator>luisleon</dc:creator>
      <dc:date>2023-08-01T00:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: iMX8QM Multi-GPU Configuration &amp; OpenCL Support</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1702445#M210549</link>
      <description>&lt;P&gt;Testing Multi-GPU with SoftISP from IMX-GPU-SDK&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;~# clinfo | grep -i -e name -e unit&lt;BR /&gt;Platform Name Vivante OpenCL Platform&lt;BR /&gt;Platform Name Vivante OpenCL Platform&lt;BR /&gt;Device Name Vivante OpenCL Device GC7000XSVX.6009.0000&lt;BR /&gt;Max compute units 2&lt;/P&gt;&lt;P&gt;~# VIV_MGPU_AFFINITY=1:0 clinfo | grep -i -e name -e unit&lt;BR /&gt;Platform Name Vivante OpenCL Platform&lt;BR /&gt;Platform Name Vivante OpenCL Platform&lt;BR /&gt;Device Name Vivante OpenCL Device GC7000XSVX.6009.0000&lt;BR /&gt;Max compute units 1&lt;/P&gt;&lt;P&gt;~# VIV_MGPU_AFFINITY=1:1 clinfo | grep -i -e name -e unit&lt;BR /&gt;Platform Name Vivante OpenCL Platform&lt;BR /&gt;Platform Name Vivante OpenCL Platform&lt;BR /&gt;Device Name Vivante OpenCL Device GC7000XSVX.6009.0000&lt;BR /&gt;Max compute units 1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Starting interrupts are&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;~# cat /proc/interrupts | grep gal&lt;BR /&gt;137: 29879 0 0 0 0 0 GICv3 96 Level galcore:0&lt;BR /&gt;138: 20088 0 0 0 0 0 GICv3 97 Level galcore:3d-1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Running SoftISP on first unit&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;~# VIV_MGPU_AFFINITY=1:0 /opt/imx-gpu-sdk/OpenCL/SoftISP/OpenCL.SoftISP&lt;BR /&gt;Denoise status: false&lt;BR /&gt;CycleNum status: 1000&lt;BR /&gt;Initializing device(s)...&lt;BR /&gt;Get the Device info and select Device...&lt;BR /&gt;# of Devices Available = 1&lt;BR /&gt;# of Compute Units = 1&lt;BR /&gt;# compute units = 1&lt;BR /&gt;Getting device id...&lt;BR /&gt;Creating Command Queue...&lt;BR /&gt;Creating kernels...&lt;BR /&gt;Please wait for compiling and building kernels, about one minute...&lt;BR /&gt;Kernel execution time on GPU (kernel: badpixel): 11.126999999999999 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: sigma): 1.6630559999999948 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: awb): 1.803011000000001 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize1): 3.069138000000005 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize2): 0.27961299999999895 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize3): 2.587928000000001 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: debayer): 7.999 ms&lt;/P&gt;&lt;P&gt;~# cat /proc/interrupts | grep gal&lt;BR /&gt;137: 39930 0 0 0 0 0 GICv3 96 Level galcore:0&lt;BR /&gt;138: 20088 0 0 0 0 0 GICv3 97 Level galcore:3d-1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Running SoftISP on second unit&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;~# VIV_MGPU_AFFINITY=1:1 /opt/imx-gpu-sdk/OpenCL/SoftISP/OpenCL.SoftISP&lt;BR /&gt;Denoise status: false&lt;BR /&gt;CycleNum status: 1000&lt;BR /&gt;Initializing device(s)...&lt;BR /&gt;Get the Device info and select Device...&lt;BR /&gt;# of Devices Available = 1&lt;BR /&gt;# of Compute Units = 1&lt;BR /&gt;# compute units = 1&lt;BR /&gt;Getting device id...&lt;BR /&gt;Creating Command Queue...&lt;BR /&gt;Creating kernels...&lt;BR /&gt;Please wait for compiling and building kernels, about one minute...&lt;BR /&gt;Kernel execution time on GPU (kernel: badpixel): 11.206999999999999 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: sigma): 1.6622440000000023 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: awb): 1.694835000000004 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize1): 3.034601999999997 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize2): 0.3158639999999996 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize3): 2.4953949999999994 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: debayer): 8.116 ms&lt;/P&gt;&lt;P&gt;~# cat /proc/interrupts | grep gal&lt;BR /&gt;137: 39930 0 0 0 0 0 GICv3 96 Level galcore:0&lt;BR /&gt;138: 30080 0 0 0 0 0 GICv3 97 Level galcore:3d-1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Running SoftISP on combined units&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;~# /opt/imx-gpu-sdk/OpenCL/SoftISP/OpenCL.SoftISP&lt;BR /&gt;Denoise status: false&lt;BR /&gt;CycleNum status: 1000&lt;BR /&gt;Initializing device(s)...&lt;BR /&gt;Get the Device info and select Device...&lt;BR /&gt;# of Devices Available = 1&lt;BR /&gt;# of Compute Units = 2&lt;BR /&gt;# compute units = 2&lt;BR /&gt;Getting device id...&lt;BR /&gt;Creating Command Queue...&lt;BR /&gt;Creating kernels...&lt;BR /&gt;Please wait for compiling and building kernels, about one minute...&lt;BR /&gt;Kernel execution time on GPU (kernel: badpixel): 5.635 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: sigma): 1.7863699999999962 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: awb): 1.0335089999999996 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize1): 2.8791019999999947 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize2): 0.2856570000000003 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: equalize3): 1.272296 ms&lt;BR /&gt;Kernel execution time on GPU (kernel: debayer): 4.1739999999999995 ms&lt;/P&gt;&lt;P&gt;~# cat /proc/interrupts | grep gal&lt;BR /&gt;137: 49767 0 0 0 0 0 GICv3 96 Level galcore:0&lt;BR /&gt;138: 35092 0 0 0 0 0 GICv3 97 Level galcore:3d-1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 22:06:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8QM-Multi-GPU-Configuration-amp-OpenCL-Support/m-p/1702445#M210549</guid>
      <dc:creator>sbertrand</dc:creator>
      <dc:date>2023-08-09T22:06:15Z</dc:date>
    </item>
  </channel>
</rss>

