5 Replies Latest reply on Jun 11, 2011 1:09 PM by himanshu.gautam

    Multiple X servers (Linux): problems with starting OpenCL applications

    schenwo

      I think I have a very specific question here, but maybe someone can shed some light upon this.

      At the moment, there is one ATI GPU (HD5830) in my machine. I want other people to log in on my machine remotely via ssh and to use OpenCL applications. Unfortunately, as far as I know, they need access to the X server running on my machine for this purpose. Since I don't want to give them access to the X server display at which I am working, I thought it might be a good idea to start a second X server, and to provide free access to this second server, while I can work privately with the first one.

      Unfortunately, this does not seem to work as smooth as I hoped for. After having started the second X server, my OpenCL application (still running with the X display of the first server) won't execute some kernels which have worked without problems before. Strangely, another kernel with a rather simple argument list still works. The non-working kernels struggle to even finish the first line where I placed a printf for debugging purposes, and moreover, clEnqueueNDRangeKernel never returns.

      When I start my OpenCL application on the second X server, the init process (get devices, contexts, etc.) works so far, but the application hangs when the OpenCL program is built (with cl::Program::build(..) - I work with the C++ wrapper for OpenCL). When I use the CPU device it passes smoothly at this point.

      So my question is: Has anyone experience with two X servers and the ATI stream framework and knows how to use it in this configuration? Or is it more or less proven that it does not work properly at the moment with multiple X servers?

      Thanks, Wolfram

        • Multiple X servers (Linux): problems with starting OpenCL applications
          bollig

          We setup our machine to run two X servers via KDM (GDM wouldnt allow us to disable access control on X), but we have independent GPUs for each. No problems like youre describing.

          I use the COMPUTE variable to specify the target X session instead of DISPLAY. You might see if that makes a difference. 

          http://fsuvizlab.blogspot.com/2010/12/opencl-on-ubuntu-1004-lucid-with-two.html

            • Multiple X servers (Linux): problems with starting OpenCL applications
              schenwo

               

              Originally posted by: bollig We setup our machine to run two X servers via KDM (GDM wouldnt allow us to disable access control on X), but we have independent GPUs for each. No problems like youre describing.


              Thank you for your advice and the link to you blog. However, following the description in you blog, I am pretty convinced that you are actually only running one X server, since the DISPLAY variables you mention at the end are called :0.0 and :0.1. Nevertheless, your hint regarding GDM/KDM opened me the way to do research on multi-seat configurations which is the way to go I think (with one seat only receiving input from "void" input devices - but this affords configuration work beyond using aticonfig).

              Furthermore, after extensive testing, I am meanwhile nearly convinced that the ATI driver won't allow one GPU to run multiple *active* X servers simultaneously. Only the X server of the active display gets access to the GPU (including OpenCL stuff), while the other X server has to wait until it gets the active one. Thus, a second GPU is mandatory.

               

              I use the COMPUTE variable to specify the target X session instead of DISPLAY.


              This is very valuable information since it also allows to run OpenCL applications with GUI remotely. Where in the official ATI Stream documentation can this be found?

              Wolfram

                • Multiple X servers (Linux): problems with starting OpenCL applications
                  schenwo

                  To complete this topic I post a brief outline of my final solution (for now).

                  I installed a second old Nvidia card in my machine (8500GT) to take care of my desktop while the HD 5830 is the OpenCL device.

                  The configuration is as follows:

                  2 X servers: the one for the ATI runs with fglrx and void input devices (CorePointer, CoreKeyboard), the one for the Nvidia runs with the nv driver (open source) and the physical keyboard/mouse.

                  GDM as desktop manager (version prior to 2.20 as shipping with CentOS 5.5) is configured to start both X servers and provide a login at both (the login is not functional for the ATI X server). Furthermore, since this is a kind of multi-seat configuration, virtual terminal switching has to be disabled. For the ATI X server, access control is disabled, for the Nvidia X server, it stays enabled since nobody should be able to make screenshots from my desktop or to log my keyboard...

                  One tricky thing: One has to use the evdev driver for the keyboard to make things working, this needs to be carefully configured in xorg.conf and within KDE, otherwise many keys do not work as expected.

                  In this way, everybody can use the ATI GPU in my machine while the X server for my desktop is still private. Furthermore, with the help of the COMPUTE variable people can start OpenCL applications with X forwarding for a GUI via ssh.

                  --

                  Wolfram