Knowledge Base Article
Error: Unable to find Intel(R) FPGA OpenCL platform
Description
When you compile and run an OpenCL™ design for emulation using the Intel® FPGA SDK for OpenCL™ version 19.3 and later, you may see the following error:
ERROR: Unable to find Intel(R) FPGA OpenCL platform
This message may be generated by the host code when the call to the clGetPlatformIDs() function returns CL_PLATFORM_NOT_FOUND_KHR. This error can occur if the correct version of libstdc .so is not found.
The emulator in Intel FPGA SDK for OpenCL™ Pro Edition is built with a specific version of gcc as part of the offline compiler. For example, version 19.3 of the SDK is built with GCC 6.3.0 and version 20.1 is built with GCC 7.2.0. The version of libstdc .so must be at least as new as the version used to build the SDK.
This requirement is now included in the Intel FPGA SDK for OpenCL Pro Edition: Getting Started Guide.
Resolution
To work around this problem, your Linux system must use the gcc version corresponding to your version of the SDK or newer. The process for installing the required GCC version differs depending on the host operating system.
Instructions for Ubuntu are included in the Intel FPGA SDK for OpenCL Pro Edition: Getting Started Guide.
On Linux versions CentOS 6 / CentOS 7 or RHEL 6 / RHEL 7, using yum to install GCC doesn’t update the library correctly.
To get a compatible libstdc .so, build and install GCC from source using the following instructions. The example uses gcc version 7.2.0. Your version may be different.
1. Download the tarball of the GCC version you want to install.
wget http://www.netgull.com/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.gz
2. Unpack the tar archive and change the current working directory
tar zxf gcc-7.2.0.tar.gz
cd gcc-7.2.0
3. Install bzip2 and run the ‘download_prerequisites’ script to download some prerequisites needed by GCC. You have to run this from the top level of the GCC source tree.
yum -y install bzip2
./contrib/download_prerequisites
4. Once the prerequisites are downloaded execute the following command to start configuring the GCC build environment
./configure --disable-multilib --enable-languages=c,c
5. Once it is completed, run the following command to compile the source code. (Compilation may take a few hours to complete.)
make -j 4
make install
6. Build and run the design for emulation again to confirm the problem is corrected.