Contributing to Vispy

427 views
Skip to first unread message

Krit Karan Singh Bharadwaj

unread,
Feb 22, 2015, 11:17:02 AM2/22/15
to visp...@googlegroups.com

Dear Developers,

I am Krit Karan, a second year student at Indian Institute of Information Technology, Sricity, India. I would love to get started by contributing to this organization keeping in mind Gsoc 2015. Can someone get me started?

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Feb 22, 2015, 12:18:21 PM2/22/15
to Vispy dev list
Hi Krit,

You'll find some pointers in recents posts on the vispy and vispy-dev
mailing lists. Let us know if there's anything of interest to you.

Best,
Cyrille
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/ea4e6caf-3db1-4f19-b5f4-6451e294c566%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Krit Karan Singh Bharadwaj

unread,
Feb 23, 2015, 9:05:41 AM2/23/15
to visp...@googlegroups.com
Hi,

I went through the Gsoc 2015 ideas page and I liked the idea of making VisPy work on the Raspberry Pi and mobile devices. I have worked on hardware software integrated projects earlier and would like to bring in my experience towards this project. I have cloned and forked the vispy repository. Now what should be my next step towards working on this project?

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Feb 23, 2015, 9:20:35 AM2/23/15
to Vispy dev list, Almar Klein, Eric Larson
If you have a Pi, an interesting first step would be to make some
VisPy demos work there! See this issue:
https://github.com/vispy/vispy/issues/495

Almar and Eric can probably help you more than me with this.
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/08dcf2ca-792e-4f32-adb5-a0cde51073fc%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Feb 23, 2015, 12:42:34 PM2/23/15
to visp...@googlegroups.com

Hi,

I do have a Pi, I will try with making some Vispy demos work there and get back to you with the problems faced or results achieved .


Thanking You,

Krit Karan

Krit Karan Singh Bharadwaj

unread,
Feb 24, 2015, 1:03:09 PM2/24/15
to visp...@googlegroups.com
Hi,

As you had guided me to make some Vispy Demo's work in Raspberry Pi, I was successful in doing so.

Steps that I followed:

1.) Cloned the vispy repository to my system.
2.) Using scp moved the vispy repository to raspberry pi. (Using ssh)
3.) Installed python setup.py on both my system and raspberry pi [Vispy Installation].
4.) Installed backend PySide on both my system and pi.
5.) Installed additional necessary add ons as per the errors such as Scipy etc.
6.) Studied Vispy Demo's working on both pi and my system. (Huge difference in terms of speed)


What should be my next step?

Thanking You,

Krit Karan

2014-09-09-172945_1318x736_scrot.png
2014-09-09-173256_1318x736_scrot.png
2014-09-09-173614_1318x736_scrot.png
2014-09-09-173905_1318x736_scrot.png
2014-09-09-174019_1318x736_scrot.png
2014-09-09-174532_1318x736_scrot.png

Cyrille Rossant

unread,
Feb 24, 2015, 1:13:44 PM2/24/15
to Vispy dev list, Almar Klein, Eric Larson
Hi Krit,

That's good! From your remark on performance, I assume software
rendering is used. This means that rendering is done by the CPU and
not the GPU. I think enabling GPU rendering for OpenGL ES 2.0 on the
Pi should be possible albeit tricky. That's your next step!

It seems that this package has succeeded doing it: https://github.com/tipam/pi3d

Eric and Almar, do you have further indications to give to Krit? I'm
not sure what needs to be done in VisPy in order to activate
GPU-accelerated ES 2.0 on the Pi...

Best,
Cyrille
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/3f55ae53-951c-4780-8bb5-18fa0a52616f%40googlegroups.com.

Almar Klein

unread,
Feb 24, 2015, 4:06:22 PM2/24/15
to Cyrille Rossant, Vispy dev list, Eric Larson
Yeah, I've looked at this at some point. If I remember correctly, I did
manage to make vispy use GL ES; the Qt backend has a ES variant that
both Eric and I contributed to.

However, I was unable to make the draws appear directly on screen, so
everything is drawn to an offscreen buffer, followed by a readpixels()
and blitted to the screen. Not good for performance that...

- Almar

Krit Karan Singh Bharadwaj

unread,
Feb 25, 2015, 12:13:45 AM2/25/15
to visp...@googlegroups.com

Hi,

I went through this link (https://github.com/tipam/pi3d). I will try enabling GPU rendering for OpenGL ES 2.0 and get back to you in a day or so, with the results and observations.



Thanking You,

Krit Karan

Krit Karan Singh Bharadwaj

unread,
Feb 25, 2015, 9:59:01 PM2/25/15
to visp...@googlegroups.com


Hi,

From our last discussion, I was supposed to study this https://github.com/tipam/pi3d. Here are some of my observations which may be crucial for this project's successful completion.


1.) The OpenGLES2.0 functionality of the Raspberry Pi or Android is used directly used by pi3d -> Great (We can also achieve something of this sort)

2.) As a result it becomes quite faster and all desired results can be achieved.


Please have a look at this link (https://drive.google.com/a/iiits.in/folderview?id=0B5eOHLgkHrn5b3BtUXZTbjVaNzg&usp=drive_web) which shows working of pi3d which I worked out reading pi3d docs.

Conclusion : Project of making VisPy work on the Raspberry Pi and mobile devices is doable.

Steps I would like to follow :

1.) Study the code base of VisPy in depth.

2.) See Performance difference in terms of execution of same script in pi3d and VisPy.

3.) Through 1 & 2 bring out the reason for such significant difference in performance.

4.) Start modifying the code locally and highlight the suitable changes to be made.

Is my approach correct? Also I would like you to guide me for achieving better results.

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Feb 26, 2015, 5:27:49 AM2/26/15
to Vispy dev list, Almar Klein
Hi Krit

I think you need further instructions from our side. It seems that you
need to link these two bits of code somehow:

in pi3d: https://github.com/tipam/pi3d/blob/master/pi3d/constants/__init__.py#L74
in VisPy: https://github.com/vispy/vispy/blob/master/vispy/gloo/gl/es2.py

The point is to make sure that the OpenGL API calls performed by VisPy
are routed to the appropriate GPU-accelerated driver.

I would say you should start with one of the simplest example
possible, for example
https://github.com/vispy/vispy/blob/master/examples/tutorial/gl/quad.py

You can display the FPS with
https://github.com/vispy/vispy/blob/master/vispy/app/canvas.py#L394

You can check which OpenGL driver is used with
https://github.com/vispy/vispy/blob/master/vispy/util/config.py#L341

Unfortunately I'm not at all familiar with that part of the code in
VisPy to tell what needs to be done. Almar, could you please have a
look and help Krit? Pi3d manages to do GPU-accelerated OpenGL ES 2.0
on the pi, so there's no reason we couldn't do that with VisPy! Maybe
we need to use a special backend? From a quick look it seems that pi3d
is using xlib...? https://github.com/tipam/pi3d/tree/master/pyxlib

Thanks,
Cyrille
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/5780759f-0d1b-42bb-9a3f-e6b719f3f493%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Feb 26, 2015, 1:10:22 PM2/26/15
to visp...@googlegroups.com
Hi,

Thank you for guiding me. I will certainly proceed in the way you have asked me to. Since some merging of two code bases is required, certainly local testing is must before any conclusions can be drawn. Thus I will need your help whenever I get stuck, I intend to modify the code base and will be back with modifications in code. Any other guidance?

Thanking you,

Krit Karan

Krit Karan Singh Bharadwaj

unread,
Feb 27, 2015, 9:08:16 AM2/27/15
to visp...@googlegroups.com

Hi,

I was trying to study more about fps and I executed the script canvas.py as specified in the earlier link. I am facing an error and don't know how to tackle it.

This was the error:

Traceback (most recent call last):
  File "canvas.py", line 11, in <module>
    from ..util.event import EmitterGroup, Event, WarningEmitter
ValueError: Attempted relative import in non-package

Could you please bring out the reason for this error?

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Feb 27, 2015, 9:10:09 AM2/27/15
to Vispy dev list
canvas.py is not meant to be executed directly. I was just pointing
out the measure_fps() method. There might be an actual example of how
to use it somewhere in the repo...
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/bb36823c-e017-4388-ac4e-3ea5f579424f%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Feb 27, 2015, 9:38:47 AM2/27/15
to visp...@googlegroups.com

Hi,


 I am a bit puzzled here, I just can't make out the reason to link  (https://github.com/tipam/pi3d/blob/master/pi3d/constants/__init__.py#L74) and https://github.com/vispy/vispy/blob/master/vispy/gloo/gl/es2.py.

Why I am asking this? Because even in Vispy, depending on the platform we are searching for GLESv2 and then loading it. I know this might sound bit silly but there is a confusion which needs to be resolved so that I deepen my familiarity with the code base. Could you please elaborate, what exactly is required?

Thanking You,

Krit Karan
Message has been deleted

Krit Karan Singh Bharadwaj

unread,
Mar 2, 2015, 10:25:57 PM3/2/15
to visp...@googlegroups.com
Hi,


First of all I would like to congratulate you as Python software foundation has been chosen as a mentoring organization.

I would like to highlight what all things I have worked on :

1.) Deeper understanding of Vispy: I have gone through the doc's and I am now better aware of Vispy's code .
2.) Linked the part of code -> small errors (require  a day or so more) [in pi3d: https://github.com/tipam/pi3d/blob/master/pi3d/constants/__init__.py#L74
in VisPy: https://github.com/vispy/vispy/blob/master/vispy/gloo/gl/es2.py ]

Apart from this, Were there any discussions regarding this project which I need to be aware of?

Thanking You,

Krit Karan




Cyrille Rossant

unread,
Mar 3, 2015, 4:12:19 AM3/3/15
to Vispy dev list
Here's what I think you should do now: write a small self-contained
Python script that displays something on the screen with OpenGL (for
example a rotating cube or whatever) with hardware acceleration on the
Pi. If some pi3d module is used, you need to include the code in that
file if it's short, or you can put that module in the same folder if
it's too long. Try to make the script as short as possible. Remove
anything not needed for the example. In the end you should have a
folder with a couple of files that have no external dependency, and
that does what we want. Then we can talk about how to integrate that
in VisPy.
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/997124a4-ff55-40d4-98e6-bab9b7cec8ef%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Mar 4, 2015, 11:39:48 PM3/4/15
to visp...@googlegroups.com



Hi,


Based on what I was asked to do this is all what all I have done :



1.) 2 Python scripts that use Opengl (one with pi3d module and pyxlib[special backend], other without it)


2.) According to this link ( http://www.raspberrypi.org/forums/viewtopic.php?f=33&t=6935 ) importing pi3d.constants does Hardware acceleration.



Observation:


Please refer to this link  (https://drive.google.com/folderview?id=0B5eOHLgkHrn5WG9pc2tBdU5Ybnc&usp=sharing ) containing two scripts (a.py), fps.py[for calulating frames per second], the entire pi3d module(only constants were imported), 2 text files which show fps data for both the scripts. (Significant difference) [drop rate is more which clearly shows scope for further improvement]



Thanking You,


Krit Karan





References :



1.) http://www.raspberrypi.org/forums/viewtopic.php?f=33&t=6935


2.) http://www.raspberrypi.org/forums/viewtopic.php?t=12630&p=136859


3.) http://thebugfreeblog.blogspot.in/2013/04/hardware-accelerated-qtmultimedia.html


4.) https://www.pygame.org/docs/tut/ImportInit.html





Krit Karan Singh Bharadwaj

unread,
Mar 6, 2015, 4:17:53 AM3/6/15
to visp...@googlegroups.com
Hi Cyrille,

Following our last discussion I have added whatever I have  done so for at ( https://github.com/kritkaran94/Project_on_pi ), please have a look at it.

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Mar 6, 2015, 4:24:13 AM3/6/15
to Vispy dev list
Hi Krit,

Thanks. Your script uses the old fixed-function pipeline with glBegin
etc. AFAIK OpenGL ES is not meant to support the old fixed function
pipeline. Can you use the new shader pipeline instead? You'll find
some references here: http://api.vispy.org/en/latest/

Also I'm a bit confused, because your script seems to use pygame and
PyOpenGL. Does this work on the Pi? If so, you want to get rid of them
and *just* use pi3d. The whole point of the experiment is to use the
bare minimum required to run OpenGL ES on the Pi. I think the pi3d
module is all you need. Then we can see how to integrate that in
VisPy.

Cyrille
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/ed7387dd-906a-4959-891c-deadd540317a%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Mar 6, 2015, 4:39:22 AM3/6/15
to visp...@googlegroups.com

Hi Cyrille,

The script a.py does use pygame and PyOpenGl, these work on pi, as all data was obtained after testing on pi. This time I will just use pi3d module and get back to you soon with a basic example (of course hardware acc will be ensured) . Also I wanted to ask if there is an application template which one needs to follow for writing a proposal, I would also like to consider writing the proposal for this project as early as possible. [before 16th March]

Thanking You,

Krit Karan  

Cyrille Rossant

unread,
Mar 6, 2015, 4:41:34 AM3/6/15
to Vispy dev list
There might be a template provided by Google indeed, maybe you can ask
on a GSoC 2015 mailing list? Have a look at the GSoC FAQ also.

Krit Karan Singh Bharadwaj

unread,
Mar 7, 2015, 6:10:03 AM3/7/15
to visp...@googlegroups.com

Hi Cyrille,


Following our last discussion I have added whatever I have done so for at ( https://github.com/kritkaran94/Project_pi_demo ), please have a look at it. This time just pi3d module has been used.

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Mar 9, 2015, 7:53:41 AM3/9/15
to Vispy dev list
Cool. Now what would be useful would be to remove the pi3d dependency!
More precisely, I want to see a minimal script that displays a cube
while making direct calls to the OpenGL ES API instead of making calls
to pi3d. The script will be much longer, and you can refactor in a few
separate modules if you prefer. But I want to see the minimal list of
commands to make in order to leverage GPU acceleration from Python on
the Pi.
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/6621e31c-3550-47e9-952d-4f77510ddfd2%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Mar 10, 2015, 8:53:02 AM3/10/15
to visp...@googlegroups.com
Hi Cyrille,


I have started working on what you have asked me to do. I will be back with the script in some time.


Thanking You,

Krit Karan

Krit Karan Singh Bharadwaj

unread,
Mar 12, 2015, 10:03:47 AM3/12/15
to visp...@googlegroups.com

Hi Cyrille,

 I have written a script which ensures hardware acceleration on pi, it still uses pi3d but it's very minimal use of the module. The code clearly shows that some header files such as Display[for screen], star shader, texture were only imported. Now, I actually understand that what you meant when you said that this part [https://github.com/tipam/pi3d/blob/master/pi3d/constants/__init__.py#L74] of pi3d's code needs to be linked with VisPy[https://github.com/vispy/vispy/blob/master/vispy/gloo/gl/es2.py]
 
Please have a look at this link[ https://github.com/kritkaran94/Hw_acc_Pi-/blob/master/mod3/Cube.py ] as the script ensures hardware acceleration. It's just the integrating part with VisPy which is to be looked upon for this Project. Also I wanted to ask you that pi3d uses kivy.app  for making pi3d work on mobile phones, so should I also start working on that part of the project?  

Also I have started working on my Proposal and based on your reply for the mobile phones part I will like to get it reviewed accordingly.

Thanking You,

Krit Karan

Krit Karan Singh Bharadwaj

unread,
Mar 13, 2015, 9:45:50 AM3/13/15
to visp...@googlegroups.com
Hi Cyrille,

Any issues with the script? If not, then what should be my next step? 

Thanking You,

Krit Karan

Cyrille Rossant

unread,
Mar 13, 2015, 10:37:20 AM3/13/15
to Vispy dev list
Hi Krit,

I'll try to get a look this week end and I'll get back to you.

Cyrille

--
You received this message because you are subscribed to the Google Groups "vispy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vispy-dev+...@googlegroups.com.

Cyrille Rossant

unread,
Mar 15, 2015, 6:09:53 AM3/15/15
to Vispy dev list
Hi Krit,

It's going in the right direction, but I have a few questions. It
seems that a few pi3d modules are missing in the repository. Can you
make sure that you've uninstalled the regular pi3d package before
testing your code? This way we have a standalone repo that works
without the dependency on the whole pi3d package.

As a first step we want this example to work on the Pi with hardware
acceleration. Then we want to integrate this directly into VisPy so
that VisPy can work on the Pi out of the box. Once this is all
working, we can start investigating the Android platform with pi3d
and/or Kivy. As you pointed out, it does look that pi3d can work on
Android as well with Kivy. We could follow the same approach to make
VisPy work on Android.

Best,
Cyrille
> --
> You received this message because you are subscribed to the Google Groups
> "vispy-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vispy-dev+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vispy-dev/55d0c8ea-4a9e-4011-ad7b-08acd2acc74d%40googlegroups.com.

Krit Karan Singh Bharadwaj

unread,
Mar 15, 2015, 8:44:44 AM3/15/15
to visp...@googlegroups.com
Hi Cyrille,

   I will uninstall the regular Pi3d packages and will give you the update after I have tested my code appropriately.  

  Thanking You,

  Krit Karan 

Krit Karan Singh Bharadwaj

unread,
Mar 15, 2015, 10:35:16 AM3/15/15
to visp...@googlegroups.com
Hi Cyrille,

  Contributing for VisPy has been a special learning experience so far. I would love to continue my work on this project for the entire summer but I have some other commitments to meet in this month. 

They are listed as follows:


1.)  Two of my Research Papers were accepted at ICIC 2015 and TENSYMP 2015, so I am busy with their final iteration before their camera ready draft is published.   

      TENSYMP 2015 :  

     a.) Deadline for Camera ready version was 14th March 2015 .
     b.)  Presently I am Preparing it's slides for my professor's review so that it can be presented at the conference. I want to finish the slide work for this project now itself so that it doesn't come in the way of my Summer Project :) . 

      ICIC 2015 :

     The deadline for it's camera ready Version is 25th March 2015, so I am busy working on it.

2.) Mid-Semester Exams :  I have my mid-semester exams from 25th - 27th May 2015.

3.) GSOC Proposal 2015 : The GSOC Proposal deadline is 27th March and I am also working on my Proposal for the Project, I would like to complete it   in a day or so and get your review on it.

Are there are any issues if I work on the standalone repository which could be directly merged with VisPy after 27th march? Though I will be involved in my Project through it's proposal, I don't want to hurry the VisPy's testing work which I have fallen in love with, I hope there aren't any issues?

Thanking You,

Krit Karan

 

Krit Karan Singh Bharadwaj

unread,
Mar 16, 2015, 2:17:45 PM3/16/15
to visp...@googlegroups.com


Hi Cyrille,


   This is my proposal for gsoc please have a look at it. What's your take on it?
   
   Thanking You,

    Krit Karan   
Vispy.pdf

Guillaume Ludwig

unread,
Apr 14, 2016, 10:51:07 AM4/14/16
to vispy-dev
Hi everyone,

any new information on this topic ? Can Vispy now run on the Raspberry Pi with hardware acceleration ?

Thanks,
Guillaume
Reply all
Reply to author
Forward
0 new messages