umlaeute / Gem

Graphics Environment for Multimedia (official repository)
https://gem.iem.at
Other
103 stars 29 forks source link

failed to init GLEW: your system only supports openGL-1.0 #257

Open sebshader opened 4 years ago

sebshader commented 4 years ago

I get this error on osx 10.14.6 in 64 bit Pd 0.51.0, both compiled from master and downloaded via deken.

then there are a whole bunch of: "[gemmacoswindow]: unable to switch to current window (do you have one?), cannot render!"

my configure flags (using homebrew llvm/libomp):

./configure \
  --with-libvlc-CFLAGS=-I/Applications/VLC.app/Contents/MacOS/include --with-libvlc-LIBS="-L/Applications/VLC.app/Contents/MacOS/lib -lvlc" \
  --with-pd=/Applications/Pd.app/Contents/Resources \
  --without-QuickTime-framework --without-Carbon-framework --with-defaultwindow=gemmacoswindow \
  --with-pd=/Applications/Pd-0.51-0-Next.app/Contents/Resources/src \
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/lib" \
  CPPFLAGS="-I/usr/local/opt/llvm/include -I/usr/local/opt/llvm/include/c++/v1 -I/usr/local/include" \
  --prefix=/Users/sebshader/Library/Pd/Gem

(I also tried gemcocoawindow) I notice that this has come up before in #204

sebshader commented 4 years ago

huh, when I create it in gemmacoswindow-help it works sending [create(, but not in for instance cone-help using gemwin and gemdefaultwindow.. edit: now that's not working anymore again either.. very bizarre.. edit2: ok, if I create a gemglutwindow before the gemmacoswindow it works (Though the lines and points in cone-help are flickering a lot and "destroy" seems to freeze the window, I get the "spinning ball"), but if I create a macoswindow first and then a glutwindow it crashes pd.

jamshark70 commented 3 years ago

One student has recently encountered this error after a macOS system upgrade (I believe upgraded to Big Sur... which was rather foolish right before exams given the heightened compatibility requirements for audio software, but, no control over that)... She had completed Gem-related homework before, but now is unable to open a Gem window, receiving the two error messages noted in this thread.

Is there any way forward?

umlaeute commented 3 years ago

@jamshark70 i don't really know, but she could try changing the windowing backend, by changing the gemdefaultwindow.pd abstraction in the Gem/-folder and replacing the [gemmacoswindow] (or whatever is there) to one of the other gem*window options installed on your system. (just look out for any externals (.pd_darwin,...) in the Gem/-folder that match the "gem*window" pattern). possibly good choices are:

00mb000 commented 3 years ago

changing to [gemglutwindow] works... ish.... I have a simple live input delay patch for my laptop's webcam feed but when i change the delay time Pd crashes

jamshark70 commented 3 years ago

i don't really know, but she could try changing the windowing backend, by changing the gemdefaultwindow.pd abstraction in the Gem/-folder and replacing the [gemmacoswindow] (or whatever is there) to one of the other gem*window options installed on your system.

Ok, I wrote this up for her and will wait for a reply back. Hope it works (though based on celestialtomes's comment, I'm not quite optimistic).

Ant1r commented 3 years ago

@celestialtomes your crash could be totally unrelated to the current issue (your variable delay could be buggy). If you don't change the delay time, does it still crash?

00mb000 commented 3 years ago

no it it does not crash as long as i don't change delay time

Ant1r commented 3 years ago

So i'd say you've successfully solved (locally) the current issue.

Your crash is another thing, so maybe you can ask help (and post your patch) elsewhere if you need, e.g in the Pd mailing list.

sebshader commented 3 years ago

turns out the "your system only supports openGL-1.0" part of this is wrong since in src/Base/GemContext.cpp (and in src/Gem/Manager.cpp) it should be if (GLEW_ERROR_GL_VERSION_10_ONLY == err) instead of just if (GLEW_ERROR_GL_VERSION_10_ONLY) around line 156 I think. (which will always evaluate true obviously) I think I'm getting GLEW_ERROR_NO_GL_VERSION which seems to indicate that opengl is failing to initialize. If I pop post("OpenGL version: %s", glGetString(GL_VERSION)); in there before the call to glewInit() I get OpenGL version: (null). If I run it in vanilla compiled by miller I get OpenGL Version: 2.1 NVIDIA-blah and everything works

This issue only happens with self-compiled pd (with OSX 10.14.6), using pd distributed from miller's site doesn't have this issue (even when I compile Gem myself). perhaps it has to do with the order of initialization/events of various versions of CoreFoundation or something

sebshader commented 3 years ago

maybe the cocoa window isn't made before the context tries to access it? It seems like some events aren't getting to the window creation before the context is made, at least

umlaeute commented 3 years ago

could you try with [gemglfw3window]? (you need to have glfw installed before running ./configure)

sebshader commented 3 years ago

@umlaeute so far that's working fine, except that if I open certain patches from the examples folder before opening a gemwin (like from another help file) it crashes pd. (without a crash log).. for instance 02.advanced/04.Fog.pd. Many examples open fine without having opened a gemwin though..

the window also can't be closed by clicking the close button but that's not too big of a deal.

umlaeute commented 3 years ago

the window also can't be closed by clicking the close button but that's not too big of a deal.

that's actually a feature. the [gemwin] object (well, the [gemglfw3window] object, really), emits a [window destroy( message, that you can use to trigger a [destroy( message to the object itself (if you actually want that).

umlaeute commented 3 years ago

the crash is weirder (but should probably be discussed in a separate ticket)

seppog commented 2 years ago

had the above problem ("[gemmacoswindow]: unable to switch to current window (do you have one?), cannot render!") on silicon mac m1 OS X 12.0.1 , replacing [gemmacoswindow] with [gemglfw3window] helped after installing glfw with brew, did only test some simple examples, they work, despite getting error: [gemglfw3window]: Cocoa: Failed to retrieve display name.

umlaeute commented 2 years ago

i hope that you only get the error message once.

umlaeute commented 2 years ago

also it seems that this was fixed (by just not emitting the error mesage) in upstream:https://github.com/glfw/glfw/commit/6a8ade99c753be7511c866782ef4dde1ba92cedc

seppog commented 2 years ago

in opening Gem->examples-> 01.basic->01.redSqauare.pd 3 times, but that's it. I'm using glfw 3.3.5 , thats what brew installes on my machine and tells me its up to date

namork commented 2 years ago

dear all. i'm having troubles to get pd running on a m1 macbook. can somebody summarize what makes pd/gem work on those machines? i downloaded Pd 0.52.1, go to help/find externals online/tipe in gem and download the newest version. the iy go to "/Library/Pd/Gem/gemdefaultwindow.pd" and find this:

#N canvas 3 45 450 300 10;
#X obj 125 66 inlet;
#X obj 125 243 outlet;
#X obj 125 145 t a a;
#X obj 175 187 route bang;
#X obj 175 167 spigot;
#X obj 208 143 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 232 208 print gem\$0win;
#X obj 125 100 gemglutwindow;
#X connect 0 0 7 0;
#X connect 2 0 1 0;
#X connect 2 1 4 0;
#X connect 3 1 6 0;
#X connect 4 0 3 0;
#X connect 5 0 4 1;
#X connect 7 0 2 0;

should i change gemglutwindow to something else? do i have to recompile something and if so, where could i find instructions to do that (for somebody who hasn't done this on a mac)?

thank you very very much for any help!

seppog commented 2 years ago

see the comments above how I got it to run on an M1

namork commented 2 years ago

seppong. thanks a lot! i replaced gemlutwindow with gemglfw3window in gemdefaultwindow.pd after installing glfw 3.3.6 with brew (brew install glfw). but still get the message "[gemmacoswindow]: unable to switch to current window (do you have one?), cannot render!" what's wrong with me ;o) i must admit that i'm a user of pd and not good programmer...

umlaeute commented 2 years ago

make sure to restart Pd.

if the problem persists, you might have multiple copies on your system, and modify the wrong one :-) if this is the case, start Pd in "verbose" mode (Preferences->Path, check the verbose checkbox; restart) to see where Gem is actually loaded from, and us the gemdefaultwindow.pd that resides besides Gem.

or just:

  1. create a new patch with a [gemwin] object
  2. open the [gemwin] object (it's an abstraction)
  3. find the [pd window] object (somewhere in the middle of the patch)
  4. open the [pd window] object (it's a subpatch)
  5. find the [gemdefaultwindow] object (somewhere in the middle of the patch)
  6. open the [gemdefaultwindow] object (it's an abstraction)
  7. find the [gemmacoswindow] object
  8. replace it with a [gemglfw3window] object
  9. save the gemdefaultwindow.pd abstraction
  10. restart Pd & happily live after
namork commented 2 years ago

umlaut

wow. thank you very much! but i’m still too stupid. i get the following message with this preferences (and i changed the default in both of the gems).

looks like i can't be helped ;o(

sonnige grüsse, roman

/Library/Pd/Gem/Gem.d_fat: dlopen(/Library/Pd/Gem/Gem.d_fat, 0x000A): tried: '/Library/Pd/Gem/Gem.d_fat' (fat file, but missing compatible architecture (have 'unknown,i386', need 'x86_64')), '/usr/lib/Gem.d_fat' (no such file)
GEM: Graphics Environment for Multimedia
GEM: ver: 0.94.git v0.94
GEM: compiled  on Feb 12 2019
GEM: maintained by IOhannes m zmoelnig
GEM: Authors :  Mark Danks (original version)
GEM:        Chris Clepper
GEM:        Cyrille Henry
GEM:        IOhannes m zmoelnig
GEM: with help by Guenter Geiger, Daniel Heckenberg, James Tittle, Hans-Christoph Steiner, et al.
GEM: found a bug? miss a feature? please report it:
GEM:    homepage https://gem.iem.at/
GEM:    bug-tracker https://bugs.gem.iem.at/
GEM:    mailing-list https://lists.puredata.info/listinfo/gem-dev/
GEM: compiled for MMX/SSE2 architecture
GEM: using SSE2 optimization
GEM: detected 10 CPUs
GEM: image loading plugins: magick SGI STB imageIO jpeg tiff
GEM: film loading plugins: AVF quicktime4linux
GEM: image saving plugins: SGI STB imageIO jpeg magick tiff
GEM: model loading plugins: ASSIMP3 OBJ
GEM: video record plugins: QT4L
GEM: video capture plugins: AVF decklink
 sigmund~ -npts 8192 -hop 2048 -npeak 36 peaks
... couldn't create
/Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin: dlopen(/Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin, 0x000A): Library not loaded: @loader_path/libglfw.3.dylib
  Referenced from: /Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin
  Reason: tried: '/Users/romankeller/Documents/Pd/externals/Gem/libglfw.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libglfw.3.dylib' (no such file)
/Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin: dlopen(/Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin, 0x000A): Library not loaded: @loader_path/libglfw.3.dylib
  Referenced from: /Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin
  Reason: tried: '/Users/romankeller/Documents/Pd/externals/Gem/libglfw.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libglfw.3.dylib' (no such file)
/Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin: dlopen(/Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin, 0x000A): Library not loaded: @loader_path/libglfw.3.dylib
  Referenced from: /Users/romankeller/Documents/Pd/externals/Gem/gemglfw3window.pd_darwin
  Reason: tried: '/Users/romankeller/Documents/Pd/externals/Gem/libglfw.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libglfw.3.dylib' (no such file)
 gemglfw3window
... couldn't create
[pix_texture]: using mode 1: TEXTURE_RECTANGLE
err-corr: no such object 
umlaeute commented 2 years ago

aye. we are getting somewhere...

it seems you do have two concurrent installations of Gem: one in /Library/Pd/Gem/, the other in /Users/romankeller/Documents/Pd/externals/Gem/. and you end up using the one in /Users/romankeller/Documents/Pd/externals/Gem/ (as you should).

now the problem is, that you have an architecture mismatch: the libglfw.3.dylib seems to be compiled for the M1 (arm64), but Gem is compiled for x86_64, and you cannot load an arm-binary into an intel-process (and vice-versa). that's a general limitations of cross-architecture library loading on all OSs i know of.

now, the libglfw.3.dylib that ships with Gem is not used for whatever reasons afaict, this also happened to @seppog , so he installed glfw3 via brew.

however, in seppo's case, (i guess) he got an x86_64-version of glfw3 (via brew), which worked; whereas you got the library for your native architecture (arm64).

so: @seppog how did you manage to get the x86_64 version? (it might be a matter of timing: e.g. installing the brew-package when there were only x86_64 pre-compiled packages available; and now there are arm64 binaries available as well). i don't know if it's possible to force brew into downloading an older version...

seppog commented 2 years ago

to be honest, I don't know, installed glfw3 dec 21 but did upgrade my brew install just recently. Brew info glfw shows:

glfw: stable 3.3.6 (bottled), HEAD
Multi-platform library for OpenGL applications
https://www.glfw.org/
/opt/homebrew/Cellar/glfw/3.3.6 (14 files, 475.8KB) *
  Poured from bottle on 2021-12-20 at 22:31:27
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/glfw.rb
namork commented 2 years ago

Am 28.02.2022 um 11:15 schrieb umläute @.***>:

aye. we are getting somewhere...

it seems you do have two concurrent installations of Gem: one in /Library/Pd/Gem/, the other in /Users/romankeller/Documents/Pd/externals/Gem/. and you end up using the one in /Users/romankeller/Documents/Pd/externals/Gem/ (as you should).

thanks for telling me. i deleted the gem in /Library/PD...

now the problem is, that you have an architecture mismatch: the libglfw.3.dylib seems to be compiled for the M1 (arm64), but Gem is compiled for x86_64, and you cannot load an arm-binary into an intel-process (and vice-versa). that's a general limitations of cross-architecture library loading on all OSs i know of.

now, the libglfw.3.dylib that ships with Gem is not used for whatever reasons afaict, this also happened to @seppog https://github.com/seppog , so he installed glfw3 via brew.

however, in seppo's case, (i guess) he got an x86_64-version of glfw3 (via brew), which worked; whereas you got the library for your native architecture (arm64).

so: @seppog https://github.com/seppog how did you manage to get the x86_64 version? (it might be a matter of timing: e.g. installing the brew-package when there were only x86_64 pre-compiled packages available; and now there are arm64 binaries available as well). i don't know if it's possible to force brew into downloading an older version…

maybe i have to wait until gem ships in arm64 then ;o( — Reply to this email directly, view it on GitHub https://github.com/umlaeute/Gem/issues/257#issuecomment-1054098356, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUUSSVBC6HC4CGQN7OCPTDU5NDKVANCNFSM4PCXMODQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.

namork commented 2 years ago

does this website suggest glfw to be for both plattforms?

https://formulae.brew.sh/formula/glfw

when i download the precompiled version i can select the architecture by only copying the subsequent files.

but unfortunately i don't know where to put them ;o(

https://www.glfw.org/download.html

umlaeute commented 2 years ago

this is totally untested, but there's some experimental universal builds (x86_64 + amd64) available at our CI

EDIT: i've fixed the broken link to the CI (originally it was https://git.iem.at/pd/Gem/-/jobs/artifacts/develop/download?job=macOS).

namork commented 2 years ago

dear umläute

i’m unable again. the link ends at 404 on my browser.

https://git.iem.at/pd/Gem/-/jobs/artifacts/develop/download?job=macOS https://git.iem.at/pd/Gem/-/jobs/artifacts/develop/download?job=macOS

and i can’t find it here;

https://git.iem.at/pd/Gem/-/jobs https://git.iem.at/pd/Gem/-/jobs

sunny greetings, roman

Am 28.02.2022 um 23:13 schrieb umläute @.***>:

this is totally untested, but there's some experimental universal builds (x86_64 + amd64) available at our CI https://git.iem.at/pd/Gem/-/jobs/artifacts/develop/download?job=macOS.

— Reply to this email directly, view it on GitHub https://github.com/umlaeute/Gem/issues/257#issuecomment-1054713780, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUUSSQKFSIU7BKQUVC6QSDU5PXQJANCNFSM4PCXMODQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.

umlaeute commented 2 years ago

sorry, i pasted the wrong link: https://git.iem.at/pd/Gem/-/jobs/artifacts/master/download?job=Darwin_snapshot

afaict, this includes universal binaries for all Gem stuff, but not for any helper libraries. (so for (advanced) model-loading, and image-reading you might need to install additional libraries via brew as well; glfw you already have...)

60-hz commented 2 years ago

Still cannot run Gem properly with M1 Mac with Monterey and the universal version from the link. Still the same problem:

Without Rosetta2, got:

/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin: dlopen(/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin, 0x000A): symbol not found in flat namespace '__ZN12FTBitmapFontC1EPKc'
/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin: dlopen(/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin, 0x000A): symbol not found in flat namespace '__ZN12FTBitmapFontC1EPKc'
megrimm commented 2 years ago

hello,

where do I find the experimental amr64 build? link above is dead.

tried my own build but still getting assimp errors here: https://github.com/umlaeute/Gem/issues/288

thanks!

umlaeute commented 2 years ago

true enough.

i've dropped the Darwin_snapshot builds, and with some recent builds the macOS job failed (but others succeeded), which seems to have removed the artifact.

in any case, i think i've managed to fix it again. the new download URL is:

https://git.iem.at/pd/Gem/-/jobs/artifacts/master/download?job=Darwin

Bartlebooth1424 commented 1 year ago

Still cannot run Gem properly with M1 Mac with Monterey and the universal version from the link. Still the same problem:

  • Need to change the default windows to [gemglfw3window] to be able to create a window
  • The buffer is displayed in the lower left quarter of the screen Tried with pd-0.52-2 Universal with Rosetta2 compatibility.

Without Rosetta2, got:

/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin: dlopen(/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin, 0x000A): symbol not found in flat namespace '__ZN12FTBitmapFontC1EPKc'
/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin: dlopen(/Users/.../Documents/Pd/externals/Gem/Gem.pd_darwin, 0x000A): symbol not found in flat namespace '__ZN12FTBitmapFontC1EPKc'

I wanted to add that I am reproducing these same two errors running on a late 2013 Intel i5 machine (Mojave - 10.14.6). I can only produce a render window through switching the renderer and even then the image is pinned to the bottom-left quarter of the render window. Attempts to correct this with offset messages to the gemwin object have not been successful.

umlaeute commented 1 year ago

the "bottom-left quarter" would be https://github.com/umlaeute/Gem/issues/243 which should be fixed in current master (but then there is also https://github.com/umlaeute/Gem/issues/342 which indicates that something went wrong again...)

ben-wes commented 1 year ago

just tried the latest build on my M2 mac with the latest Pd master build and the latest artifact from https://git.iem.at/pd/Gem/-/jobs/48964 and also get the symbol not found in flat namespace '__ZN12FTBitmapFontC1EPKc' error.

this doesn't really add much to the ticket here - but i'll happily help testing at least. i had a working Gem version running here which i built locally a few weeks ago (although unfortunately, i can't reproduce this anymore and don't know what i did there exactly). but i wanted to update with the latest changes since fullscreen mode didn't work for me.

cecisoloaga commented 11 months ago

Im using Monterey 12.6 on an intel Mac. Pure data 0.54. I installed in deken Gem, libdir, pmpd. I installed homebrew to install glfw library. restarted PD several times. I can not open the Gem window in PD.

This is the log i get:

----------------- done with main ---------------------- connection from 'pd' to 'pd-gui' on 127.0.0.1:51670 Tk 8.6.12 detected font: DejaVu Sans Mono using font: Menlo normal Loading plugin: /Applications/Pd-0.54-0.app/Contents/Resources/Scripts/pd_deken.tcl [deken] Platform detected: Darwin-amd64-float32 Loading plugin: /Applications/Pd-0.54-0.app/Contents/Resources/Scripts/pd_docsdir.tcl Pd documents directory: /Users/ceciliasoloaga/Documents/Pd GEM: Graphics Environment for Multimedia GEM: ver: 0.94.git v0.94-689-g6da25e8e1 GEM: compiled on Sep 1 2023 GEM: maintained by IOhannes m zmoelnig GEM: Authors : Mark Danks (original version) GEM: Chris Clepper GEM: Cyrille Henry GEM: IOhannes m zmoelnig GEM: with help by Guenter Geiger, Daniel Heckenberg, James Tittle, Hans-Christoph Steiner, et al. GEM: found a bug? miss a feature? please report it: GEM: homepage https://gem.iem.at/ GEM: bug-tracker https://bugs.gem.iem.at/ GEM: mailing-list https://lists.puredata.info/listinfo/gem-dev/ GEM: compiled for MMX/SSE2 architecture GEM: using SSE2 optimization GEM: detected 12 CPUs GEM: image loading plugins: SGI STB imageIO jpeg GEM: film loading plugins: AVF GEM: image saving plugins: SGI STB imageIO jpeg GEM: model loading plugins: ASSIMP3 OBJ GEM: video record plugins: NDI PNM GEM: video capture plugins: AVF NDI decklink /Users/ceciliasoloaga/Documents/Pd/externals/libdir/libdir.pd_darwin:dlopen(/Users/ceciliasoloaga/Documents/Pd/externals/libdir/libdir.pd_darwin, 0x000A): symbol not found in flat namespace (_sys_helppath) libdir: can't load library pmpd: can't load library -lib libdir: can't load library

umlaeute commented 11 months ago

@cecisoloaga there's no Gem-related error in your output.