2017-10-17 59 views
0

我剛安裝了PyOpenGL並繼續練習this tutorial。它首先創建一個窗口,這個簡單的代碼:libGL錯誤 - Unabe在Ubuntu中加載帶有OpengGL代碼的驅動程序

from OpenGL.GL import * 
from OpenGL.GLUT import * 
from OpenGL.GLU import * 

window = 0            # glut window number 
width, height = 500, 400        # window size 

def draw():           # ondraw is called all the time 
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # clear the screen 
    glLoadIdentity()         # reset position 

    # ToDo draw rectangle 

    glutSwapBuffers()         # important for double buffering 


# initialization 
glutInit()            # initialize glut 
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH) 
glutInitWindowSize(width, height)      # set window size 
glutInitWindowPosition(0, 0)       # set window position 
window = glutCreateWindow("noobtuts.com")    # create window with title 
glutDisplayFunc(draw)         # set draw function callback 
glutIdleFunc(draw)          # draw all the time 
glutMainLoop()  

但是當我嘗試運行它,我得到這個錯誤集:

An error ocurred while starting the kernel 
libGL error: unable to load driver: nouveau_dri.so 
libGL error: driver pointer missing 
libGL error: failed to load driver: nouveau 
libGL error: unable to load driver: swrast_dri.so 
libGL error: failed to load driver: swrast 
X Error of failed request: GLXBadContext 
Major opcode of failed request: 155 (GLX) 
Minor opcode of failed request: 6 (X_GLXIsDirect) 
Serial number of failed request: 43 
Current serial number in output stream: 42 
X Error of failed request: BadValue (integer parameter out of range for operation) 
Major opcode of failed request: 155 (GLX) 
Minor opcode of failed request: 24 (X_GLXCreateNewContext) 
Value in failed request: 0x0 
Serial number of failed request: 42 
Current serial number in output stream: 43 

有人能指導我,他們的意思是什麼,或者如何修復它們?

有關於這個問題的互聯網上有一些討論,但我還沒有找到一個強大的解決方案。順便說一下,我使用的是Ubuntu 16。謝謝

回答

0

看來你已經安裝了一些專有的驅動程序,然後事情就壞了。您應該卸載新安裝的NVDIA驅動程序並重新安裝。然後在主窗口中轉到搜索應用程序並在該窗口中鍵入其他驅動程序選擇您安裝的驅動程序。

如果這沒有幫助,你還沒有安裝任何額外的驅動程序,請在終端上鍵入以下命令,看看你是否有這樣的文件

「」找到nouveau_dri.so

如果不能找到安裝它,並應該修復錯誤。

相關問題