You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: In function void print() after installation #248
I have a problem with arrayfire-python. I followed all installation instructions, including adding directories to LD_LIBRARY_PATH: $ echo $LD_LIBRARY_PATH /opt/arrayfire/lib64/::/opt/cuda/lib64/:/opt/cuda/nvvm/lib64/
In /etc/ld.so.conf.d/arrayfire.conf I have /opt/arrayfire/lib64
However, when I try to run helloworld.py from examples, I get:
Platform: CUDA Runtime 11.2, Driver: 455.45.01
[0] GeForce GTX 1070, 8119 MB, CUDA Compute 6.1
Create a 5-by-3 matrix of random floats on the GPU
A
[Element-wise arithmetic
Error: In function void print(const char*, af_array, int, std::ostream&, bool) [with T = float; af_array = void*; std::ostream = std::basic_ostream<char>]
In file src/api/c/print.cpp:
Process finished with exit code 0
When I am in the python console and I change backend to CPU I get:
So for me it looks like arrayfire correctly recognizes CPU and CUDA.
I found similar problem here: https://groups.google.com/g/arrayfire-users/c/_524PBvEvGw?pli=1 however it was not solved.
Also. when I try to run another code for which I installed arrayfire, I get this error:
File "/home/wojtek/anaconda3/envs/multi-layer-born/lib/python3.8/site-packages/arrayfire/util.py", line 79, in safe_call
raise RuntimeError(to_str(err_str))
RuntimeError: In function cuda::Module common::compileModule(const string&, const std::vector<std::basic_string<char> >&, const std::vector<std::basic_string<char> >&, const std::vector<std::basic_string<char> >&, bool)
In file src/backend/cuda/compile_module.cpp:
Process finished with exit code 1
which, as I believe, is related with the same issue.
Additional info:
I am using Anaconda, Python 3.8.5
Linux Manjaro 20.2.1
The solution to this problem can be found on Slack channel.
To cite:
I think its the order in which the libraries are loaded. Python 3 and some of the wheels use a standard library that conflicts with ArrayFire's standard library sometimes.
And the solution: write in terminal: LD_PRELOAD=<full_path_to_libafcuda> python your_python.py
Activity
[-]Error: In function void print()[/-][+]Error: In function void print() after installation[/+]JackyChan97 commentedon Jan 19, 2021
i have the same problem
WKrauze commentedon Jan 22, 2021
The solution to this problem can be found on Slack channel.
To cite:
And the solution: write in terminal:
LD_PRELOAD=<full_path_to_libafcuda> python your_python.pyFor example:
LD_PRELOAD=/opt/arrayfire/lib64/libafcuda.so python3 helloworld.pyIf you want to add this environment variable in PyCharm, follow the instructions given here.
For me this solves the problem.