关于python:Intel HD Graphics 3000上的PyOpenGL访问冲突

PyOpenGL access violation on Intel HD Graphics 3000

我在具有Intel HD 3000图形芯片组的Windows 8 64位笔记本电脑上遇到PyOpenGL 3.0.2的问题。 对glGenBuffers(1)的任何调用(在正确的GL初始化之后)都会崩溃:

1
2
3
4
5
6
7
  File".\\sample.py", line 7, in init
    buffer = glGenBuffers(1)
  File"latebind.pyx", line 32, in OpenGL_accelerate.latebind.LateBind.__call__ (src\\latebind.c:768)
  File"wrapper.pyx", line 308, in OpenGL_accelerate.wrapper.Wrapper.__call__ (src\\wrapper.c:5811)
  File"C:\\Python27\\lib\\site-packages\\OpenGL\\platform\\baseplatform.py", line 379, in __call__
    return self( *args, **named )
WindowsError: exception: access violation writing 0x00000000720CF630

完全相同的脚本可在其他计算机上使用。

我拥有支持OpenGL 3.1的最新版本的GPU驱动程序(15.28.12.64.2932)。

有任何想法吗?

这是示例脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
import sys
from OpenGL.GLUT import *
from OpenGL.GL import *
from OpenGL.GLU import *

def init():
    buffer = glGenBuffers(1)

glutInit(sys.argv)
glutInitWindowSize(600, 600)
glutCreateWindow("Sample")
init()
glutMainLoop()


我终于通过卸载整个Python 64位发行版并安装了32位Python和32位所有库来解决了这个问题。 另外,我不得不使用PyOpenGL3.1.a。 我不知道是什么原因导致了64位安装的问题。


即使您的驱动程序支持OpenGl 3.1,Glut也会默认为您提供OpenGL 2.0上下文。 您将需要一个3.1 cpntext,可能是这样的:

1
2
3
glutInitContextVersion(3, 1)
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE)
glutInitContextProfile(GLUT_CORE_PROFILE)

如果没有适当的3.1上下文,则任何3.1特定的调用都将导致崩溃。