Giter VIP home page Giter VIP logo

Comments (4)

carojasq avatar carojasq commented on July 21, 2024

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.

jrprice avatar jrprice commented on July 21, 2024

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.

mz24cn avatar mz24cn commented on July 21, 2024

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.

jrprice avatar jrprice commented on July 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.