Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set the backend to opencl #230

Open
Lattitude75 opened this issue Jun 1, 2020 · 3 comments
Open

Unable to set the backend to opencl #230

Lattitude75 opened this issue Jun 1, 2020 · 3 comments

Comments

@Lattitude75
Copy link

I use the following driver for my card with mesa-opencl-icd loader and radeon driver.

0d:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile] (rev 83)
	Subsystem: Hewlett-Packard Company Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile]

Installed Arrayfire and made sure that all the libraries are loaded. Using the ArrayFire.jl, arrayfire loads in Julia perfectly and runs on my AMD card.

ArrayFire v3.7.1 (OpenCL, 64-bit Linux, build d9d9b65)
[0] Clover: AMD HAINAN (DRM 2.50.0, 5.4.0-33-generic, LLVM 9.0.1), 2048 MB

But, in my Python the array fire loads with the following info:

ArrayFire v3.7.1 (CPU, 64-bit Linux, build d9d9b65)
[0] Intel: Intel(R) Core(TM) i3-5010U CPU @ 2.10GHz

I also use the following in my .bashrc to update my environment:

export LD_LIBRARY_PATH=/opt/arrayfire/lib64:$LD_LIBRARY_PATH

When I try to change the backend, I get the following error:

>>> af.set_backend('opencl')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/saipavanchitta/.local/lib/python3.8/site-packages/arrayfire/library.py", line 658, in set_backend
    raise RuntimeError("Can not change backend to %s after loading %s" % (name, backend.name()))
RuntimeError: Can not change backend to opencl after loading cpu

Is there something that I am missing?

@9prady9
Copy link
Member

9prady9 commented Jun 1, 2020

I believe the set_backend call should be the first arrayfire call in C++. I would think that is same here in python wrapper too assuming python wrapper doesn't add anything custom. Try moving set_backend as the first one after importing the package.

@Lattitude75
Copy link
Author

I tried calling the set_backend immediately after importing the package.

import arrayfire as af
af.set_backend('opencl')

I still get the same error.

@9prady9
Copy link
Member

9prady9 commented Jun 1, 2020

@syurkevi Might have a better idea of what's happening. He should be online soon. Please wait for his response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants