cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

Adept II
Adept II

ioctl permissions on Linux

I'm running OpenCL AMD-APP-SDK-v2.8-lnx64.tgz with FirePro_9.003.3-Linux-x32x64-151130.zip on 4 FirePro 3D V5800

Device 0 : Juniper Device ID is 0x1bb83f0

Device 1 : Juniper Device ID is 0x1c88580

Device 2 : Juniper Device ID is 0x1c86c40

Device 3 : Juniper Device ID is 0x2035230

root can execute all OpenCL sample fine, but any regular user can't. Even extending permissions to anybody on /dev/aticard*

sudo chmod -fR 777 /dev/ati

a non-root user, shows with strace

stat("/dev/ati", {st_mode=S_IFDIR|0777, st_size=120, ...}) = 0

stat("/dev/ati/card0", {st_mode=S_IFCHR|0777, st_rdev=makedev(250, 0), ...}) = 0

open("/dev/ati/card0", O_RDWR)          = 6

ioctl(6, 0x80046484, 0x7fff2699714c)    = 0

ioctl(6, 0xc0106407, 0x7fff26997260)    = -1 EINVAL (Invalid argument)

ioctl(6, 0xc0106401, 0x7fff26997260)    = 0

ioctl(6, 0xc0106401, 0x7fff26997260)    = 0

ioctl(6, 0x8204648b, 0x7fff26997640)    = 0

ioctl(6, 0x80146454, 0x7fff26997850)    = -1 EACCES (Permission denied)

ioctl(6, 0x80146454, 0x7fff26997850)    = -1 EACCES (Permission denied)

ioctl(6, 0x80146454, 0x7fff26997850)    = -1 EACCES (Permission denied)

ioctl(6, 0x80146454, 0x7fff26997850)    = -1 EACCES (Permission denied)

Have premissions on ioctl()'s on card recently changed? I was able to execute OpenCL as regular user fine with previous versions of fglrx/OpenCL.

Is that the desired behavior? Will only root be able to run OpenCL programs on headless servers?

Thanks,

Valerio


0 Kudos
Reply
31 Replies
Grandmaster
Grandmaster

Re: ioctl permissions on Linux

Can you tell us more about your system configuration? Like which linux flavor, linux version etc..

Also, Are you trying to run APP SDK Samples? If so, can you check the permissions on the binaries?

It is possible that you installed the new APP SDK as root and some permission settings on the files are not allowing normal users to run... Can you check on these lines?

0 Kudos
Reply
Adept II
Adept II

Re: ioctl permissions on Linux

Distro: Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-22-generic x86_64)

Kernel: Linux hotshot 3.5.0-22-generic #34-Ubuntu SMP Tue Jan 8 21:47:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

CPU:AMD FX(tm)-8150 Eight-Core Processor

GPU:

* 0. 01:00.0 ATI FirePro V5800 (FireGL V)

  1. 06:00.0 ATI FirePro V5800 (FireGL V)

  2. 07:00.0 ATI FirePro V5800 (FireGL V)

  3. 08:00.0 ATI FirePro V5800 (FireGL V)

I've tried with a 3.2.0 kernel, with the same result.

Permissions look correct, all executables and libraries are 755.

even if I setuid and setgid any executable, a non-root user cannot execute the sample programs:

valerio@hotshot:~$ ls -l /opt/AMDAPP/samples/opencl/bin/x86_64/FFT

-rwsr-sr-x 1 501 501 154737 Dec 27 22:24 /opt/AMDAPP/samples/opencl/bin/x86_64/FFT

valerio@hotshot:~$ /opt/AMDAPP/samples/opencl/bin/x86_64/FFT

Platform 0 : Advanced Micro Devices, Inc.

Original Input Real

15.3732 201.81 51.9855 89.2322 92.572 34.4675 96.2478 66.3863 11.345 225.168

Original Input Img

0.0600514 0.788318 0.203068 0.348563 0.361609 0.134639 0.375968 0.259322 0.0443163 0.879562

GPU not found. Falling back to CPU device

Platform found : Advanced Micro Devices, Inc.

Selected Platform Vendor : Advanced Micro Devices, Inc.

Device 0 : AMD FX(tm)-8150 Eight-Core Processor            Device ID is 0xf786a0

Build Options are : -x clc++

Executing kernel for 1 iterations

-------------------------------------------

Output real

131643 -1085.95 -997.15 -1791.52 532.119 1659.74 -166.27 969.692 1189.76 -862.707

Output img

514.23 2289.84 936.49 -603.839 699.7 1018.18 1900.06 795.439 -1328.03 -293.334

My feeling is that these are permission checks  are performed inside firegl_compat_ioctl() or downstram of it, inside the fglrx module; they might not be related to any filesystem permissions.


0 Kudos
Reply
Grandmaster
Grandmaster

Re: ioctl permissions on Linux

APP SDK 2.8 requires catalyst version 12.10 (or) later.

You have to first install the driver followed by the APP SDK.

I can't read the catalyst version from FirePro_9.003.3-Linux-x32x64-151130.zip

Can you please let me know what is the catalyt version you are using?

0 Kudos
Reply
Grandmaster
Grandmaster

Re: ioctl permissions on Linux

Interestingly, I encountered this problem while updating my driver to catalyst 13.1 (9.003).

clinfo did not list the GPU at all.... after the update and an strace revealed a similar user-permission problem.

After downgrading to 12.10 (9.002) -- It started working fine.

So, this may be a workaround for you. But, I wont advocate this because I have not tested much.

But, After downgrading, "clinfo" worked just fine.

If you decide to un-install, you could run the script "/usr/share/ati/fglrx-uninstall.sh".

But, I leave the decision to you. I can't back this decision fully at the moment.

0 Kudos
Reply
Adept II
Adept II

Re: ioctl permissions on Linux

Hello Himanshu,

thank you for looking into this. FirePro 3D have no 12.10 catalyst that I can see. The previous package for Firepro #d according to this page: http://support.amd.com/us/gpudownload/fire/previous/Pages/fire_linux.aspx is this:

http://www2.ati.com/drivers/firepro/FirePro_8.982.8.3_Linux_x32x64-148581.zip

8.982.8.2 does not compile with kernel 3.5.0

Is there a 12.10 package for firepro? This:

http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-12.10-x86.x86_64.zip

will compile, but will not detect the firepro cards.

Valerio

0 Kudos
Reply
Grandmaster
Grandmaster

Re: ioctl permissions on Linux

Hi Valerio,

AFAIK, The generic driver amd-driver-installer-catalyst-12.10-x86.x86_64.zip  must work for firepro cards as well.

Not sure, why it does not work.

I will check with AMD Engg Team.

When you mean - "it does not detect" -- Do you mean "clinfo" does not list it? (or) the GPUs themselves are not detected by the OS?

Thanks,

0 Kudos
Reply
Adept II
Adept II

Re: ioctl permissions on Linux

clinfo or aticonfig --lsa will not list any of the Fire Pro Cards with catalyst 12.10

0 Kudos
Reply
Grandmaster
Grandmaster

Re: ioctl permissions on Linux

Hi,

I tried to reproduce the problem after making a fresh install of Linux, followed by 13.1 driver installation , followed by 2.8 APP SDK installation.

Everything is sane and normal. I don't see permission errors.

Did the problems started occuring after you upgraded your driver? (or) Did you do a fresh install of the system.

If possible, Can you share the exact sequence that led to the problem? It will be useful for me to reproduce the problem here.

Thanks,

0 Kudos
Reply
Adept II
Adept II

Re: ioctl permissions on Linux

HI Himanshu,

thank you very much for your help.

Here are my steps:

1) I was running ubuntu 11.0 with  the following drivers

./ati/fglrx-8.911.3.1/fglrx-amdcccle_8.911-0ubuntu1_amd64.deb

./ati/fglrx-8.911.3.1/fglrx-dev_8.911-0ubuntu1_amd64.deb

./ati/fglrx-8.911.3.1/fglrx_8.911-0ubuntu1_amd64.deb

and AMD-APP-SDK-v2.7-lnx64.tgz

All was working fine.

2) I updated ubuntu to 12.10 doing a 'do-release-update' twice

3) When in ubuntu 12.10, I uninstalled the SDK by

rm -fR /opt/AMDAPP

and

dpkg --remove fglrx fglrx-amdcccle fglrx-de

dpkg --purge fglrx fglrx-amdcccle fglrx-dev

4) reboot

5) Installed

./packages/fglrx/fglrx-9.003.3/fglrx_9.003-0ubuntu1_amd64.deb

./packages/fglrx/fglrx-9.003.3/fglrx-dev_9.003-0ubuntu1_amd64.deb

./packages/fglrx/fglrx-9.003.3/fglrx-amdcccle_9.003-0ubuntu1_amd64.deb

via

cd ./packages/fglrx

dpkg --install *deb

then I installed AMD-APP-SDK-v2.8-lnx64.tgz

Some details: this is a headless server, there are no monitors connected to the cards. Does it matter?

I tried having an Xorg running on the first card, and having a user with DISPLAY=:0.0 running the openCL programs, but the result was very much the same.

I have lightdm configured as such

[/etc/lightdn/lightdm.conf]

----------------------------------------------

[LightDM]

minimum-vt=-1

[SeatDefaults]

greeter-session=lightdm-gtk-greeter

user-session=gnome-classic

xserver-allow-tcp=true

xserver-command=Xvfb -screen 0 1900x1200x24 -I

[XDMCPServer]

enabled=true

--------------------------------------------------------------

so I can connect to the server via nomachine's nx server 4

0 Kudos
Reply