Knowledge Base Article
Error: Found 2 platforms! Failed to initialize the device
Description
If you run the OpenCL board_test example demo, the following errors may occur:
[root@localhost boardtest]# ./boardtest_host
Boardtest usage information
Usage: boardtest_host [--device d] [--test t]
--device d: device number (0 - NUM_DEVICES-1)
--test t: test number (0 - 7)
(The default is running all tests on all devices.)
Found 2 platforms!
Failed to initialize the device. Please check the following:
1. The card is visible to your host operating system
2. There is a valid OpenCL design currently configured on the card
3. You've installed all necessary drivers
4. You've linked the host program with the correct libraries for your specific card
Resolution
This is due to the wrong number of platforms in the board_test example demo host code.
To workaround this problem, you should change the platform number from 1 to 2, follow the steps below:
1. Edit the file main.cpp:
sudo vim main.cpp
2. Change Line 132:
if (num_platforms != 1) {
printf("Found %d platforms!\n", num_platforms);
dump_init_error();
freeResources();
return 1;
}
----
if (num_platforms != 2) {
printf("Found %d platforms!\n", num_platforms);
dump_init_error();
freeResources();
return 1;
}
In addition, you can also update the host code to use the “findPlatform” call to select the Intel® FPGA SDK for OpenCL™ platform.