7

No matter how I try to get OpenCL working (sgminer, cgminer, c programming examples, clinfo)

I only get a result when I run as root.

When I run clinfo not as root I get:

terminate called after throwing an instance of 'cl::Error'
what():  clGetPlatformIDs
Aborted (core dumped)

I am using the AMD opencl implementation, and the correct ICD file does exist under /etc/OpenCL/vendors. I have changing the permissions of various files with no success.

How can I get this to work without root access

Zack Newsham
  • 251
  • 2
  • 14
  • Were you able to solve this problem? I'm having a similar one, I would like to know if you could solve it. – silgon Nov 26 '15 at 19:26
  • @silgon, it was quite a while ago, and subsequently I stopped working on OpenCL - I don't recall if I got it working as non root. – Zack Newsham Nov 26 '15 at 20:43

3 Answers3

4

make sure that your user is added to the video group:

sudo adduser $USER video
waltinator
  • 35,099
  • 19
  • 57
  • 93
user734826
  • 41
  • 2
1

Follow steps 9-11 of this answer

  1. Optional: make symbolic links for desired system installed platforms: $ ln -s /etc/OpenCL/vendors/nvidia.icd /local/install/path/etc/vendors/nvidia.icd
  2. export OPENCL_VENDOR_PATH=/local/install/path/etc/vendors
  3. export LD_LIBRARY_PATH=/local/install/path/lib/x86_64:$LD_LIBRARY_PATH
Synergist
  • 315
  • 1
  • 8
  • 1
    Doesn't work under Ubuntu 18.04.x. The same error message `terminate called after throwing an instance of 'cl::Error' what(): clGetPlatformIDs Aborted (core dumped)`. – Eugene Gr. Philippov Oct 20 '21 at 06:39
1

ubuntu 14.04

same errormessage. GPU not recognised.

symptom-no files in /etc/OpenCL/vendors

create files by

sudo gedit /etc/OpenCL/vendors/amdocl64.icd

enter/paste libamdocl64.so

save

sudo gedit /etc/OpenCL/vendors/amdocl32.icd

enter/paste libamdocl32.so

save

sudo gedit /etc/OpenCL/vendors/inteocl.icd

enter/paste libintelocl.so

save

sudo gedit /etc/OpenCL/vendors/nvidia.icd

enter/paste libcuda.so

save

This worked for me. I did a lot of other things also- symlinc and xhost- but they did not fix the problem finally.

Mostafa Ahangarha
  • 4,358
  • 7
  • 35
  • 51
Jari
  • 11
  • 1
  • Ubuntu 18.04.x. Your answer didn't help me, still `terminate called after throwing an instance of 'cl::Error' what(): clGetPlatformIDs Aborted (core dumped) ` – Eugene Gr. Philippov Oct 20 '21 at 06:34