[bug ?] clSetKernelArg segfaults

Hello,

I just wrote and ran an incorrect code :

err = clSetKernelArg(zero_, 0, sizeof(cl_mem), (void*)&dst);

[error check}

err = clSetKernelArg(zero_, 0, sizeof(int), (void*)&size);

[error check]

As you can see, I set ‘0’ two times as argument index, that’s why it’s incorrect.

But instead of returning an error code, the second call … segfaulted !

I think this is not a normal behavior… no ?

I use OpenCL 1.1 :

CL_PLATFORM_NAME: NVIDIA CUDA

CL_PLATFORM_VERSION: OpenCL 1.1 CUDA 3.2.1

with driver 258.19

I get a seg fault with clCreateContext for the following code:

cl_platform_id platform;

    status = clGetPlatformIDs(1, &platform, NULL);

    cout<<"clGetPlatformIDs :"<<status<<endl;

// 2. Find a GPU device

    cl_device_id device;

    status = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);

    cout<<"clGetDeviceIDs :"<<status<<endl;

// 3. Create a context and command queue on device cl_context context = clCreateContext(0, 1, &device, NULL, NULL, &status)

    cl_context context = clCreateContext(0, 1, &device, NULL, NULL, &status);

    cout<<"clCreateContext :"<<status<<endl;

I don’t think this should be seg faulting and if so then why not return an error?

EDIT: This has been fixed by restarting the machine. Not sure what that indicates as it definitely seg faulted on clCreateContext.

EDIT2: Could this imply that OpenCL or CUDA isn’t cleaning itself up properly on the GPU side?

I get a seg fault with clCreateContext for the following code:

cl_platform_id platform;

    status = clGetPlatformIDs(1, &platform, NULL);

    cout<<"clGetPlatformIDs :"<<status<<endl;

// 2. Find a GPU device

    cl_device_id device;

    status = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);

    cout<<"clGetDeviceIDs :"<<status<<endl;

// 3. Create a context and command queue on device cl_context context = clCreateContext(0, 1, &device, NULL, NULL, &status)

    cl_context context = clCreateContext(0, 1, &device, NULL, NULL, &status);

    cout<<"clCreateContext :"<<status<<endl;

I don’t think this should be seg faulting and if so then why not return an error?

EDIT: This has been fixed by restarting the machine. Not sure what that indicates as it definitely seg faulted on clCreateContext.

EDIT2: Could this imply that OpenCL or CUDA isn’t cleaning itself up properly on the GPU side?