我在 beaglebone 背面安装了 Ubuntu 14.04 (Trusty)。我通过这样的 vnc 会话连接到我的 beaglebone black:
在 Beaglebone 上:vncserver :1 -geometry 1024x768 -depth 24
这是 beagle bone 上的 Xorg 配置: Section "Monitor" Identifier "Builtin Default Monitor" EndSection
Section "Device"
Identifier "Builtin Default fbdev Device 0"
Driver "modesetting"
Option "HWcursor" "false"
EndSection
Section "Screen"
Identifier "Builtin Default fbdev Screen 0"
Device "Builtin Default fbdev Device 0"
Monitor "Builtin Default Monitor"
DefaultDepth 24
Option "AddARGBGLXVisuals" "True"
EndSection
Section "ServerLayout"
Identifier "Builtin Default Layout"
Screen "Builtin Default fbdev Screen 0"
EndSection
Section "Module"
Load "extmod"
Load "glx"
EndSection
当我运行我的 kivy 程序时,我收到以下消息:
[INFO ] Kivy v1.7.2
[INFO ] [Logger ] Record log in /home/ubuntu/.kivy/logs/kivy_14-02-15_24.txt
[INFO ] [Factory ] 144 symbols loaded
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
[INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600s
[DEBUG ] [App ] Loading kv <./setupmyprogram.kv>
[DEBUG ] [Window ] Ignored <egl_rpi> (import error)
[INFO ] [Window ] Provider: pygame(['window_egl_rpi'] ignored)
[WARNING] [WinPygame ] Video: failed (multisamples=2)
[WARNING] [WinPygame ] trying without antialiasing
[ERROR ] [Window ] Unable to use pygame
[ERROR ] [Window ] The module raised an important error: "Couldn't find matching GLX visual"
Traceback (most recent call last):
File "./setupmyprogram.py", line 55, in <module>
SetupMyProgramAPP().run()
File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 576, in run
self.load_kv(filename=self.options.get('kv_file'))
File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 399, in load_kv
root = Builder.load_file(filename)
File "/usr/lib/python2.7/dist-packages/kivy/lang.py", line 1323, in load_file
return self.load_string(data, **kwargs)
File "/usr/lib/python2.7/dist-packages/kivy/lang.py", line 1384, in load_string
widget = Factory.get(parser.root.name)()
File "/usr/lib/python2.7/dist-packages/kivy/uix/widget.py", line 151, in __init__
EventLoop.ensure_window()
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 111, in ensure_window
import kivy.core.window
File "/usr/lib/python2.7/dist-packages/kivy/core/window/__init__.py", line 983, in <module>
), True)
File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
cls = cls()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/__init__.py", line 468, in __init__
self.create_window()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_pygame.py", line 128, in create_window
raise CoreCriticalException(e.message)
kivy.core.CoreCriticalException: Couldn't find matching GLX visual
[INFO ] Kivy v1.7.2
[INFO ] [Logger ] Record log in /home/ubuntu/.kivy/logs/kivy_14-02-15_25.txt
[INFO ] [Factory ] 144 symbols loaded
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
[INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600s
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones
[INFO ] [Text ] Provider: pygame
[DEBUG ] [App ] Loading kv <./myapplication.kv>
[DEBUG ] [Window ] Ignored <egl_rpi> (import error)
[INFO ] [Window ] Provider: pygame(['window_egl_rpi'] ignored)
[WARNING] [WinPygame ] Video: failed (multisamples=2)
[WARNING] [WinPygame ] trying without antialiasing
[ERROR ] [Window ] Unable to use pygame
[ERROR ] [Window ] The module raised an important error: "Couldn't find matching GLX visual"
Exception kivy.core.CoreCriticalException: CoreCriticalException("Couldn't find matching GLX visual",) in 'kivy.properties.dpi2px' ignored
[DEBUG ] [Window ] Ignored <egl_rpi> (import error)
[INFO ] [Window ] Provider: pygame(['window_egl_rpi'] ignored)
[WARNING] [WinPygame ] SDL wrapper failed to import!
[DEBUG ] [Window ] Ignored <sdl> (import error)
[DEBUG ] [Window ] Ignored <x11> (import error)
[CRITICAL] [Window ] Unable to find any valuable Window provider at all!
[CRITICAL] [App ] Unable to get a Window, abort.
我无法弄清楚为什么我收到错误 [ERROR] [Window] Unable to use pygame [ERROR] [Window] 模块引发了一个重要错误:“找不到匹配的 GLX 视觉对象”
这是因为我正在通过 vncserver 运行吗?还是我的 beagleboard 中缺少某些东西(库/模块)。
我安装了以下内容: libgl1-mesa-glx:armhf libswt-glx-gtk-3-jni libxcb-glx0:armhf libva-glx1:armhf libqt5opengl5:armhf
此外,当我执行以下操作时,我会收到有关 GLX 视觉的相同错误:
ubuntu@arm:~$ python
Python 2.7.6 (default, Jan 12 2014, 08:42:26)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
>>> pygame.display.init()
>>> pygame.display.set_mode((640, 480), pygame.HWSURFACE|pygame.OPENGL|pygame.DOUBLEBUF)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pygame.error: Couldn't find matching GLX visual
>>>
>>> pygame.version.ver
'1.9.1release'
>>>
在此先感谢您的帮助!
更新: Stackexchange 不会让我回答我自己的问题......所以用解决方案更新我的问题:
我发现了这个问题。vncserver 没有提供 gl 功能,请改用 x11vnc。
x11vnc -display :0 -forever -bg -repeat -nowf
我没有使用密码文件,它会抱怨这个......但现在我可以 vnc 到我的 beagleboard 并使用 GL 运行 kivy 应用程序。