pyglet.gl.ContextException: Could not create GL context #13

文章推薦指數: 80 %
投票人數:10人

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 . Allreactions Sorry,somethingwentwrong. mmatl closedthisascompleted May7,2019 Copylink oarriaga commented Jul25,2019 • edited HiIhadasimilarissueandfixeditbylookingatwhichOpenGLversionIhadbycalling: glxinfo|grepOpenGL >>OpenGLcoreprofileversionstring:3.3(CoreProfile)Mesa19.1.3 ThenIchangedintheconstants.pyfileinpyrender.py(youcanfinditwhereveryouinstalledpyrenderinmycase:~/.local/lib/python3.7/site-packages/pyrender/constants.py) OPEN_GL_MAJOR=3 OPEN_GL_MINOR=3 AfterthatIwasabletorender:)! 👍 11 neonb88,vvcatstar,DavidLSmyth,monacv,WongChen,ibwh,flywheel1412,starimpact,quanzhou-li,LiuXinqi12,andbrooks0519reactedwiththumbsupemoji 😄 3 neonb88,WongChen,andquanzhou-lireactedwithlaughemoji 🎉 6 neonb88,mohanrobotics,WongChen,UttaranB127,ibwh,andquanzhou-lireactedwithhoorayemoji ❤️ 7 neonb88,vvcatstar,WongChen,ibwh,a-canela,quanzhou-li,andbrooks0519reactedwithheartemoji 🚀 4 neonb88,WongChen,ibwh,andquanzhou-lireactedwithrocketemoji Allreactions 👍 11reactions 😄 3reactions 🎉 6reactions ❤️ 7reactions 🚀 4reactions Sorry,somethingwentwrong. Copylink oarriaga commented Jul25,2019 @mmatlMaybeitwouldbeagoodideatocreateaconfigfiletochangetheOpenGLversionwithouthavingtochangethesourcecode Allreactions Sorry,somethingwentwrong. Copylink neonb88 commented Aug20,2019 @henrycleverDidyoufixyourissue?IthinkIbumpedintoanidenticalone,stillgoingthroughyoursteps. Cheers, Nathan Allreactions Sorry,somethingwentwrong. Copylink neonb88 commented Aug20,2019 @oarriagaYourcommentfixedtheissueforme! Imeanthiscomment: " ThenIchangedintheconstants.pyfileinpyrender.py(youcanfinditwhereveryouinstalledpyrenderinmycase:~/.local/lib/python3.7/site-packages/pyrender/constants.py) OPEN_GL_MAJOR=3 OPEN_GL_MINOR=3 " @henrycleverIhopethissolvestheissueforyouandanyfuturereaders. Allreactions Sorry,somethingwentwrong. Copylink monacv commented Jan8,2021 • edited @mmatl (smplifyx)mona@ubuntu:~/mona/code$pythontest_piglet.py Traceback(mostrecentcalllast): File"test_piglet.py",line1,in frompyglet.windowimportWindow File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/window/__init__.py",line1897,in gl._create_shadow_window() File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/gl/__init__.py",line206,in_create_shadow_window _shadow_window=Window(width=1,height=1,visible=False) File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/window/xlib/__init__.py",line173,in__init__ super(XlibWindow,self).__init__(*args,**kwargs) File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/window/__init__.py",line606,in__init__ context=config.create_context(gl.current_context) File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/gl/xlib.py",line204,increate_context returnXlibContextARB(self,share) File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/gl/xlib.py",line314,in__init__ super(XlibContext13,self).__init__(config,share) File"/home/mona/venv/smplifyx/lib/python3.6/site-packages/pyglet/gl/xlib.py",line218,in__init__ raisegl.ContextException('CouldnotcreateGLcontext') pyglet.gl.ContextException:CouldnotcreateGLcontext andthisisyourcodesnippet: (smplifyx)mona@ubuntu:~/mona/code$cattest_piglet.py 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)) andIhave: $glxinfo|grepOpenGL XErroroffailedrequest:BadValue(integerparameteroutofrangeforoperation) Majoropcodeoffailedrequest:152(GLX) Minoropcodeoffailedrequest:24(X_GLXCreateNewContext) Valueinfailedrequest:0x0 Serialnumberoffailedrequest:41 Currentserialnumberinoutputstream:42 Allreactions Sorry,somethingwentwrong. Copylink XihuaQiao commented Apr15,2021 Hi,Imetwiththesameproblem.IwonderwhereshouldIput_'OPEN_GL_MAJOR=3,OPEN_GL_MINOR=3'_?Didyoumeanglobalvariables?Thisismyconstant.pyfile.Itrytoadd_OPEN_GL_MAJOR=3,OPEN_GL_MINOR=3_afterthis,anditstilldidn'twork. Allreactions Sorry,somethingwentwrong. pushfoo mentionedthisissue Apr15,2021 DeveloperinstallationofarcaderaisesContextExceptiononsomeintelGPUsunderWindows10 pythonarcade/arcade#845 Closed Copylink nicolasugrinovic commented Apr29,2021 @mmatlIhavethesameproblemas@henryclever,howeverIamrunningoverSSH. File"/mnt/Data/nugrinovic/code/visualize/renderer.py",line85,in__init__ self.renderer=pyrender.OffscreenRenderer(height,width) File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyrender/offscreen.py",line31,in__init__ self._create() File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyrender/offscreen.py",line149,in_create self._platform.init_context() File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyrender/platforms/pyglet_platform.py",line52,ininit_context width=1,height=1) File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyglet/window/xlib/__init__.py",line173,in__init__ super(XlibWindow,self).__init__(*args,**kwargs) File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyglet/window/__init__.py",line606,in__init__ context=config.create_context(gl.current_context) File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyglet/gl/xlib.py",line204,increate_context returnXlibContextARB(self,share) File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyglet/gl/xlib.py",line314,in__init__ super(XlibContext13,self).__init__(config,share) File"/home/nugrinovic/miniconda3/envs/torch1.4/lib/python3.7/site-packages/pyglet/gl/xlib.py",line218,in__init__ raisegl.ContextException('CouldnotcreateGLcontext') Allreactions Sorry,somethingwentwrong. Copylink nicolasugrinovic commented Apr29,2021 Justfortherecord,Iadded: os.environ['PYOPENGL_PLATFORM']='egl' tothemainscriptandsolvedtheissue. 👍 1 zoe2718reactedwiththumbsupemoji ❤️ 3 lassad98,Suraj-Bhor,andhappy-jihyereactedwithheartemoji Allreactions 👍 1reaction ❤️ 3reactions Sorry,somethingwentwrong. Copylink kumar665manjeet commented Jul26,2021 AreyourunningthisoverSSH? Ineedanswerofthisproblem,canyouhelp... Allreactions Sorry,somethingwentwrong. Copylink HaFred commented Jul28,2021 AreyourunningthisoverSSH? Ineedanswerofthisproblem,canyouhelp... ForSSH,seemsliketheonlywayistousetheoffscreenrendering.Iamalsocuriousabouthowcanwerunpyrender.Viewer(scene,use_raymond_lighting=True)withSSH,please?@mmatlThankyou! Allreactions Sorry,somethingwentwrong. Copylink zouyuancc commented Jul29,2021 AreyourunningthisoverSSH? Ineedanswerofthisproblem,canyouhelp... Ijustreboottosolvetheproblem,butIdon'tknowwhy,youcantrytoseewhetheritworkornot Allreactions Sorry,somethingwentwrong. Copylink kumar665manjeet commented Jul29,2021 Irebootmysshserver,nownotabletoconnectit,showingtimeouterror Allreactions Sorry,somethingwentwrong. itswyri mentionedthisissue Oct1,2021 ContextException:CouldnotcreateGLcontext nghorbani/amass#21 Closed Copylink UttaranB127 commented Oct27,2021 HiIhadasimilarissueandfixeditbylookingatwhichOpenGLversionIhadbycalling: glxinfo|grepOpenGL >>OpenGLcoreprofileversionstring:3.3(CoreProfile)Mesa19.1.3 ThenIchangedintheconstants.pyfileinpyrender.py(youcanfinditwhereveryouinstalledpyrenderinmycase:~/.local/lib/python3.7/site-packages/pyrender/constants.py) OPEN_GL_MAJOR=3 OPEN_GL_MINOR=3 AfterthatIwasabletorender:)! Iwasfacingaverysimilarissueandthiswasthesolutionthatfinallyfixeditforme!Onesmallupdate:inmypyrender/constants.pyfile,Ihadtomakethechanges TARGET_OPEN_GL_MAJOR=3 TARGET_OPEN_GL_MINOR=3 Allreactions Sorry,somethingwentwrong. a-canela mentionedthisissue Dec15,2021 MadePyOpenGLversionflexibleatsetup.pytoavoidOSMesarenderingissues #205 Merged submagr mentionedthisissue May22,2022 pyglet.gl.ContextException:CouldnotcreateGLcontext #219 Open Copylink cleemesser commented Aug1,2022 • edited Writingfrom2022,itisusefultonotethatmanythingscancausethiserror.Itsoundslikeanythingthatdisruptscreatingthecontext,fromverygeneralproblemswithaccessingunderlyingClibraries,tospecificissueslikelikeofaccesstothedisplayorinadequateOpenGLversionbeingavailable. Ijusthadthiserrorwhenusingacondaenvironmentinstalledversionofpyrenderandpygletafterupgradingfromubuntu20.04to22.04.Evidentlyglibcwasupgradedfrom20.04->22.04,sothelibrariesinstalledinthecondaenvironmentpreviously. Documentationofwhattodoisdiscussedin: libGLErrorwithUbuntu22.04 fixin conda-forge/ctng-compilers-feedstock#98 Newlycreatedcondaenvironmentspullingfromconda-forgewillnothavethisproblemasinMayconda-forgeupdatedtousemorerecentlibraries. Allreactions Sorry,somethingwentwrong. Signupforfree tojointhisconversationonGitHub. Alreadyhaveanaccount? Signintocomment Assignees Nooneassigned Labels Noneyet Projects Noneyet Milestone Nomilestone Development Nobranchesorpullrequests 12participants Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?