1
PyOpenGL/PyQt는에 큰 (2^13) 프레임 버퍼 오브젝트를 만들 때 메모리 부족 오류가 받고 있어요
width = 8192
height = 8192
self.textureFbo = QtOpenGL.QGLFramebufferObject(width,height)
self.textureFbo.bind()
texture = self.bindTexture(QtGui.QPixmap(self.textureFilePath)) # 2^13
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear (GL_COLOR_BUFFER_BIT);
glLoadIdentity()
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION);
glLoadIdentity()
glOrtho(0, +1, +1, 0, -0.1, 2.0);
glBegin(GL_POLYGON);
glTexCoord2d(1.0, 0.0)
glVertex3f (0.0, 0.0, 0.0)
glTexCoord2d(1.0, 1.0)
glVertex3f (1.0, 0.0, 0.0)
glTexCoord2d(0.0, 1.0)
glVertex3f (1.0, 1.0, 0.0)
glTexCoord2d(0.0, 0.0)
glVertex3f (0.0, 1.0, 0.0)
glEnd();
self.deleteTexture(texture)
self.textureFbo.release()
self.textureFboLoaded = True
을 제공합니다
OpenGL.error.GLError: GLError(
err = 1285,
description = 'out of memory',
baseOperation = glClear,
cArguments = (GL_COLOR_BUFFER_BIT,)
)
QGLFramebufferObject: Framebuffer incomplete attachment.
Traceback (most recent call last):
File "main.py", line 286, in paintGL
self.loadTextureFBO()
File "main.py", line 357, in loadTextureFBO
glEnable(GL_TEXTURE_2D)
File "C:\Python27\lib\site-packages\OpenGL\error.py", line 208, in glCheckErro
r
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 1285,
description = 'out of memory',
baseOperation = glEnable,
cArguments = (GL_TEXTURE_2D,)
)
QImage: out of memory, returning null image
그러나 2^12 텍스처 또는 FBO로 내려 가면이 동작이 잘됩니다.
주위에
132mb
268mb (4 바이트 * 8192^2)의 두 이미지 (FBO + 팅크)가 비디오 메모리 1GB를 채워야하는 것은 당연한 것 같습니다. 내가 뭘 놓치고 있니?
답변을 주셔서 감사합니다. 방금 GPU-Z라는 비디오 카드 프로파일 러를 찾았습니다. 두 번째 GPU의 메모리 사용량을 보여주지는 않습니다. 그래서 나는 SLI 설치가 엉망이라고 가정하고, 1GB의 vram만을 가지고있다. 어쨌든 스크립트를 실행하기 전에 기준 비디오 메모리 사용량은 26MB입니다. 내가 할 수있는 최대 프레임 버퍼 크기에서 스크립트를 실행합니다. 시행 착오가 정확히 7287^2이고, vram 사용량이 589MB로 최고가되면 7288^2로 이미지 크기를 늘리고 메모리 오류. 이상한, 메모리 제한 이외의 프레임 버퍼 크기에 대한 상한이 있습니까? – leohutson
SLI에서 텍스처를 두 카드에 모두로드해야합니다 (두 카드의 텍스처 유닛이 어떻게 효율적으로 실행될 수 있는지). 따라서 VRAM 크기를 함께 추가 할 수 없습니다. –
그것은 여전히 의미가 있습니다. vram 사용량은 589MB로 최고가되므로 매우 약간 더 큰 프레임 버퍼에 대해 메모리가 부족하다는 것이 이상하게 보입니다. – leohutson