Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

arrayfire-python conflict with pycuda on anaconda with Linux

Open
#191 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
anaconda, linux, python

Research direction

The failure is reported through arrayfire/tests/simple/array_test.py and arrayfire/tests/simple/_util.py, with formatting in arrayfire/array.py and error handling in arrayfire/util.py. Reproduce the Anaconda/Linux setup with pycuda installed, then compare it with the separate-PYTHONPATH workaround. Done means the simple tests pass without requiring that workaround, with the dependency interaction documented or fixed.

Written by the indexing model from the issue text.

Description

Hi,

I am using anaconda on linux, I have been previously using arrayfire on windows fine. I installed latest arrayfire on the Linux OS.. The error was

ERROR:root:Traceback (most recent call last):
  File "/home/sabih/anaconda3/lib/python3.6/site-packages/arrayfire/tests/simple/_util.py", line 32, in run
    test(verbose)
  File "/home/sabih/anaconda3/lib/python3.6/site-packages/arrayfire/tests/simple/array_test.py", line 26, in simple_array
    display_func(b)
  File "/home/sabih/anaconda3/lib/python3.6/site-packages/arrayfire/tests/simple/_util.py", line 50, in print_func_impl
    _print_log += str(arg) + '\n'
  File "/home/sabih/anaconda3/lib/python3.6/site-packages/arrayfire/array.py", line 1281, in __str__
    return self._get_metadata_str(dims=False) + self._as_str()
  File "/home/sabih/anaconda3/lib/python3.6/site-packages/arrayfire/array.py", line 1301, in _as_str
    safe_call(be.af_array_to_string(c_pointer(arr_str), "", self.arr, 4, True))
  File "/home/sabih/anaconda3/lib/python3.6/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<char>]
In file src/api/c/print.cpp:

After spending a day trying to think as to what the problem could be, I discovered that the problem is due to conflict with the install of pycuda, as soon as I removed pycuda, the arrayfire tests passed. The different version of pycuda give the same error.

Now I solved the issue by installing pycuda in a separate folder and adding that to the PYTHONPATH instead of the default in anaconda.

Dominant language
Python
Stars
422
Forks
63
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from arrayfire/arrayfire-python

All issues in arrayfire/arrayfire-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.