matploltib use gpu ?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

matploltib use gpu ?

nice
Hello, i have a question.

I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or PyOpenCL implemnetation for matploltib ?

Thanks for advance.
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Benjamin Root
Not at this time. However, there is another python project that does: vispy.org

VisPy does a fantastic job of offloading to GPU and it is quite straight-forward to use. There have been discussions between the devs of the two projects to figure out how we can plug one project into the other (most likely have vispy be an optional backend of sorts), but that is still awhile down the road. Check it out!

Cheers!
Ben Root


On Tue, Jan 12, 2016 at 2:52 AM, nice <[hidden email]> wrote:
Hello, i have a question.

I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or
PyOpenCL implemnetation for matploltib ?

Thanks for advance.



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Phlya
I have not tried it, but another library for that is glumpy: https://glumpy.github.io/

2016-01-15 14:50 GMT+00:00 Benjamin Root <[hidden email]>:
Not at this time. However, there is another python project that does: vispy.org

VisPy does a fantastic job of offloading to GPU and it is quite straight-forward to use. There have been discussions between the devs of the two projects to figure out how we can plug one project into the other (most likely have vispy be an optional backend of sorts), but that is still awhile down the road. Check it out!

Cheers!
Ben Root


On Tue, Jan 12, 2016 at 2:52 AM, nice <[hidden email]> wrote:
Hello, i have a question.

I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or
PyOpenCL implemnetation for matploltib ?

Thanks for advance.



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Benjamin Root
Yes, glumpy is a sister project of VisPy that has largely been assimilated into VisPy, if I understand it all correctly.

On Fri, Jan 15, 2016 at 9:57 AM, Ilya Flyamer <[hidden email]> wrote:
I have not tried it, but another library for that is glumpy: https://glumpy.github.io/

2016-01-15 14:50 GMT+00:00 Benjamin Root <[hidden email]>:
Not at this time. However, there is another python project that does: vispy.org

VisPy does a fantastic job of offloading to GPU and it is quite straight-forward to use. There have been discussions between the devs of the two projects to figure out how we can plug one project into the other (most likely have vispy be an optional backend of sorts), but that is still awhile down the road. Check it out!

Cheers!
Ben Root


On Tue, Jan 12, 2016 at 2:52 AM, nice <[hidden email]> wrote:
Hello, i have a question.

I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or
PyOpenCL implemnetation for matploltib ?

Thanks for advance.



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Phlya
The first two points in its FAQ address this question: http://glumpy.readthedocs.org/en/latest/faq.html

2016-01-15 15:03 GMT+00:00 Benjamin Root <[hidden email]>:
Yes, glumpy is a sister project of VisPy that has largely been assimilated into VisPy, if I understand it all correctly.

On Fri, Jan 15, 2016 at 9:57 AM, Ilya Flyamer <[hidden email]> wrote:
I have not tried it, but another library for that is glumpy: https://glumpy.github.io/

2016-01-15 14:50 GMT+00:00 Benjamin Root <[hidden email]>:
Not at this time. However, there is another python project that does: vispy.org

VisPy does a fantastic job of offloading to GPU and it is quite straight-forward to use. There have been discussions between the devs of the two projects to figure out how we can plug one project into the other (most likely have vispy be an optional backend of sorts), but that is still awhile down the road. Check it out!

Cheers!
Ben Root


On Tue, Jan 12, 2016 at 2:52 AM, nice <[hidden email]> wrote:
Hello, i have a question.

I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or
PyOpenCL implemnetation for matploltib ?

Thanks for advance.



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users




_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Benjamin Root
Ah, good to know about that update. Thank you!

On Fri, Jan 15, 2016 at 10:05 AM, Ilya Flyamer <[hidden email]> wrote:
The first two points in its FAQ address this question: http://glumpy.readthedocs.org/en/latest/faq.html

2016-01-15 15:03 GMT+00:00 Benjamin Root <[hidden email]>:
Yes, glumpy is a sister project of VisPy that has largely been assimilated into VisPy, if I understand it all correctly.

On Fri, Jan 15, 2016 at 9:57 AM, Ilya Flyamer <[hidden email]> wrote:
I have not tried it, but another library for that is glumpy: https://glumpy.github.io/

2016-01-15 14:50 GMT+00:00 Benjamin Root <[hidden email]>:
Not at this time. However, there is another python project that does: vispy.org

VisPy does a fantastic job of offloading to GPU and it is quite straight-forward to use. There have been discussions between the devs of the two projects to figure out how we can plug one project into the other (most likely have vispy be an optional backend of sorts), but that is still awhile down the road. Check it out!

Cheers!
Ben Root


On Tue, Jan 12, 2016 at 2:52 AM, nice <[hidden email]> wrote:
Hello, i have a question.

I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or
PyOpenCL implemnetation for matploltib ?

Thanks for advance.



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users





_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

nice
This post was updated on .
In reply to this post by nice
ok, i can't use gpu.

But in this case it matplotlib can run multiple processor core?

I have quad core processor and matploltib use 25% max processor. Can i use more ?
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Michael Droettboom
matplotlib is not intrinsically multi-threaded, so it only uses one core (and main obstacle there is the GIL, though parts of the Agg rendering could probably be multithreaded if someone wanted to invest the effort).

However, if you are generating many plots in a row, the problem is "embarrassingly parallel", and it's quite straightforward to use the python multiprocessing library for this.

Mike

On Sat, Jan 16, 2016 at 4:39 AM, nice <[hidden email]> wrote:
ok, i can't use gpu.

But in this case it matplotlib can run multiple processor core?

I have quiad core processor and matploltib use 25% max processor. Can i use
more ?



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46663.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



--
Michael Droettboom
Continuum Analytics

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Benjamin Root
I should also point out that I rarely find times when matplotlib itself is a bottleneck. Often, it is some other portion of the processing pipeline that is the problem. I would utilize runsnakerun and do some profiling to find out exactly where the pain points are in your code.  I will note that, in my experience, when it is the plotting that is slowing things down, Basemap is typically the problem.

On Mon, Jan 25, 2016 at 9:06 AM, Michael Droettboom <[hidden email]> wrote:
matplotlib is not intrinsically multi-threaded, so it only uses one core (and main obstacle there is the GIL, though parts of the Agg rendering could probably be multithreaded if someone wanted to invest the effort).

However, if you are generating many plots in a row, the problem is "embarrassingly parallel", and it's quite straightforward to use the python multiprocessing library for this.

Mike

On Sat, Jan 16, 2016 at 4:39 AM, nice <[hidden email]> wrote:
ok, i can't use gpu.

But in this case it matplotlib can run multiple processor core?

I have quiad core processor and matploltib use 25% max processor. Can i use
more ?



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46663.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



--
Michael Droettboom
Continuum Analytics

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

nice
This post was updated on .
In reply to this post by nice
My problem: I have about 10 million point to plot.

with this example, moving in the graph is very slow.
Is there a way to have an intelligent zoom which removes invisible items on the eye?

nice wrote
import matplotlib
matplotlib.use('TkAgg')
import numpy
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import tkinter as Tk

root = Tk.Tk()
root.wm_title("Embedding in TK")


f = Figure(figsize=(5, 4), dpi=100)
a = f.add_subplot(111)


t = arange(0.0, 10000000, 1)
s = arange(0.0, 10000000, 1)
a.plot(t, s)


canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)

toolbar = NavigationToolbar2TkAgg(canvas, root)
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)


def _quit():
    root.quit()
    root.destroy()

button = Tk.Button(master=root, text='Exit', command=_quit)
button.pack(side=Tk.BOTTOM)

Tk.mainloop()
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Michael Droettboom
with this example, moving in the graph is very slow. Is there a way to have an intelligent zoom which removes invisible items on the eye?

We already do this kind of optimization for line plots as in your example, so I'm surprised it's slow for you.  We don't do anything like that for scatter plots though.

Mike

On Mon, Jan 25, 2016 at 12:35 PM, nice <[hidden email]> wrote:
My problem: I have about 10 million point to plot.

with this example, moving in the graph is very slow.
Is there a way to have an intelligent zoom which removes invisible items on
the eye?



import matplotlib
matplotlib.use('TkAgg')
import numpy
from numpy import arange, sin, pi
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,
NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import tkinter as Tk

root = Tk.Tk()
root.wm_title("Embedding in TK")


f = Figure(figsize=(5, 4), dpi=100)
a = f.add_subplot(111)


t = arange(0.0, 10000000, 1)
s = arange(0.0, 10000000, 1)
a.plot(t, s)


canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)

toolbar = NavigationToolbar2TkAgg(canvas, root)
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)


def _quit():
    root.quit()
    root.destroy()

button = Tk.Button(master=root, text='Exit', command=_quit)
button.pack(side=Tk.BOTTOM)

Tk.mainloop()




--
View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46677.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



--
Michael Droettboom
Continuum Analytics

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

Jon Roadley-Battin
In reply to this post by nice
On Mon, Jan 25, 2016 at 12:35 PM, nice <[hidden email]> wrote:

> My problem: I have about 10 million point to plot.
>
> with this example, moving in the graph is very slow.
> Is there a way to have an intelligent zoom which removes invisible items on
> the eye?
>
>
>
> import matplotlib
> matplotlib.use('TkAgg')
> import numpy
> from numpy import arange, sin, pi
> from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,
> NavigationToolbar2TkAgg
> from matplotlib.figure import Figure
> import tkinter as Tk
>
> root = Tk.Tk()
> root.wm_title("Embedding in TK")
>
>
> f = Figure(figsize=(5, 4), dpi=100)
> a = f.add_subplot(111)
>
>
> t = arange(0.0, 10000000, 1)
> s = arange(0.0, 10000000, 1)
> a.plot(t, s)
>
>
> canvas = FigureCanvasTkAgg(f, master=root)
> canvas.show()
> canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
>
> toolbar = NavigationToolbar2TkAgg(canvas, root)
> toolbar.update()
> canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
>
>
> def _quit():
>     root.quit()
>     root.destroy()
>
> button = Tk.Button(master=root, text='Exit', command=_quit)
> button.pack(side=Tk.BOTTOM)
>
> Tk.mainloop()


Afternoon,

Have you considered enabling Rasterization?  
a.plot(t, s, rasterized=True)


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: matploltib use gpu ?

nice
In reply to this post by nice
Yes, python turn has a 30% cpu instead of 25%
It there's an improvement in performance!

Why is there a 30% block? what art the rasterized