CAP_IPC_LOCK and ATI Stream OpenCL

Discussion created by Marix on Jun 24, 2010

I have an application that works fine as long as the application does not have CAP_IPC_LOCK. Sadly the maximum buffer size that can be allocated using the host pointer variant of OpenCL buffer creation does not allow to create large enough buffers for my special application. Therefore I page lock my pages myself using malloc. As I did not want to lift restrictions for all applications and neither wanted to suid the application I tried giving it the capability CAP_IPC_LOCK via 'setcap cap_ipc_lock=ep <appname>'. Sadly this seems to break the ATI Stream OpenCL application as I am no longer able to lookup platforms, the error given by the CPP-Bindings is:  clGetPlatformIDs(-1001) . Sadly the -1001 error code is undocumented ...

I could give you some example code but the problem can be reproduced with any simple OpenCL Hello World application, at least on Ubuntu (9.10), I haven't tried other distributions yet, but don't think it should make a difference. In addition, the problem does not occur with other OpenCL implementations. Currently, as I am still in the development phase, I can work around the problem via weaking my ulimits, but for production I would prefer being able to give capabilities on an application level.