Comments (4)
Also I'm trying to compile enabling the macros for 1.2 compatibility.
g++ -g headerexampleCL2.cpp -I../../Cpp_common -lOpenCL -std=c++11 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_CL_1_2_DEFAULT_BUILD -o HeaderExample
But I got the same segmetation fault.
[1] 13090 segmentation fault (core dumped) ./HeaderExample
From dmesg:
[13840.526151] HeaderExample[13090]: segfault at 0 ip (null) sp 00007ffff433aaa8 error 14 in HeaderExample[400000+1c000]
Compilation verbose log: http://pastebin.com/82LRSS28
from opencl-clhpp.
Can you give details of the device and driver version you are trying to run this with?
Can you also run this with GDB and get a backtrace to give an indication of where the crash is coming from?
I'm able to successfully run this example on AMD GPUs. This example uses OpenCL 2.0 features, so requires recent hardware and drivers to run.
from opencl-clhpp.
Hi @jrprice, I am also encounter segmentation fault issue on cl2.hpp. I cannot fire a bug on Khronos bugzilla so I came here:
1, I forget my bugzilla account password, I use "Forgot Password" link to send a password-reset link(hotmail.com email), tried twice, no email was received.
2, Then I try to register a new account, no sign-up link on https://www.khronos.org/bugzilla/ .
here is the minimum code to reproduce the issue:
#define CL_HPP_ENABLE_EXCEPTIONS
#define CL_HPP_TARGET_OPENCL_VERSION 200
#include <cl2.hpp>
//#define __CL_ENABLE_EXCEPTIONS
//#include <CL/cl.hpp>
#include <vector>
#include <iostream>
std::vectorcl::Device computeDevices;
cl::Device dev;
int main(int argc, char** argv)
{
std::vectorcl::Platform platforms;
try {
cl::Platform::get(&platforms);
}
catch (cl::Error&) {
return 1;
}
for (auto& platform : platforms) {
std::vectorcl::Device devices;
try {
platform.getDevices(CL_DEVICE_TYPE_GPU, &devices);
}
catch (cl::Error&) {
continue;
}
for (auto& device : devices) {
std::string name = device.getInfo<CL_DEVICE_NAME>();
computeDevices.push_back(device);
// dev = device;
}
}
std::cout << computeDevices.size() << std::endl;
return 0;
}
Note:
1, switch to cl.hpp, the issue is gone.
2, comment out "computeDevices.push_back(device);" and use the line "dev = device", segmentation fault occurs in other function when exiting; if "dev = device" only executes once, the issue disappeared.
3, I run the program on Windows 10, both NVIDIA CUDA OpenCL 1.2 driver and AMD APP SDK OpenCL 2.0 driver are installed (two discrete GPU installed).
from opencl-clhpp.
Closing stale issue. Please reopen if the original issue is still present with the latest headers/drivers.
I believe the comment from @mz24cn relates to issue #17 which has now been addressed.
from opencl-clhpp.
Related Issues (20)
- enqueueMapBuffer() missing explicit command queue argument HOT 1
- Error when using external cl headers HOT 2
- Please keep releases and tags in sync HOT 4
- Trivial example fails HOT 3
- Add support for cl_command_buffer_khr
- MacOS CI builds are broken
- A curious name collision bug HOT 9
- how to handle extension API function pointers
- Semaphore support breaks compilation with clang HOT 1
- `cl_image_desc desc = {0}` is not valid C++ zero initialization. HOT 2
- Command Buffer Extension API Corner Cases HOT 1
- Naming Inconsistency for Extension Objects HOT 3
- new warning: deleting void is undefined HOT 1
- add a preprocessor enable for provisional extensions or features
- Assessment of the difficulty in porting CPU architecture for OpenCL-CLHPP
- Default values for options BUILD_EXAMPLES and BUILD_DOCS HOT 1
- clCreateCommandQueueWithProperties does not support properties like CL_QUEUE_PRIORITY_KHR CL_QUEUE_THROTTLE_KHR
- No Device-parametrized versions of compile()? HOT 1
- Missing tests for compile overloads. HOT 1
- should we use strings or char pointers to pass string data?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencl-clhpp.