6 Replies Latest reply on Sep 26, 2014 4:53 AM by mdriftmeyer

    Linux OpenCL Console Mode: Execute code as user

    arwnz

      In April 2013 AMD officially released Catalyst 13.4 for Linux with OpenCL Console Mode Support:

      AMD Catalyst™ 13.4 Proprietary Linux Graphics Driver Release Notes

       

      Console mode does not detect my HD 5000 Series GPU unless I run OpenCL code as root. Only a CPU device is found when the code is run with user permissions. This is expected: OpenCL Console Mode Support in Catalyst 13.4

      "yes. It works only with root privileges."

       

      Is there an update to when root privileges will no longer be required?

       

      In the meantime, is there a way to minimise how much of the application actually runs as root? I'd like to avoid trashing kernel memory/corrupting my operating system when testing code.

          • Re: Linux OpenCL Console Mode: Execute code as user
            arwnz

            Thanks nou. I've confirmed that the patch works so long as the user is not running X via an NVIDIA GPU.

             

            To be precise, AMD OpenCL programs run on the AMD GPU as a user from a virtual console before X has been started. If I switch to another virtual console, log in and start X then clinfo or text-based AMD OpenCL sample programs like ConstantBandwidth segfault when switching back to the original virtual console. If I log out of X and switch back to the original virtual console then the OpenCL programs run correctly again.

             

            AMD does not appear to have decoupled OpenCL from X. Thus a text-based program like clinfo still links in libX11 and finds the current user is running X and segfaults trying to integrate with X (which in my case is linked with the nvidia binary blob instead of the supported fglrx module).

             

            Another user that has not started X can still run AMD OpenCL programs regardless of the other user currently running X.

             

            Until AMD decouples OpenCL from X I do not believe I will be able to run AMD OpenCL and NVIDIA CUDA on an NVIDIA GLX stack from within the same binary. The patch does make changing permissions on /dev/ati/* viable, so I could limit access to the AMD GPU to a specific user that is not running X. The non-X user could receive commands from the X-user to process data "sent" in shared memory, which is plausibly a zero-copy solution with the added latency of an inter-process command protocol.

             

            Any update from AMD on decoupling OpenCL from X?