«

»

Dec 07

Running OpenCL applications remotely on AMD GPUs

AMD’s OpenCL implementation relies on CAL to manage the AMD GPU for general-purpose computations. AMD CAL uses existing API hooks into the display driver to access the GPU. For doing so, CAL needs to have direct access to the display driver.

When the applications are run locally on the graphics console, CAL has direct access to the display driver, but not so when the applications are remotely.

The solution to the problem is to provide necessary permissions to CAL to access the to the display driver.

On linux, this can be done as following:

1. Log into your system as root.

2. If you are running Red Hat Enterprise Linux or Ubuntu 11.04:

a. Add the following lines at the end of /etc/gdm/Init/Default, before the exit 0, to modify the security settings, allowing remote sessions to access the X server and ensuring that remote sessions have access to the necessary device files when communicating with the GPU:

xhost +
chmod uog+rw /dev/ati/card*

b. If you normally use bash, add the following line to the end of /etc/bashrc file to ensure remote sessions know which X server to access.
case $DISPLAY in ’’) export DISPLAY=:0;; *) ;; esac
NOTE: ’ ’ are two single quotes, not a single double-quote.

3. If you are running openSUSE:

a. Add the following lines at the end of /etc/X11/xdm/Xsetup after the . /etc/sysconfig/displaymanager to modify the security settings, allowing remote sessions to access the X server and to ensure remote sessions have access to the necessary device files when communicating with the GPU.
xhost +
chmod uog+rw /dev/ati/card*

b. If you normally use bash, add the following line to the end of /etc/bash.bashrc to ensure remote sessions know which X server to access.
case $DISPLAY in ’’) export DISPLAY=:0;; *) ;; esac
NOTE: ’ ’ are two single quotes, not a single double-quote.

4. If you normally use tcsh, add the following line to the end of
/etc/csh.cshrc to ensure remote sessions know which X server to access.

if ( ! $?DISPLAY ) then
setenv DISPLAY :0
endif

5. Run /usr/sbin/gdm-restart (RHEL), service gdm restart (Ubuntu), or kill the xorg process (openSUSE) to force gdm/kdm/xdm to restart and pick up the new settings.

You should now be able to run OpenCL applications remotely.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>