pyglet.gl.ContextException: Could not create GL context #13
文章推薦指數: 80 %
Which display drivers are you running? NVIDIA? If so, which version? The error message means that your system was unable to create an OpenGL 3.0 ...
Skiptocontent
{{message}}
mmatl
/
pyrender
Public
Notifications
Fork
176
Star
935
Code
Issues
119
Pullrequests
10
Actions
Projects
0
Security
Insights
More
Code
Issues
Pullrequests
Actions
Projects
Security
Insights
Newissue
Haveaquestionaboutthisproject?SignupforafreeGitHubaccounttoopenanissueandcontactitsmaintainersandthecommunity.
Pickausername
EmailAddress
Password
SignupforGitHub
Byclicking“SignupforGitHub”,youagreetoourtermsofserviceand
privacystatement.We’lloccasionallysendyouaccountrelatedemails.
AlreadyonGitHub?
Signin
toyouraccount
Jumptobottom
pyglet.gl.ContextException:CouldnotcreateGLcontext
#13
Closed
henrycleveropenedthisissue
Mar22,2019
·28comments
Closed
pyglet.gl.ContextException:CouldnotcreateGLcontext
#13
henrycleveropenedthisissue
Mar22,2019
·28comments
Comments
Copylink
henryclever
commented
Mar22,2019
•
edited
Hi,I'mtryingtorunthefollowingcode:
importtrimesh
importpyrender
tm=trimesh.load('/home/henry/Downloads/fuze.obj')
pymesh=pyrender.Mesh.from_trimesh(tm)
scene=pyrender.Scene()
scene.add(pymesh)
pyrender.Viewer(scene,use_raymond_lighting=True)
AndIgetthefollowingerror:
File"generate_pose_dataset.py",line172,inmesh_render
pyrender.Viewer(scene,use_raymond_lighting=True)
File"/usr/local/lib/python2.7/dist-packages/pyrender/viewer.py",line347,in__init__
self._init_and_start_app()
File"/usr/local/lib/python2.7/dist-packages/pyrender/viewer.py",line995,in_init_and_start_app
height=self._viewport_size[1])
File"/usr/local/lib/python2.7/dist-packages/pyglet/window/xlib/__init__.py",line170,in__init__
super(XlibWindow,self).__init__(*args,**kwargs)
File"/usr/local/lib/python2.7/dist-packages/pyglet/window/__init__.py",line595,in__init__
context=config.create_context(gl.current_context)
File"/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py",line216,increate_context
returnXlibContextARB(self,share)
File"/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py",line322,in__init__
super(XlibContext13,self).__init__(config,share)
File"/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py",line230,in__init__
raisegl.ContextException('CouldnotcreateGLcontext')
pyglet.gl.ContextException:CouldnotcreateGLcontext
MycomputershowsthatPyOpenGL3.1.0,PyOpenGL_accelerate3.1.0,andpygletappeartobecorrectlyinstalled.
Totestpygletexternallyfrompyrender,Iranthefollowingcode:
importpyglet
pyglet.window.Window()
andawindowopensasexpected.
Anyideaswhythiserrorisoccurring?
I'mrunning16.04with64bit.
Thanks!
HenryC.
Thetextwasupdatedsuccessfully,buttheseerrorswereencountered:
👍
2
SajjadAemmiandZHZisZZreactedwiththumbsupemoji
😕
2
neonb88andruoshiliureactedwithconfusedemoji
❤️
3
neonb88,monacv,andmaggiemae13reactedwithheartemoji
Allreactions
👍
2reactions
😕
2reactions
❤️
3reactions
Copylink
Owner
mmatl
commented
Mar22,2019
AreyourunningthisoverSSH?
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar22,2019
Hi,
Thanksforthequickresponse!No,Iamnotrunningoverssh.Itisalllocal.
HenryC.
Allreactions
Sorry,somethingwentwrong.
Copylink
Owner
mmatl
commented
Mar22,2019
Whichdisplaydriversareyourunning?NVIDIA?Ifso,whichversion?TheerrormessagemeansthatyoursystemwasunabletocreateanOpenGL3.0+context,whichcouldbecausedbyfaultydisplaydrivers.
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar22,2019
NoNvidiaGPUonthismachine.Here'swhatI'vegot:
*-display
description:VGAcompatiblecontroller
product:SkyLakeIntegratedGraphics
vendor:IntelCorporation
physicalid:2
businfo:pci@0000:00:02.0
version:07
width:64bits
clock:33MHz
capabilities:pciexpressmsipmvga_controllerbus_mastercap_listrom
configuration:driver=i915_bpolatency=0
resources:irq:132memory:de000000-deffffffmemory:c0000000-cfffffffioport:f000(size=64)
Blenderworksfine,ifthat'sanyindicationaboutthedisplaydriversbeingfaultyornot.
I'vegota1070TiwithCuda9.2onmyworkcomputerbutitwouldbenicetogetthisworkingonmylaptop.
HenryC.
Allreactions
Sorry,somethingwentwrong.
Copylink
Owner
mmatl
commented
Mar22,2019
Couldyourunthefollowingtinyscriptandletmeknowwhatitoutputs?
frompyglet.windowimportWindow
frompyglet.glimportConfig;
w=Window(config=Config(major_version=4,minor_version=1))
print('{}.{}'.format(w.context.config.major_version,w.context.config.minor_version))
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar23,2019
Yes:
File"generate_pose_dataset.py",line176,inmesh_render
w=Window(config=Config(major_version=4,minor_version=1))
File"/usr/local/lib/python2.7/dist-packages/pyglet/window/xlib/__init__.py",line170,in__init__
super(XlibWindow,self).__init__(*args,**kwargs)
File"/usr/local/lib/python2.7/dist-packages/pyglet/window/__init__.py",line595,in__init__
context=config.create_context(gl.current_context)
File"/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py",line216,increate_context
returnXlibContextARB(self,share)
File"/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py",line322,in__init__
super(XlibContext13,self).__init__(config,share)
File"/usr/local/lib/python2.7/dist-packages/pyglet/gl/xlib.py",line230,in__init__
raisegl.ContextException('CouldnotcreateGLcontext')
pyglet.gl.ContextException:CouldnotcreateGLcontext
Allreactions
Sorry,somethingwentwrong.
Copylink
Owner
mmatl
commented
Mar23,2019
Ah,interesting.Yeah,you'renotabletocreateanOpenGL3+context,whichisaproblemforpyrendersinceitusesmodernOpenGLforbetterefficiency.I'dtryuninstallingandre-installingPyOpenGL_accelerate,andmakesureitbuildsproperly.Letmeknowifthatfixesanything.
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar23,2019
Hi,
I'vetriedthat,both(1)usingpipand(2)fromsource.Itdoesnotappeartohavesolvedtheissue.Asstatedinthefirstpost,itworkswhenyouleavetheinputforWindow()blank.I'llkeeppokingaroundbit.Couldn'tgetPyMeshrunningeitherwithadifferentbutsimilarlyfrustratingproblem.
Warmth,
HenryC.
Allreactions
Sorry,somethingwentwrong.
Copylink
Owner
mmatl
commented
Mar23,2019
@henrycleverYeah,sorryaboutthat:(ItseemsthatpygletisjusthavingastrugglegettinganOpenGL3+contextonyourmachine.IfyoucangetthatshortscriptIgaveyoutowork,everythingwillworkinPyrender,butunfortunatelyitmayrequiresometweakstopyglet.Iwoulddebugthisfurtherforyou,butwithoutyourhardware,I'munabletoreplicatetheissue.Fornow,I'llleavetheissueopen.Letmeknowifthere'sanythingelseIcandotohelpyouout.
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar25,2019
Thanksfortheattentiontothis!
So,I'vemadesomeprogress.
AkeyproblemwasthatIwasgettingaGPUerrorwhenIusedthecommandglxinfo|grepPyOpenGL.Iinstalledthefollowingtomakeitgoaway:
sudoapt-getinstalllinux-generic-lts-wilyxserver-xorg-lts-wilylibgl1-mesa-glx-lts-wilylibglapi-mesa-lts-wilylibwayland-egl1-mesa-lts-wilylibgl1-mesa-glx-lts-wily:i386libglapi-mesa-lts-wily:i386
However,IwasstillgettinganerrorwhencreatingtheGLcontextwithpyglet.Theproblemseemsquitesillynow.Ihadinstalledpygletwiththefollowing:
sudopipinstallpyglet
Thisinstallspyglet1.3.2,whichthrowsanerroruponexecutingWindow(config=Config(major_version=4,minor_version=1)).However,ifIinstalledinstallpygletwithaptitude:
sudoapt-getinstallpython-pyglet
Thenpyglet1.1.4isinstalled,andtheerrorgoesaway.FYI,WhenIwasbuildingpygletfromsource,Iwasalsousing1.3.2.
However,anerrorisstillpresentwiththefollowingcode:
print('{}.{}'.format(w.context.config.major_version,w.context.config.minor_version))
aswellaswith:
pyrender.Viewer(scene,use_raymond_lighting=True).
Error:
print('{}.{}'.format(w.context.config.major_version,w.context.config.minor_version))
AttributeError:'XlibGLConfig13'objecthasnoattribute'major_version'
AndI'mhaven'tfigureditoutyet.I'llkeepprying,butanyifyouhaveanytips,I'mallears!
Warmth,
HenryC.
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar25,2019
Also:theerrorisslightlydifferentwithpyrender.Viewer(scene).Hereitis:
pyrender.Viewer(scene,use_raymond_lighting=True)
File"/usr/local/lib/python2.7/dist-packages/pyrender/viewer.py",line347,in__init__
self._init_and_start_app()
File"/usr/local/lib/python2.7/dist-packages/pyrender/viewer.py",line996,in_init_and_start_app
ifself.context.config.major_version<3:
AttributeError:'XlibGLConfig13'objecthasnoattribute'major_version'
Allreactions
Sorry,somethingwentwrong.
Copylink
Owner
mmatl
commented
Mar25,2019
Theerroryou'renowseeingisbecauseofcodechangesbetweenPygletversion1.1.4and1.3.2,Ibelieve.Basically,somewherebetweenthoseversions,theXlibGLConfig13typegotupdated.You'llwanttogetthisworkingwithamodern(>1.3)versionofPygletifpossible.
Allreactions
Sorry,somethingwentwrong.
Copylink
Author
henryclever
commented
Mar26,2019
Gotit!
Thanksforallthehelp.
RanintoyetmoreproblemswithmyIntelGPUonmylabtop.Iinstalledpyrenderonmyworkcomputerthathasa1070Ti(alsorunningUbuntu)andpyrenderworkedinlessthanaminute.SomethingaboutUbuntuandNvidiaproducts....thingsjustseemtoworkeasieringeneral!
I'llposthereagainifIfindasolutiontomyIntelGPUproblemsregardingpyrender.
H
Allreactions
Sorry,somethingwentwrong.
Copylink
Owner
mmatl
commented
Mar26,2019
Soundsgood,sorryforyourtrouble!IhavepyrenderrunningonmyMacbook
withanIntelGPU,soitmightbesomethingevenmoreversion-specific...
…
OnTue,Mar26,2019at11:22AMHenryM.Clever***@***.***>wrote:
Gotit!
Thanksforallthehelp.
RanintoyetmoreproblemswithmyIntelGPUonmylabtop.Iinstalled
pyrenderonmyworkcomputerthathasa1070Ti(alsorunningUbuntu)and
pyrenderworkedinlessthanaminute.SomethingaboutUbuntuandNvidia
products....thingsjustseemtoworkeasieringeneral!
I'llposthereagainifIfindasolutiontomyIntelGPUproblems
regardingpyrender.
H
—
Youarereceivingthisbecauseyoucommented.
Replytothisemaildirectly,viewitonGitHub
,ormute
thethread
延伸文章資訊
- 1pyglet.gl.ContextException: Could not create GL context issue
pyglet.gl.ContextException: Could not create GL context. I try installing manima as follows : # I...
- 2pyrender错误修复_lyyiangang的博客-程序员秘密
ContextException('Could not create GL context') pyglet.gl. ... Hi I had a similar issue and fixed...
- 3Unable to create GL context - 服飾貼文懶人包
pyglet.gl.ContextException: Could not create GL context #13 - GitHub。 2019年3月22日· NVIDIA? If so, ...
- 4about issue #51 pyglet.gl.ContextException: Could not create ...
ContextException: Could not create GL context ... I ask these questions as I am thinking of using...
- 5pyglet.gl.ContextException: Could not create GL context #13
Which display drivers are you running? NVIDIA? If so, which version? The error message means that...