Handling Opengl error Out of memory - Support - VTK Discourse

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

Hi, I'm trying to make an adaptive volume loader, first trying to load super big volume that will probably not fit into the memory and then ... HandlingOpenglerrorOutofmemory Support mykolav (MykolaVankovych) August13,2020,4:15pm #1 Hi,I’mtryingtomakeanadaptivevolumeloader,firsttryingtoloadsuperbigvolumethatwillprobablynotfitintothememoryandthendecreasethevolumedimensionsandtryagainuntilthevolumeactuallyloads. I’veusedErrorObserverexampletointersepterrormessages,thenIrebuildthevolumedata.Thisgenerallyworks. TheproblemI’veseenhappeniswhenItrytoloadthevolumeofsize23gb,whilemyfreememoryis5gb,Icatch“Outofmemory”,thentrytoload3gbvolume,itstillgives“Outofmemory”eventhoughIhave5gbfree,andonlyonthethirdtrywith0.5gbitloadswithouterror. Thisdoesn’thappenifIloadthesame3gbvolumefromthestart,whatcouldbetheproblem,openglnotreleasingresourcesfastenough,errorhanginginsidethebufferfortoolong?howdoImanuallyfreetheopenglresources? lassoan (AndrasLasso) August13,2020,4:32pm #2 Itisgenerallyapproachedfromtheotherwayaround:youloadalow-resolutionvolumequicklytominimize“timetofirstimage”(importantqualityfactorofimagingsoftware).Then,preferablyinthebackground,youcanloadhigher-resolutionimage. Ingeneral,thereisnowaytosafelyprobetheamountofmemoryavailableonasystembytryingtoallocatememory:yoursoftwaremaygetimmediatelyterminatedifittriestoallocatemorememorythanitispermitted,oryoumaygetvirtualmemoryallocatedthatcausessomuchswappingthatrendersyourentirecomputerunusable.Itisbettertoallowtheusertospecifyamaximummemoryusagelimit(maybeinitializethatlimitfromvaluethatyoudeterminefromsysteminformation;suchasusemaximumof50%oftotalRAMbydefault). Paulo_Carvalho (PauloCarvalho) August14,2020,12:24pm #3 Hi,Mykola, ItseemsI’mmissingsomething.Areyoureferingtomainmemoryorgraphicscardmemory?Thesearedifferentresources.Ifyou’reloadingvolumedatatoRAM,thenthereisnothingOpenGLcandotohelpyou.Youhavetocheckthememorymanagementtechniquesinyourprogram. AnotherreasonforgettingOoMerrorsismemoryfragmentation.Sometimesyouhavemanygigabytesfreeinyoursystem,butthereisnoslotbigenoughforyourbigblock. regards, Paulo mykolav (MykolaVankovych) August14,2020,1:15pm #4 Sorryfortheconfusion,Iwastalkingaboutgraphicscardmemory. Ithinktogotheotherwayandloadlow-resolutionfirstwouldbeamuchbetterapproach,thanks.HowwouldIknowifthevolumewasloadedsuccessfully? I’mstillconfusedwhywhenhaving5gbfreemem,andafterfailingtoload20gbI’malsofailingtoload3gb,eventhoughifIload3gbstraightaway,itworks. mykolav (MykolaVankovych) August14,2020,2:43pm #5 I’vemanagedtofixthenotloading3gbafter23gb.IfItriggertherenderinginbetweendoingtheloading(e.g.Modified()orResetCamera()andthenRender()),thenitworksand3gbisloadedafterthefailurewith23gb.Ithinktheopengljustneedstimetodeallocatethememory?idk… 2Likes



請為這篇文章評分?