VC4 and V3D OpenGL drivers for Raspberry Pi: an update

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

The GPU bundled with Raspberry Pi 4 is a VideoCore VI capable of OpenGL ES 3.2, a significant step above the VideoCore IV present in ... News Allnews Searchthearchive RSS Here’sanupdatefromIagoToralofIgaliaondevelopmentoftheopensourceVC4andV3DOpenGLdriversusedbyRaspberryPi. SomeofyoumayalreadyknowthatEricAnholt,theoriginaldeveloperoftheopensourceVC4andV3DOpenGLdriversusedbyRaspberryPi,isnolongeractivelydevelopingthesedriversandateamfromIgaliahassteppedintocontinuehiswork.MynameisIagoToral(itoral),andtogetherwithmycolleaguesAlejandroPiñeiro(apinheiro)andJoséCasanova(chema),wehavebeenhardatworklearningabouttheV3DGPUhardwareandEric’sdriverdesignoverthepastfewmonths. LearninganewGPUisalotofwork,butIthinkwehavebeenmakinggoodprogressandinthispostwewouldliketosharewiththecommunitysomeofourrecentcontributionstothedriverandsomeoftheplanswehaveforthefuture. Butbeforewegointothetechnicaldetailsofwhatwehavebeenupto,IwouldliketogivesomecontextabouttheGPUhardwareandcurrentdriverstatusforRaspberryPi4,whichiswherewehavebeenfocusingourefforts. TheGPUbundledwithRaspberryPi4isaVideoCoreVIcapableofOpenGLES3.2,asignificantstepabovetheVideoCoreIVpresentinRaspberryPi3whichcouldonlydoOpenGLES2.0.DespitethefactthatbothGPUmodelsbelonginBroadcom’sVideoCorefamily,theyhavequitesignificantarchitecturaldifferences,sowealsohavetwoseparateOpenGLdriverimplementations.Unfortunately,asyoumayhaveguessed,thisalsomeansthatdriverworkononeGPUwon’tbedirectlyusefulfortheother,andthatanynewfeaturedevelopmentthatwedofortheRaspberryPi4driverstackwon’tnaturallytransporttoRaspberryPi3. ThedrivercodeforbothGPUmodelsisavailableintheMesaupstreamrepository.ThecodenamefortheVideoCoreIVdriverisVC4,andthecodenamefortheVideoCoreVIdriverisV3D.Therearenodownstreamrepositories–alldevelopmenthappensdirectlyupstream,whichhasanumberofbenefitsforendusers: Itisrelativelyeasyforthemoreadventuroususerstoexperimentwithdevelopmentbuildsofthedriver. ItisfairlysimpletofollowdevelopmentactivitiesbytrackingmergerequestswiththeV3DandVC4labels. Atpresent,theV3DdriverexposesOpenGLES3.0andOpenGL2.1.AsImentionedabove,theVideoCoreVIGPUcandoOpenGLES3.2,butitcan’tdoOpenGL3.0,sofuturefeatureworkwillfocusonOpenGLES. Okay,sowiththatintroductionoutoftheway,let’snowgointothenitty-grittyofwhatwehavebeenworkingonaswerampedupoverthelastfewmonths: Disclaimer:Iwon’tdetailhereeverythingwehavebeendoingbecausethenthiswouldbecomealongandboringchangeloglist;insteadIwilltrytosummarizetheareaswhereweputmoreeffortandthebenefitsthattheworkshouldbring.Forthoseinterestedinthefulllistofchanges,youcanalwaysgototheupstreamMesarepositoryandscanitforcommitswithIgaliaauthorshipandthev3dtag. Firstwehavetheshadercompiler,whereweimplementedabunchofoptimizationsthatshouldbeproducingbetter(faster)codeformanyshaderworkloads.ThisinvolvedworkattheNIRlevel,thelower-levelIRspecifictoV3D,andtheassemblyinstructionscheduler.Theshader-dbgraphbelowshowshowtheshadercompilerhasevolvedoverthelastfewmonths.ItshouldbenotedherethatoneofthebenefitsofworkingwithintheMesaecosystemisthatwegetalotofshaderoptimizationworkdonebyotherMesacontributors,sincesomepartsofthecompilerstackaresharedacrossmultipledrivers. Evolutionoftheshadercompiler(Junevspresent) Anotherareawherewehavedonesignificantworkistransformfeedback.Here,wefixedsomerelevantflushingbugsthatcouldcausetransformfeedbackresultstonotbevisibletoapplicationsafterrendering.Wealsooptimizedthetransformfeedbackprocesstobetterusethehardwareforin-pipelinesynchronizationoftransformfeedbackworkloadswithouthavingtoalwaysresorttoexternaljobflushing,whichshouldbebetterforperformance.Finally,wealsoprovidedabetterimplementationfortransformfeedbackprimitivecountqueriesthatmakesbetteruseoftheGPU(thepreviousimplementationhandledallthisontheCPUside),whichisalsocorrectathandlingoverflowofthetransformfeedbackbuffers(therewasnooverflowhandlingpreviously). WealsoimplementedsupportforOpenGLLogicOperations,anOpenGL2.0featurethatwassomehowmissingintheV3Ddriver.Thiswasresponsibleforthisbug,since,asitturnsout,thedefaultLibreOfficethemeinRaspbianwastriggeringapathinGlamorthatreliedonthisfeaturetorenderthecursor.AlthoughRaspbianhassincebeenupdatedtouseadifferenttheme,wemadesuretoimplementthisfeatureandverifythatthebugisnowfixedfortheoriginalthemeaswell. FixingPiglitandCTStestfailureshasbeenanotherfocusofourworkintheseinitialmonths,tryingtogetusclosertodriverconformance.YoucancheckthegraphbelowshowcasingPiglittestresultstohaveaquickviewathowthingshaveevolvedoverthelastfewmonths.ThisworkincludesarelevantbugfixforaratherannoyingbuginthewaythekerneldriverwashandlingL2cacheinvalidationthatcouldleadtoGPUhangs.Ifyouhaveobservedanymessagesfromthekernelwarningaboutwriteviolations(maybeaccompaniedbyGPUhangs),thoseshouldnowbefixedinthekerneldriver.Thisfixgoesalongwithauser-spacefixtogothatshouldbemergedsoonintheupstreamV3Ddriver. EvolutionofPiglittestresults(Junevspresent) Aacuriosity,hereisapictureofourownlittlecontinuousintegrationsystemthatweusetorunregressiontestsbothregularlyandbeforesubmittingcodeforreview. Ourcontinuousintegrationsystem Theotherbigpieceofworkwehavebeentackling,andthatweareveryexcitedabout,isOpenGLES3.1,whichwillbringComputeShaderstoRaspberryPi4!CreditforthisgoestoEricAnholt,whodidalltheimplementationworkbeforeleaving–hejustnevergottothepointwhereitwasreadytobemerged,sowehavepickedupEric’soriginalwork,rebasedit,andworkedonbugfixestohaveafullyconformantimplementation.WearecurrentlyhardatworksquashingthelastfewbugsexposedbytheKhronosConformanceTestSuiteandwehopetobereadytomergethisfunctionalityinthenextmajorMesarelease,solookforwardtoit! ComputeShadersisareallycoolfeaturebutitwon’tbethelast.I’dliketoendthispostwithasmallnoteonanotherimportantlargefeaturethatiscurrentlyinearlystagesofdevelopment:GeometryShaders,whichwillbringtheV3Ddriveronestepclosertoexposingafullprogrammable3Dpipeline–solookforwardtothataswell! Relatedposts AcceleratingFouriertransformsusingtheGPU GPGPUhackingonthePi Vectorsfromcoarsemotionestimation Real-timedepthperceptionwiththeComputeModule NextPost PlagueatPiTowers PreviousPost CodeyourownDonkeyKongbarrels|Wireframeissue24 Sharethispost PosttoTwitter PosttoFacebook PosttoLinkedin PosttoPinterest 41comments manuti 11thOctober2019, 1:13pm Awesome!!!Increíbletrabajoelvuestro. KennethHowe 11thOctober2019, 1:38pm Thankyouforyourhardworkanddedication. Awesomejobthatyouaredoing! IlikethatIamfinallyabletouseOnShape.comontheRaspberryPi4andIamlookingforwardtofutureimprovements. https://cad.onshape.com/check AndreyYaromenok 11thOctober2019, 3:14pm Greatnews! >>theVideoCoreVIGPUcandoOpenGLES3.2,butitcan’tdoOpenGL3.0, Canyougiveabitmoredetailsonthisissue? horace 12thOctober2019, 10:17am yes,iwouldalsofindthatinteresting.whatismissingforopengl3.0? CharlieBirks 12thOctober2019, 3:54pm LookingatMesa’scodeandwhatthedrivercurrentlysupports,itseemsthatRGTCandconditionalrenderingarethemissingbits… AlejandroPiñeiro 14thOctober2019, 10:54am >>>theVideoCoreVIGPUcandoOpenGLES3.2,butitcan’tdoOpenGL3.0, >Canyougiveabitmoredetailsonthisissue? ItisanissuewithHWlimits.VideocoreVIhwonlysupportsupto4multiplerendertargets. ForOpenGLESthatisenough,astheminimumvalueforGL_MAX_DRAW_BUFFERSis4(seetable6.27onOpenGLES3.0spec). ButforOpenGL3.0thatisnotenough,astheminimumvalueforGL_MAX_DRAW_BUFFERSis8(seetable6.51onOpenGL3.0spec). johnjones 31stOctober2019, 1:06pm willtheV3Dsupportthefollowingextensions? (alotofcodeusethemasapacksowouldhelpaLOT;-) *KHR_debug *KHR_texture_compression_astc_ldr *KHR_blend_equation_advanced *OES_sample_shading *OES_sample_variables *OES_shader_image_atomic *OES_shader_multisample_interpolation *OES_texture_stencil8 *OES_texture_storage_multisample_2d_array *EXT_copy_image *EXT_draw_buffers_indexed *EXT_geometry_shader *EXT_gpu_shader5 *EXT_primitive_bounding_box *EXT_shader_io_blocks *EXT_tessellation_shader *EXT_texture_border_clamp *EXT_texture_buffer *EXT_texture_cube_map_array *EXT_texture_sRGB_decode ChrisH 10thNovember2019, 2:14pm Woulditnotbepossibletosomehowemulateadditionalrendertargets? laurent 11thOctober2019, 3:51pm Niceworkguys,keepgoingon;) Onequestionthough:theV3D/VC4willalsohelpstomovethemaximumoftheblobfeaturesontheopensourcedriver,inordertousethemainlineLinuxkernel(suchasDSIscreen,CSIcameraandsoon),orisitjustMesarelated? IagoToral 15thOctober2019, 9:14am WeareonlyworkingontheMesasideofthings. AndrewOakley 11thOctober2019, 3:55pm IreallywantourCIsystematwork,tobeabunchofbrightly-colouredPibowsinapristinewhitecupboard.“Andthis,Ms.Impressive-Visitor,iswherewekeeptherainbowsthatdriveourbuildprocess…” TheBuzzSaw 11thOctober2019, 4:14pm AnychanceofVulkansupportontheVCVI? AlejandroPiñeiro 14thOctober2019, 11:04am FornowwearefocusingonprogressingtheGLESdriveronly.ThehardwareiscapableofdoingVulkanthoughsoofcoursewewouldliketoworkonthataswellinthefuture. IsmaelSalasLópez 12thOctober2019, 6:26am WhatdoIneedtoknowtoworkwithyou,you’remyidols.Iwouldliketoknowmorethatabouttheworkyoudoand,ifispossible,collaboratewithyou. Plox It’saveryinterestingtopictomeabouthowdoyoudevelopthegraphicsdriverfortheRaspberryPi Bastien 12thOctober2019, 10:35am WhataboutFullKMS? IagoToral 15thOctober2019, 9:03am WeareonlyworkingonprogressingGLESdriver,butIbelievethereisadifferentteamworkingonthis. MrCasa 13thOctober2019, 8:50am justwonderingifthisanyofthisworkonrpi4vc6willhelpwithhwencodingperformance? IagoTora 15thOctober2019, 9:08am Iguessyouaretalkingabouthardwareacceleratedvideoencoding.Idon’tthinkourworkwillhelpwiththat. JamesHughes 16thOctober2019, 10:04am Codecperformanceislookedatbyadifferentteam,butonthewholeit’salreadyrunningfairlyclosetomaximum(1080p50orso).ThereisnoHWsupportforH265encoding,onlydecoding. CharlieBirks 13thOctober2019, 2:25pm WhereshouldIreportbugs?Mycodeseemstotriggerafew… ChemaCasanova 15thOctober2019, 12:01am HereyouhavetheinstructionsabouthowtosubmitbugstoMesa3dhttps://www.mesa3d.org/bugs.html Youcanpostissuesathttps://gitlab.freedesktop.org/mesa/mesa/issues?label_name=v3d IagoToral 15thOctober2019, 9:10am https://gitlab.freedesktop.org/mesa/mesa/issues MakesuretotagthemwiththeV3Dlabel. AlejandroPiñeiro 15thOctober2019, 10:18am >WhereshouldIreportbugs?Mycodeseemstotriggerafew… Forbugsonthemesadriver,youcanreportthemhere: https://gitlab.freedesktop.org/mesa/mesa/issues/ usingthelabelv3d. CharlieBirks 15thOctober2019, 8:02pm Okay,definitelyknowwheretogonow:).LookslikeI’mdowntoonebugwithgitmaster,willreportwhenI’mbackonmyPi. AxelRichter 13thOctober2019, 4:01pm Wow,thatsawesome.NowMinetestrunsgreatonthislittleunit(Pi4).WithOpenGL2.1.i’llseefuture.YouGuysaregreat.ThePiisgoingbetterandbetter.VlcrunalsofastforInternetradio.Thisisthenicestandstablestminidesktop.Ilikethenoiselessandcompactversionoflinuxpc.Seefutureofyourwork. GreetingsAxelRichter Marek 13thOctober2019, 6:17pm Thanksguys! Keepthegreatjobon! Havingproperdriversisa“musthave”forme. Rpihadsluggishperformancefortoolong.. MikaelBonnier 14thOctober2019, 6:56pm IsitpossibletorunFreeCADandBlenderinRaspbianBusteronRaspberryPi4ModelBwith4GBRAM? Vaticinator 14thOctober2019, 10:56pm Blender2.79works. Nick 15thOctober2019, 3:19am FreeCADrequiresOpenGL2.0orlater,soit’stechnicallypossibletorunitontheRaspberryPi.ButBlenderrequiresOpenGL3.3,soitcan’tworkonanyexistingPi. Butit’smorecomplicatedwithBlender,consideringitalsoneedsSSE2,whichisx86-specific,and1GBvideoRAMasaminimumrequirement,whichisclearlyoutofthescopeoftheRaspberryPi. horace3d 15thOctober2019, 9:40am blender2.79worksfineandisintheraspbianrepository.it’sstillaveryniceanduseful3d-animationsoftware. blender2.80won’tworkanymoreunfortunately.eveniftheraspberrypi4supportedopengl3.3itprobablywouldbetooslowforsomeofthenewrealtimerenderingfeatures… AndreasBergmeier 14thOctober2019, 9:26pm SoreadingthisIassume,thatIgaliagotaccesstosomeHardwareDocsforVC6. Isthereanychancethecommunityisgettingaccess? JamesHughes 16thOctober2019, 10:01am Unlikelyatthisstage. horace 16thOctober2019, 10:15am unfortunatelyfreecad0.18fromtheraspbianrepositorycrashesifyoustartanewproject. butactuallytheraspberrypishouldbeabletorunit.seemstobesomebugthatmaybeshouldbereported? Thomas 19thOctober2019, 6:24am Greatworkguys,finallyagooddriverforme. Ayman 20thOctober2019, 10:50pm ItriedtobuildtheV3DDriverfortwodays.itdidnotwork.Cansomeoneputsomesimpleinstructiontohowtobuildthedriver,andhowtousetheoutcomeofthecompiledfiles?Thanks. klaus 16thDecember2019, 6:17am Hello, iwritedownhowcompilethesmesadriverontheraspberrypi4on64bitsystem.Itisingerman,sorry,butthecodeisenglishandhaveyouquestions,don’thesitatetoaskme.lookattilmun.de. MG 10thNovember2019, 9:01pm willwegetEXT_buffer_storageintheforGLES? Salvador 16thNovember2019, 1:13pm HowaboutS3TCtexturecompressionsupportforOpenGL?Atleastasoftwareimplementationindriver.AlotofgamesthatcanrunonthePIneedthis. SalvadorCipolla 17thNovember2019, 3:24pm WhataboutS3TCsupport?thereisachanceforatleastasoftwareimplementationindriver?thereisseveralgamesthatcanrunonthePIbutneedthis. Super_Pizza 21stDecember2019, 1:34am GoodWork!I’mjustwaitingforV3Dtohavegreatperformancesasadvertised. AndkeepuptheworkwithopenGLES(Vulkanwouldbecooltoo) ThePi4hasstillbadperformances,andIwouldREALLYlikeSmoothperformancelikeitwaswiththePi3. Ithasbeentoolong… LeaveaComment Commentsareclosed



請為這篇文章評分?