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

conflict with matplotlib.pyplot #208

Open
hyliu1989 opened this issue Jul 30, 2019 · 0 comments
Open

conflict with matplotlib.pyplot #208

hyliu1989 opened this issue Jul 30, 2019 · 0 comments

Comments

@hyliu1989
Copy link

These codes will trigger an error in just in time compiler

import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
import arrayfire as af

a = af.data.range( 640, 1280, dim=0 )
b = af.data.range( 640, 1280, dim=0 ) - 1

af.data.join(0,a,b,)

and the error output is

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    af.data.join(0,a,b,)
  File "/home/herbert/anaconda3/lib/python3.6/site-packages/arrayfire/data.py", line 320, in join
    safe_call(backend.get().af_join(c_pointer(out.arr), dim, first.arr, second.arr))
  File "/home/herbert/anaconda3/lib/python3.6/site-packages/arrayfire/util.py", line 79, in safe_call
    raise RuntimeError(to_str(err_str))
RuntimeError: In function std::vector<char> cuda::compileToPTX(const char*, std::string)
In file src/backend/cuda/jit.cpp:

However, without any major change, the following two will not,

# change the import order between pyplot and arrayfire

import matplotlib; matplotlib.use('Agg')
import arrayfire as af
import matplotlib.pyplot as plt

a = af.data.range( 640, 1280, dim=0 )
b = af.data.range( 640, 1280, dim=0 ) - 1

af.data.join(0,a,b,)

or

# do not perform the arithmetic operation on one of the array  

import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
import arrayfire as af

a = af.data.range( 640, 1280, dim=0 )
b = af.data.range( 640, 1280, dim=0 )

af.data.join(0,a,b,)

Here is my python environment obtained by running python in a terminal.

Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
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

1 participant