Difference between revisions of "R-Car/Boards/Yocto-Gen3/OpenCL"
< R-Car | Boards/Yocto-Gen3
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOC right}} | {{TOC right}} | ||
== OpenCL support == | == OpenCL support == | ||
− | + | T.B.D | |
+ | <!-- | ||
The '''meta-opencl''' layers provide the following packages: | The '''meta-opencl''' layers provide the following packages: | ||
Line 20: | Line 21: | ||
'''Notes:''' | '''Notes:''' | ||
− | * OpenCL is currently supported on Renesas R-Car | + | * OpenCL is currently supported on the following boards: |
+ | ** Renesas R-Car H3/M3 SoC boards (Yocto 3.7.0 and above). | ||
+ | ** Renesas R-Car H3 SoC boards (prior to Yocto 3.7.0). | ||
* Luxoft ''renesas-opencl-sdk'' provides separate set of Caffe and clBlas libraries, and does not depend on ''caffe'' or ''clblas'' packages. | * Luxoft ''renesas-opencl-sdk'' provides separate set of Caffe and clBlas libraries, and does not depend on ''caffe'' or ''clblas'' packages. | ||
+ | |||
+ | == Downloading the prerequisites == | ||
+ | |||
+ | Download basic Yocto layers as described in ''Yocto Start-Up Guide'', and use the following commands to download ''meta-opencl'' layers: | ||
+ | <ol><li>Clone ''meta-opencl'' git repository along with the other Yocto layers: | ||
+ | <pre> | ||
+ | git clone https://github.com/CogentEmbedded/meta-opencl.git | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Switch to the proper branch: | ||
+ | <ul><li> | ||
+ | Yocto 2.12.0: | ||
+ | <pre> | ||
+ | git -C meta-opencl checkout v2.12.0 | ||
+ | </pre> | ||
+ | </li><li>Yocto 2.19.0: | ||
+ | <pre> | ||
+ | git -C meta-opencl checkout v2.19.0 | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Yocto 2.23.0: | ||
+ | <pre> | ||
+ | git -C meta-opencl checkout v2.23.0 | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Yocto 3.7.0: | ||
+ | <pre> | ||
+ | git -C meta-opencl checkout v3.7.0 | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Yocto 3.9.0: | ||
+ | <pre> | ||
+ | git -C meta-opencl checkout v3.9.0 | ||
+ | </pre> | ||
+ | </li></ul> | ||
+ | </li></ol> | ||
+ | Download the OpenGL/OpenCL combined GPU libraries using the following link: https://www.renesas.com/us/en/solutions/automotive/rcar-download/rcar-opencl.html | ||
+ | The zip archive should contain ''linux_gsx_binaries_cl_gles'' tarball that is to be used with ''meta-opencl/meta-ocl-rcar-gen3'' layer. | ||
+ | <br> | ||
+ | '''Note:''' Yocto 3.7.0 tarball can be used with Yocto 3.9.0 as well. | ||
== Enabling OpenCL support in Yocto for R-Car Gen3 boards == | == Enabling OpenCL support in Yocto for R-Car Gen3 boards == | ||
− | Set up Yocto as usual, and use the following steps to enable OpenCL support | + | |
− | before starting the build. | + | Set up Yocto as usual, and use the following steps to enable OpenCL support before starting the build. |
<ol><li> | <ol><li> | ||
− | Copy OpenCL/OpenGL binaries to the meta-opencl/meta-ocl-rcar-gen3 layer: | + | Copy OpenCL/OpenGL binaries to the ''meta-opencl/meta-ocl-rcar-gen3'' layer: |
+ | <ul><li> | ||
+ | Yocto 3.7.0 and above: | ||
+ | <pre> | ||
+ | DEST=meta-opencl/meta-ocl-rcar-gen3/recipes-graphics/cl-gles-module/cl-gles-user-module | ||
+ | for f in *_linux_gsx_binaries_cl_gles.tar.bz2; do | ||
+ | cp ${f} ${DEST}/${f#EVA_} && echo "Copied: ${f}" | ||
+ | done | ||
+ | </pre> | ||
+ | '''Note:''' Strip the ''EVA_'' prefix while copying when using evaluation version. | ||
+ | </li><li> | ||
+ | Prior to Yocto 3.7.0: | ||
<pre> | <pre> | ||
cp r8a7795_linux_gsx_binaries_cl_gles3.tar.bz2 meta-opencl/meta-ocl-rcar-gen3/recipes-graphics/cl-gles-module/cl-gles-user-module/ | cp r8a7795_linux_gsx_binaries_cl_gles3.tar.bz2 meta-opencl/meta-ocl-rcar-gen3/recipes-graphics/cl-gles-module/cl-gles-user-module/ | ||
</pre> | </pre> | ||
+ | </li></ul> | ||
</li><li> | </li><li> | ||
Add meta-python layer to ''BBLAYERS'' in ''bblayers.conf'' file: | Add meta-python layer to ''BBLAYERS'' in ''bblayers.conf'' file: | ||
Line 42: | Line 97: | ||
</pre> | </pre> | ||
</li><li> | </li><li> | ||
− | Replace all occurrences of gles-user-module with cl-gles-user-module, and add ''PREFERRED_PROVIDER_virtual/opencl'' variable equal to "cl-gles-user-module" in ''local.conf'': | + | Replace all occurrences of ''gles-user-module'' with ''cl-gles-user-module'', and add ''PREFERRED_PROVIDER_virtual/opencl'' variable equal to "cl-gles-user-module" in ''local.conf'': |
+ | <ul><li> | ||
+ | Yocto 2.23.0 and above: | ||
+ | <pre> | ||
+ | PREFERRED_PROVIDER_virtual/libgles2 = "cl-gles-user-module" | ||
+ | PREFERRED_PROVIDER_virtual/opencl = "cl-gles-user-module" | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Prior to Yocto 2.23.0: | ||
<pre> | <pre> | ||
PREFERRED_PROVIDER_virtual/libgles2 = "cl-gles-user-module" | PREFERRED_PROVIDER_virtual/libgles2 = "cl-gles-user-module" | ||
Line 48: | Line 111: | ||
PREFERRED_PROVIDER_virtual/opencl = "cl-gles-user-module" | PREFERRED_PROVIDER_virtual/opencl = "cl-gles-user-module" | ||
</pre> | </pre> | ||
+ | </li></ul> | ||
</li><li> | </li><li> | ||
− | Enable cl-gles-user-module instead of gles-user-module in ''local.conf'': | + | Enable ''cl-gles-user-module'' instead of ''gles-user-module'' in ''local.conf'': |
<pre> | <pre> | ||
PREFERRED_PROVIDER_gles-user-module = "cl-gles-user-module" | PREFERRED_PROVIDER_gles-user-module = "cl-gles-user-module" | ||
Line 119: | Line 183: | ||
<pre> | <pre> | ||
FORTRAN_forcevariable = ",fortran" | FORTRAN_forcevariable = ",fortran" | ||
− | RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath | + | RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath" |
IMAGE_INSTALL_append = " gfortran gfortran-symlinks libgfortran libgfortran-dev" | IMAGE_INSTALL_append = " gfortran gfortran-symlinks libgfortran libgfortran-dev" | ||
</pre> | </pre> | ||
Line 141: | Line 205: | ||
<pre> | <pre> | ||
IMAGE_INSTALL_append = " caffe-dev clblas-dev clblast-dev viennacl-dev openblas-dev" | IMAGE_INSTALL_append = " caffe-dev clblas-dev clblast-dev viennacl-dev openblas-dev" | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Prior to Yocto 3.7.0: disable ''cpio.gz'' image generation in ''local.conf'' to avoid 2GB cpio image size limitation issues: | ||
+ | <pre> | ||
+ | IMAGE_FSTYPES_remove = "cpio.gz" | ||
+ | </pre> | ||
+ | </li><li> | ||
+ | Remove Linux kernel sources and LTP to make SDK image smaller if necessary: | ||
+ | <pre> | ||
+ | IMAGE_INSTALL_remove = "kernel-devsrc ltp" | ||
</pre> | </pre> | ||
</li><li> | </li><li> | ||
Line 161: | Line 235: | ||
Finished 31 tests in 171.5 seconds: 31 passed, 0 failed (100.00%) | Finished 31 tests in 171.5 seconds: 31 passed, 0 failed (100.00%) | ||
</pre> | </pre> | ||
+ | |||
+ | '''Note:''' OpenCL unit test is included in the ''cl-gles-module-dev'' package which is added to ''core-image-weston-sdk'' by default. | ||
== Testing ViennaCL == | == Testing ViennaCL == | ||
Line 263: | Line 339: | ||
For further details, please refer to the documentation available at ''$RENESAS_OPENCL_SDK_ROOT/documents''. | For further details, please refer to the documentation available at ''$RENESAS_OPENCL_SDK_ROOT/documents''. | ||
+ | |||
+ | --> |