I have learn some things the hardway:
First using my OpenCL-z for Linux I could really get 1 AMD GPU.
The problem lays in OpenCL backend wich in turn lies in CAL beckend..
This has all the bad and good things the CAL backend..
The worst is that is requires to have a X session for each device (well at least for 1 device this is how it is).. so you can't get working in console mode as with CUDA..
In CUDA and also OpenCL adding NVidia propietray kernel module and loading it and creating some /dev/nvidia things all works..
This way the only way to test ATI and Nvidia OpenCL implementations is to have Nvidia in this way..
FindNumDevices returns 1 device..
so I searched in the web and found solution(assuming yo configured your xorg.conf to use all adapters:
aticonfig --initial --adapter=all)
I don't know if its required to have actually physically connected a screen in each device.. at least after configuring with two screens connected..
The trick is to use:
export DISPLAY=:0
Also I have tested and you can enable 1 device:
export DISPLAY=:0.0
export DISPLAY=:0.1
This for example allows AMD OpenCL examples using -device gpu to use realiably an specified GPU..
I use this to test:
CPU
./MatrixMultiplication --device cpu -x 2048 -y 2048 -z 2048 -t -q
GPU 0
export DISPLAY=:0.0
./MatrixMultiplication --device gpu -x 2048 -y 2048 -z 2048 -t -q
GPU1
export DISPLAY=:0.1
./MatrixMultiplication --device gpu -x 2048 -y 2048 -z 2048 -t -q
Now the second part with is of use to benchmark both OpenCL AMD and Nvidia drivers..
AMD needs
export ATISTREAMSDKROOT=..
export LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86_64:$ATISTREAMSDKROOT/lib/x86:$LD_LIBRARY_PATH
stuff
For AMD tests not showing the name of GPU can be prone to error assuming a implementation is getting used..
the solution is to use ldd and see what library is getting used..
the bad thing is that while no ICD gets and Nvidia gets installed in /usr/lib this gets first in almost cases..
one way to fix that in Linux is to use:
export LD_PRELOAD=../ati-stream-sdk-v2.0-beta4-lnx32/lib/x86/libOpenCL.so
well not that isn't working I have to report in AMD forums..
I think Nvidia works LD_PRELOAD..
so the correct way is setting first ati path:
export LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86_64:$ATISTREAMSDKROOT/lib/x86:$LD_LIBRARY_PATH
More aggressive way is renaming so only finds what is wanted
sudo mv /usr/lib/libOpenCL.so /usr/lib/libOpenCLn.so
testing with Nvidia
and then
sudo mv /usr/lib/libOpenCLn.so /usr/lib/libOpenCL.so
similar for ATI
See more of this followup test of a simple OpenCL benchmark tested with
this things..
Friday, 6 November 2009
Managing AMD OpenCL GPU devices and OpenCL backends in Linux..
Posted on 23:01 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment