Can't get pi3d to work on vmware fusion 7

121 views
Skip to first unread message

Chris T.

unread,
Feb 20, 2015, 12:06:55 PM2/20/15
to pi...@googlegroups.com
Hi,

This is weird, since I installed Pi3d on vmware about a month ago and it worked. Later, uninstalled the vmware fusion trial and bought a license.

I'm using a Lubuntu 14.04.2 64bits image, however, I have tested it using Lubuntu 14.04.1 32 bits and Ubuntu 14.04.2 32 bits and the results are the same.

When trying to run any demo, I get the following:

Traceback (most recent call last):
  File "Minimal.py", line 7, in <module>
    DISPLAY = pi3d.Display.create(x=150, y=150)
  File "/usr/local/lib/python2.7/dist-packages/pi3d/Display.py", line 487, in create
    display.opengl.create_display(x, y, w, h, depth=depth, samples=samples)
  File "/usr/local/lib/python2.7/dist-packages/pi3d/util/DisplayOpenGL.py", line 62, in create_display
    assert self.context != EGL_NO_CONTEXT
AssertionError

After some googling, I found that this error relates to the amount of vram available. lspci -v reveals:

00:0f.0 VGA compatible controller: VMware SVGA II Adapter (prog-if 00 [VGA controller])
Subsystem: VMware SVGA II Adapter
Flags: bus master, medium devsel, latency 64, IRQ 16
I/O ports at 1070 [size=16]
Memory at e8000000 (32-bit, prefetchable) [size=128M]
Memory at fe000000 (32-bit, non-prefetchable) [size=8M]
[virtual] Expansion ROM at c0000000 [disabled] [size=32K]
Capabilities: <access denied>
Kernel driver in use: vmwgfx

The VM settings are: 1024mb of ram, 768mb max for video.
According to vmware, the maximum amount of vram for a virtual machine is 128mb. Already tried increasing this trough modifications on the .vmx file, but the max allowed is 128mb.

Looking through this group, I found an answer that suggested to sudo find / -name libEGL* and symlink, according to faq answer #7. Now it gives a different error :(

I installed pi3d via pip, and also installed mesa-utils-extra, following the instructions on the pi3d readme.

Any help to make pi3d work on vmware, virtualbox, or even OS X would be great.
thanks.

Chris T.

unread,
Feb 20, 2015, 12:16:37 PM2/20/15
to pi...@googlegroups.com
A little more info on the problem (this is after doing the symlink)

sudo find / -name libGL*
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1

In python, I do:

>>> from ctypes.util import find_library
>>> find_library('EGL')
>>> 

and nothing else happens, guessing it's correct?

The new error, after the symlink:

  File "Minimal.py", line 7, in <module>
    DISPLAY = pi3d.Display.create(x=150, y=150)
  File "/usr/local/lib/python2.7/dist-packages/pi3d/Display.py", line 487, in create
    display.opengl.create_display(x, y, w, h, depth=depth, samples=samples)
  File "/usr/local/lib/python2.7/dist-packages/pi3d/util/DisplayOpenGL.py", line 37, in create_display
    self.display = openegl.eglGetDisplay(EGL_DEFAULT_DISPLAY)
AttributeError: 'NoneType' object has no attribute 'eglGetDisplay'

Thanks for your time everyone.

Patrick Gaunt

unread,
Feb 20, 2015, 12:48:49 PM2/20/15
to pi...@googlegroups.com
Chris,

firstly the second point!.. That searching for the alternative libraries is specifically a Raspberry Pi issue. I found that some software loaded on the RPi (gedit, but others apparently) was installing mesa for arm as a dependency which added versions of libEGL and libGLESv2 that didn't work!!! My suggestion was to get rid of the symbolic links so the 'real' libraries would be used. However on 'big' machines (with OpenGL rather than OpenGLES hardware) you need the mesa layer along with the installed libraries.

So after a long pre-amble you need to put the symbolic links back...

On the first question, I'm not really sure what could cause that error, basically anything that stops a valid  eglContext being created, more often than not on the RPi it's not enough gpu memory allocation. However it is odd that it all worked fine before with the same vmware version (presumably just a simple software switch difference between paid and free!) so my suspicions are that it is something to do with the setup process for vmware. I seem to remember @mung having trouble getting it working in the past and there was some setting to enable hardware gpu that defaulted to off see here

I'm keen to hear how you get on with this, let me know your progress or any other question. Also, I would dearly like to know how/if pi3d runs on OSX but have had several pre-emptive warning from my wife not to touch her mac!

Finally I'm curious to know what the attraction is for vmware, especially if you have to pay for it. It really isn't too bad to partition the disk and put on ubuntu, it doesn't take too long on a modern computer to reboot and choose a different operating system. (I choose windows about one day a fortnight, mainly so I don't fall too far behind with updates)

Chris T.

unread,
Feb 20, 2015, 7:35:41 PM2/20/15
to pi...@googlegroups.com
Patrick, thanks for your help. 

I had already checked the forum you linked to, and unfortunately the option "Enable 3D acceleration" was always checked on my VM. I deleted the VM, reinstalled everything, tried installing sudo apt-get install libgles2-mesa-dev, but Ubuntu 14.04.2 64 bits threw some errors, so I resorted to installing libgles1-mesa-dev-lts-raring and such, to no avail. Still gives the same error as before:


Traceback (most recent call last):
File "Minimal.py", line 7, in <module>
DISPLAY = pi3d.Display.create(x=150, y=150)
File "/usr/local/lib/python2.7/dist-packages/pi3d/Display.py", line 487, in create
display.opengl.create_display(x, y, w, h, depth=depth, samples=samples)
File "/usr/local/lib/python2.7/dist-packages/pi3d/util/DisplayOpenGL.py", line 62, in create_display
assert self.context != EGL_NO_CONTEXT
AssertionError



I really don't know what to do at this point but to continue development on native Raspberry Pi via sshfs. I don't really like changing context too much, so that's why I'm reluctant to dual boot ubuntu, and the vmware solution working during the trial is the reason I paid for it in the first place! Guess it's time for a refund, unless somene could help.

Regards,
Chris

Patrick Gaunt

unread,
Feb 21, 2015, 9:22:03 AM2/21/15
to pi...@googlegroups.com
Chris, I supposed you had been through all that to get it working the first time, but thought something might have slipped through! I think I've always just sudo apt-get install mesa-utils-extra but presumably that's what you started off trying. I'm running ubuntu 14.04 64bits too and finding the two libraries gives the same results as you:
...
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
...
/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1
/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1.0.0

The fact that you don't get the error about NoneType not having atribute eglGetDisplay means that libEGL must have loaded ok and is managing to create a display. So the only thing I can think of is that I added an extra parameter to the config for the context i.e. line 49 in pi3d/util/DisplayOpenGL.py (v1.13 the latest version which seems to be the one you're using from your error message) see here. So I would first try commenting out that line
   EGL_BUFFER_SIZE, 32,
   # EGL_SAMPLES, samples, 
   EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
If, on the off chance that works, then you should be able to do the same thing by adding an argument to the Display.create() method. i.e.
DISPLAY = pi3d.Display.create(x=150, y=150, samples=0)
If this change does turn out to be the culprit then I might switch back to default no anti-alias but with the option to add it if needed. Let me know what happens.

Paddy

Chris T.

unread,
Feb 21, 2015, 9:47:44 AM2/21/15
to pi...@googlegroups.com
It worked! Commenting line 49 on DisplayOpenGL.py makes everything work again on vmware. Thank you so much! 

I wonder why it didn't work with the EGL_SAMPLES setting?

Anyway, I really appreciate your time and help. Pi3d is a great library, thank you and the contributors for it.

Patrick Gaunt

unread,
Feb 21, 2015, 10:15:58 AM2/21/15
to pi...@googlegroups.com
Chris, thanks for the exhaustive/exhausting testing! Does it work if you uncomment the line and add the samples=0 argument to Display.create()? The issue is probably in the implementation of OpenGL on the graphics card and how mesa uses that, what machine are you using?.. Though I don't really know, I will do some googling later.

Anyway, I will make the default behaviour non anti-aliased. Mechanism dependent on your answer to above.

Also, let us know what and how your pi3d project pans out.

Chris T.

unread,
Feb 21, 2015, 10:31:54 AM2/21/15
to pi...@googlegroups.com
Patrick, I just tested and can confirm that it works with line 49 uncommented and adding the samples=0 argument to Display.create(). I'm using a macbook air 2014 host with Ubuntu 14.04.2 64 bits running as a guest on vmware fusion 7.

Currently I'm using pi3d to make an animated game-like user interface, just testing stuff really since I had never worked with 3D before, so expect more questions on this list :). I will make sure to update on my progress. 

Thanks!

Chris T.

unread,
Feb 21, 2015, 11:05:13 AM2/21/15
to pi...@googlegroups.com
I should add that setting samples=2, samples=4, etc, throws the same error as before. It only works when samples=0 + line uncommented, or line commented and no 'samples' argument. (or maybe I don't know what number to put there).

Chris.

Patrick Gaunt

unread,
Feb 21, 2015, 11:29:20 AM2/21/15
to pi...@googlegroups.com
I've only ever seen 4 used but it sounds like the EGL function interprets samples=0 the same as leaving the argument out completely.

Anyway, I've pushed up a revised version of Display to the develop branch with default samples=0 and I've added some info in the FAQ about the issue and how to enable anti-aliasing (though that's going to be out of step until the move to v1.14, hopefully this won't be a frequent problem for people)
Reply all
Reply to author
Forward
0 new messages