1 Reply Latest reply on Jan 31, 2011 3:10 PM by jholewinski

    Stream SDK 2.3 on Ubuntu 10.04 Server: Needs Root?

    jholewinski

      I originally had a Ubuntu 9.10 x64 system set up with a Radeon 5870 and a GeForce GTX 280 running Stream SDK 2.2 and CUDA 3.2.  I recently re-installed the OS and migrated to Ubuntu 10.04 server x64.  After installing Stream SDK 2.3, I am only able to run CAL and OpenCL programs (on the Radeon) as root and not as a regular user.  CUDA works fine on user accounts.

      I followed the same Stream SDK setup procedure as before, including the additions to /etc/gdm/Init/Default to enable access over SSH (the machine is headless).  However, I noticed that the device node is now /dev/ati/card0 instead of /dev/dri/card0.

       

      User Account Example:

       

      $ ./OpenCloseDevice
      Supported CAL Runtime Version: 1.3.185
      Found CAL Runtime Version: 1.4.900
      Use -? for help
      No protocol specified
      Opening Device : 0
      There was an error opening device 0.

      Press enter to exit...

      Root Example:
      $ sudo ./OpenCloseDevice 
      Supported CAL Runtime Version: 1.3.185
      Found CAL Runtime Version: 1.4.900
      Use -? for help
      Opening Device : 0
      Device Handle = 268435456
      == Device Info ==
      Target Device              : Unknown            
      Maximum resource 1D width  : 16384            
      Maximum resource 2D width  : 16384            
      Maximum resource 2D height : 16384            
      Press enter to exit...


       

      Running strace seems to indicate the problem is that a call to ioctl() on /dev/ati/card0 is failing:

       

      open("/dev/ati/card0", O_RDWR)          = 3
      ioctl(3, 0xc0506450, 0x7fff07a283c0)    = -1 EACCES (Permission denied)



       

      This error does not occur when running as root.  However, the permissions on that device are world readable/writable:

       

       

      $ ll /dev/ati/card0 
      crw-rw-rw- 1 root root 251, 0 2011-01-19 11:35 /dev/ati/card0

      Any clues as to what the problem may be?


        • Stream SDK 2.3 on Ubuntu 10.04 Server: Needs Root?
          jholewinski

          For those interested, I finally found the solution.

           

          According to the AMD developer site, GDM must be configured to allow remote X connections across SSH directly into the local :0 display (if using Stream SDK over SSH).  The xhost program is used to configure these permissions through a GDM configuration file.  The problem was that xhost was not installed on the system.  

          Being a Ubuntu Server installation, X was not installed by default and a basic gnome environment was installed with aptitude.  The minimal Gnome installation for Ubuntu Server does *not* include the xhost program.  Unfortunately, the call to xhost in the GDM configuration file referenced by the AMD developer documentation fails silently, so there is no indication of a problem, other than Stream SDK apps not running without root.

          The solution is to install the x11-server-utils package on Ubuntu (other distributions should have a similar package, if xhost is not installed by default).  Now xhost will properly run when GDM starts and Stream SDK applications can be used without root permissions.

           

          I believe the Remote Access documentation on the AMD developer site should be updated to reflect two points:

           

          1. Ensure xhost is installed on the local system
          2. Newer AMD drivers seem to use /dev/ati/card* instead of /dev/dri/card* as mentioned in the documentation.