Adventures in headless OpenCL support in Linux

Discussion created by gbilotta on Apr 30, 2014
Latest reply on Jul 24, 2014 by ajk

Hello all, this is more of a bug report than a question.


I've noticed that finally since 14.4 (and maybe some driver versions before this), headless OpenCL finally works, under some specific circumstances.




  1. if X is not running, but DISPLAY is set (e.g. because the user logged into the machine via ssh -X), then clinfo will not show the GPU as a device, because it will try to connect to the GPU of the DISPLAY
  2. if X is running, and COMPUTE is set to the display where X is running, but the user is a different one from the one logged in, then clinfo will simply segfault somewhere in the AMD ICD stack
  3. in my experience, the only way to reliably access the GPU for compute, especially for remote machines, is to shut off everything X-related (display managers, sessions, and even ssh X forwarding). In this case, it seems to work for any user, or at least those that have access to the /dev/ati/card* devices.


Conclusions: the situation is much improved from one or two years ago, but there are a few things that should be fixed. Particularly, the application segfaulting when not having device access is an absolute no-no, and ideally, when DISPLAY is set to a local forward, other access methods should be tried.


Keep up the good work.