You are not logged in.
Hi,
The Subject describes my problem by the facts i know about it. I am totaly newbe to this topic and can not figure out whats the problem because in my simple testprogramm the cl device and version is printed out correctly but creating a context results in segfault.
I have allready try to build in 32bit mode but same result.
I attached the simple test programm and the corresponding cmake file that i used to build.
my installed packages are the following
intel-opencl-runtime 1:16.1-1
OpenCL runtime for Intel Core and Xeon processors
intel-opencl-sdk 2016-5
Intel SDK for OpenCL Applications
ocl-icd 2.2.9-1
OpenCL ICD Bindings
opencl-headers 2:2.1.20151224-1
OpenCL (Open Computing Language) header files
my simple testprogramm gives infos about the cpu as follows:
Using platform : Intel(R) OpenCL
Using device : Intel(R) Core(TM) i7 CPU L 640 @ 2.13GHz
OpenCL version : OpenCL C 1.2
here is the test program
#include <iostream>
#define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.hpp>
int main(int argc, char** argv)
{
std::vector<cl::Platform> all_platforms;
cl::Platform::get(&all_platforms);
if(all_platforms.size()==0){
std::cout<<" No platforms found. Check OpenCL installation!\n";
exit(1);
}
cl::Platform default_platform=all_platforms[0];
//get default device of the default platform
std::vector<cl::Device> all_devices;
default_platform.getDevices(CL_DEVICE_TYPE_ALL, &all_devices);
if(all_devices.size()==0){
std::cout<<" No devices found. Check OpenCL installation!\n";
exit(1);
}
cl::Device default_device=all_devices[0];
std::cout << "Using platform : " << default_platform.getInfo<CL_PLATFORM_NAME>()<<"\n";
std::cout << "Using device : " << default_device.getInfo<CL_DEVICE_NAME>() <<"\n";
std::cout << "OpenCL version : " << default_device.getInfo<CL_DEVICE_OPENCL_C_VERSION>() <<"\n";
try {
cl_context_properties cps[3] = {
CL_CONTEXT_PLATFORM,
(cl_context_properties)(all_platforms[0])(),
0
};
cl::Context context(CL_DEVICE_TYPE_CPU, cps);
} catch(cl::Error error) {
std::cout << error.what() << "(" << error.err() << ")" << std::endl;
}
return 0;
}
and here the cmake file
project(OpenCLTest)
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_CXX_STANDARD 11)
find_package(OpenCL REQUIRED)
include_directories(${OpenCL_INCLUDE_DIRS})
link_directories(${OpenCL_LIBRARY})
aux_source_directory(. SRC_LST)
add_executable(${PROJECT_NAME} ${SRC_LST})
target_link_libraries(${PROJECT_NAME} ${OpenCL_LIBRARY})
Offline
I can't offer any help but I today I have an identical problem (segfault in clCreateContext) using intel-opencl-sdk 2016-5. My host code is written in C using CL/cl.h. Using beignet I do not have the segfault but my kernel code does not appear to run. Also completely new to openCL but I'll post back if I find a solution.
Offline
now i am using the AMD-APP SDK that works, also with c, but it would be nice to get this intel sdk running.
greetings
Offline
installing ncurses5-compat-libs solved the problem for me
Offline