OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1664 Discussions

CL Device is only available when 'sudo' is used

li__xiaoquan
Beginner
651 Views
0 Kudos
6 Replies
JACEK_D_Intel
Employee
651 Views

Do you have access to files in /dev/dri directory?

Centos, Ubuntu

$ ls -l /dev/dri/
total 0
crw-rw---- 1 root video 226,   0 May 10 17:14 card0
crw-rw---- 1 root video 226, 128 May 10 17:14 renderD128

Fedora

# ls -l /dev/dri/
total 0
drwxr-xr-x  2 root root         80 Apr 25 13:24 by-path
crw-rw----+ 1 root video  226,   0 Apr 30 15:42 card0
crw-rw-rw-  1 root render 226, 128 Apr 30 15:42 renderD128

If not, you need to add your user to video or render groups.

 

Michael_C_Intel1
Moderator
651 Views

Hi XiaoquanLi,

Thanks for the continuing interest.

Typically the issue you observe is correlated with lack of membership to the 'video' group required for hardware access. This step and other prerequisites are shown in the linux guide here.

The guide should walk through deploying the runtimes and developer tools to build and execute an OpenCL program on Intel platforms.

 

Thanks,

-MichaelC

li__xiaoquan
Beginner
651 Views

Thanks for your tips, unfortunately it doesn't work for me. I still can only see device by 'sudo clinfo', this is my group information.

$ groups xiaoquan.li
xiaoquan.li : xiaoquan.li sudo video

BTW, the driver works fine by 'sudo ...', I've checked gpu usage by intel_gpu_top, it does work.

Michael_C_Intel1
Moderator
651 Views

Hi XiaoquanLi,

Can you display file attribute user and group permissions for the files associated with the runtime? It could be useful to review files that come from the runtime assets as they sit on disk after install.

Here's how to walk through it on an Ubuntu system...

I grabbed the file permissions from build assets generated most recently. Here is the list of all files from all .deb:

~/neo_20190530$ FILE_LIST=$(for i in `ls *deb`; do dpkg-deb -c ${i}; done)

~/neo_20190530$  echo "${FILE_LIST}" | grep -v '/$'
-rw-r--r-- jenkins/1001 375312 2019-05-30 07:51 .
lrwxrwxrwx jenkins/1001      0 2019-03-26 15:14 ./usr/local/lib/libigdgmm.so.9 -> libigdgmm.so.9.0.0.532
-rw-r--r-- jenkins/1001 1971744 2019-05-30 07:51 ./usr/local/lib/libiga64.so.1.0.6
-rw-r--r-- jenkins/1001 38587864 2019-05-30 07:51 ./usr/local/lib/libigc.so.1.0.6
lrwxrwxrwx jenkins/1001        0 2019-05-21 18:28 ./usr/local/lib/libiga64.so -> libiga64.so.1
lrwxrwxrwx jenkins/1001        0 2019-05-21 18:28 ./usr/local/lib/libiga64.so.1 -> libiga64.so.1.0.6
lrwxrwxrwx jenkins/1001        0 2019-05-21 18:28 ./usr/local/lib/libigc.so -> libigc.so.1
lrwxrwxrwx jenkins/1001        0 2019-05-21 18:28 ./usr/local/lib/libigc.so.1 -> libigc.so.1.0.6
-rw-r--r-- jenkins/1001 59496880 2019-05-21 18:23 ./usr/local/lib/clang
-rw-r--r-- jenkins/1001  1239888 2019-05-30 07:51 ./usr/local/lib/libigdfcl.so.1.0.6
-rw-r--r-- jenkins/1001 56793368 2019-05-30 07:51 ./usr/local/lib/libopencl-clang.so
-rw-r--r-- jenkins/1001 56793368 2019-05-30 07:51 ./usr/local/lib/libopencl-clang.so.7
-rw-r--r-- jenkins/1001   835955 2019-04-16 15:12 ./usr/local/lib/opencl-c.h
lrwxrwxrwx jenkins/1001        0 2019-05-21 18:28 ./usr/local/lib/libigdfcl.so -> libigdfcl.so.1
lrwxrwxrwx jenkins/1001        0 2019-05-21 18:28 ./usr/local/lib/libigdfcl.so.1 -> libigdfcl.so.1.0.6
-rwxr-xr-x jenkins/1001 284424 2019-05-24 10:34 ./usr/local/bin/ocloc
-rw-r--r-- jenkins/1001     41 2019-05-24 10:34 ./etc/OpenCL/vendors/intel.icd
-rw-r--r-- jenkins/1001 3139984 2019-05-30 07:51 ./usr/local/lib/intel-opencl/libigdrcl.so

 

Here is getting the file info:

~/neo_20190530$ echo "${FILE_LIST}" | grep -v '/$' | awk '{print $6}' | cut -f2- -d'.' | xargs ls -tal
-rw-r--r-- 1 [username] [groupname]  3139984 May 30 07:51 /usr/local/lib/intel-opencl/libigdrcl.so
-rw-r--r-- 1 [username] [groupname]  1239888 May 30 07:51 /usr/local/lib/libigdfcl.so.1.0.6
-rw-r--r-- 1 [username] [groupname] 56793368 May 30 07:51 /usr/local/lib/libopencl-clang.so
-rw-r--r-- 1 [username] [groupname] 56793368 May 30 07:51 /usr/local/lib/libopencl-clang.so.7
-rw-r--r-- 1 [username] [groupname]  1971744 May 30 07:51 /usr/local/lib/libiga64.so.1.0.6
-rw-r--r-- 1 [username] [groupname] 38587864 May 30 07:51 /usr/local/lib/libigc.so.1.0.6
-rw-r--r-- 1 [username] [groupname]   375312 May 30 07:51 /usr/local/lib/libigdgmm.so.9.0.0.532
-rw-r--r-- 1 [username] [groupname]       41 May 24 10:34 /etc/OpenCL/vendors/intel.icd
-rwxr-xr-x 1 [username] [groupname]   284424 May 24 10:34 /usr/local/bin/ocloc
lrwxrwxrwx 1 [username] [groupname]       13 May 21 18:28 /usr/local/lib/libiga64.so -> libiga64.so.1
lrwxrwxrwx 1 [username] [groupname]       17 May 21 18:28 /usr/local/lib/libiga64.so.1 -> libiga64.so.1.0.6
lrwxrwxrwx 1 [username] [groupname]       11 May 21 18:28 /usr/local/lib/libigc.so -> libigc.so.1
lrwxrwxrwx 1 [username] [groupname]       15 May 21 18:28 /usr/local/lib/libigc.so.1 -> libigc.so.1.0.6
lrwxrwxrwx 1 [username] [groupname]       14 May 21 18:28 /usr/local/lib/libigdfcl.so -> libigdfcl.so.1
lrwxrwxrwx 1 [username] [groupname]       18 May 21 18:28 /usr/local/lib/libigdfcl.so.1 -> libigdfcl.so.1.0.6
-rw-r--r-- 1 [username] [groupname] 59496880 May 21 18:23 /usr/local/lib/clang
-rw-r--r-- 1 [username] [groupname]   835955 Apr 16 15:12 /usr/local/lib/opencl-c.h
lrwxrwxrwx 1 [username] [groupname]       22 Mar 26 15:14 /usr/local/lib/libigdgmm.so.9 -> libigdgmm.so.9.0.0.532

Can you post the feedback JACEK D. recommended for review?

 

 

Thanks.

-MichaelC

 

 

li__xiaoquan
Beginner
651 Views

Thanks for your help.

This is information for deb files:

xiaoquan.li@ops-Alienware-17-R4:~/
$  FILE_LIST=$(for i in `ls intel-opencl_18.38.11535_amd64.deb`; do dpkg-deb -c ${i}; done)
xiaoquan.li@ops-Alienware-17-R4:~/
$  echo "${FILE_LIST}" | grep -v '/$'
-rw-r--r-- ubit/ubit        28 2018-09-21 19:32 ./etc/OpenCL/vendors/intel.icd
-rw-r--r-- ubit/ubit        15 2018-09-21 19:32 ./etc/ld.so.conf.d/libintelopencl.conf
-rw-r--r-- ubit/ubit  52683976 2018-09-21 19:35 ./usr/local/lib/libopencl_clang.so
-rw-r--r-- ubit/ubit  35232144 2018-09-21 19:35 ./usr/local/lib/libigc.so
-rw-r--r-- ubit/ubit   1059184 2018-09-21 19:35 ./usr/local/lib/libigdfcl.so
-rw-r--r-- ubit/ubit   1902392 2018-09-21 19:35 ./usr/local/lib/libiga64.so
-rw-r--r-- ubit/ubit   2969720 2018-09-21 19:35 ./usr/local/lib/libigdrcl.so
xiaoquan.li@ops-Alienware-17-R4:~/
$ echo "${FILE_LIST}" | grep -v '/$' | awk '{print $6}' | cut -f2- -d'.' | xargs ls -tal
-rw-r--r-- 1 1020 1024  1902392 9\u6708  21  2018 /usr/local/lib/libiga64.so
-rw-r--r-- 1 1020 1024 35232144 9\u6708  21  2018 /usr/local/lib/libigc.so
-rw-r--r-- 1 1020 1024  1059184 9\u6708  21  2018 /usr/local/lib/libigdfcl.so
-rw-r--r-- 1 1020 1024  2969720 9\u6708  21  2018 /usr/local/lib/libigdrcl.so
-rw-r--r-- 1 1020 1024 52683976 9\u6708  21  2018 /usr/local/lib/libopencl_clang.so
-rw-r--r-- 1 1020 1024       15 9\u6708  21  2018 /etc/ld.so.conf.d/libintelopencl.conf
-rw-r--r-- 1 1020 1024       28 9\u6708  21  2018 /etc/OpenCL/vendors/intel.icd


 

This is information for device files (I have another GPU installed):

$ ls -lh /dev/dri/
total 0
crw-rw----+ 1 root video 226,   0 6\u6708   6 12:05 card0
crw-rw----+ 1 root video 226,   1 6\u6708   6 12:05 card1
crw-rw----+ 1 root video 226, 128 6\u6708   6 12:05 renderD128
crw-rw----+ 1 root video 226, 129 6\u6708   6 12:05 renderD129

 

JACEK_D_Intel
Employee
652 Views

Can you provide file log.txt created with below command:

strace -f -s 255 -o log.txt clinfo

 

Reply