Open luckydog1996 opened 4 years ago
Are you using the cuda backend? If so you may also need to add the cuda paths. For example: export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64/:/opt/arrayfire/lib64/:$LD_LIBRARY_PATH More details here: https://github.com/arrayfire/arrayfire-python/wiki If that doesn't help, can you show the specific error message you are seeing? This may be better suited for the arrayfire-org slack channel...
After change I run python -m arrayfire.tests, it gives different error: (base) ztzhao@cw1:~$ python -m arrayfire.tests Simple algorithm: FAILED
ERROR:root:Traceback (most recent call last):
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/_util.py", line 32, in run
test(verbose)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/algorithm.py", line 20, in simple_algorithm
af.eval(k)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/device.py", line 218, in eval
eval(*args)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/device.py", line 168, in eval
safe_call(backend.get().af_eval(args[0].arr))
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/util.py", line 79, in safe_call
raise RuntimeError(to_str(err_str))
RuntimeError: In function cuda::Kernel cuda::buildKernel(int, const string&, const string&, const std::vector<std::basic_string
Simple arith: FAILED arrayfire.Array() Type: float
[
ERROR:root:Traceback (most recent call last):
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/_util.py", line 32, in run
test(verbose)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/arith.py", line 21, in simple_arith
display_func(b)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/_util.py", line 50, in print_func_impl
_print_log += str(arg) + '\n'
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/array.py", line 1300, in str
return self._get_metadata_str(dims=False) + self._as_str()
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/array.py", line 1320, in _as_str
safe_call(be.af_array_to_string(c_pointer(arr_str), "", self.arr, 4, True))
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/util.py", line 79, in safe_call
raise RuntimeError(to_str(err_str))
RuntimeError: In function void print(const char, af_array, int, std::ostream&, bool) [with T = float; af_array = void; std::ostream = std::basic_ostream
Simple array: FAILED arrayfire.Array() Type: float
[ arrayfire.Array() Type: float
[ arrayfire.Array() Type: float
[ (3,)
ERROR:root:Traceback (most recent call last):
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/_util.py", line 32, in run
test(verbose)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/array_test.py", line 26, in simple_array
display_func(b)
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/tests/simple/_util.py", line 50, in print_func_impl
_print_log += str(arg) + '\n'
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/array.py", line 1300, in str
return self._get_metadata_str(dims=False) + self._as_str()
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/array.py", line 1320, in _as_str
safe_call(be.af_array_to_string(c_pointer(arr_str), "", self.arr, 4, True))
File "/home/ztzhao/anaconda3/lib/python3.7/site-packages/arrayfire/util.py", line 79, in safe_call
raise RuntimeError(to_str(err_str))
RuntimeError: In function void print(const char, af_array, int, std::ostream&, bool) [with T = int; af_array = void; std::ostream = std::basic_ostream
Segmentation fault (core dumped)
I believe this can be combined with Issue #248 , since the error messages are the same.
The solution to this problem is given in #248 . I believe this issue can be closed.
I have include export LD_LIBRARY_PATH=/home/ztzhao/Downloads/arrayfire/lib64:$LD_LIBRARY_PATH in my ~/.bashrc, but when I want to run python -m arrayfire.tests it still can not load arrayfire libraries.