Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOSX 10.13 GLFW panic "FormatUnavailable: NSGL: Failed to find a suitable pixel format" #186

Closed
alexelisenko opened this issue Jul 8, 2019 · 6 comments
Labels
MacOS Specifically concerns MacOS needs info More information is required from the reporter wontfix This will not be worked on

Comments

@alexelisenko
Copy link

I am getting the following error from GLFW on MacOSX 10.13.6.

GLFW: An invalid error was not accepted by the caller: FormatUnavailable: NSGL: Failed to find a suitable pixel format
GLFW: Please report this bug in the Go package immediately.
panic: FormatUnavailable: NSGL: Failed to find a suitable pixel format

goroutine 1 [running, locked to thread]:
github.com/go-gl/glfw/v3.2/glfw.acceptError(0xc0000b1d28, 0x2, 0x2, 0x0, 0x0)
	/Users/parallels/go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190519095719-e6da0acd62b1/v3.2/glfw/error.go:178 +0x203
github.com/go-gl/glfw/v3.2/glfw.CreateWindow(0x320, 0x500, 0x41704d9, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/parallels/go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190519095719-e6da0acd62b1/v3.2/glfw/window.go:289 +0x17d
github.com/go-flutter-desktop/go-flutter.(*Application).Run(0xc0000924e0, 0x0, 0x0)
	/Users/parallels/go/pkg/mod/github.com/go-flutter-desktop/go-flutter@v0.24.1/application.go:88 +0xc2
github.com/go-flutter-desktop/go-flutter.Run(0xc000090080, 0x3, 0x4, 0x3, 0xc0000b1f78)

I have files an issue in go-glfw, but I was hoping someone could point me in the right direction, as I think its related to this setting:

glfwWindowHint(GLFW_STENCIL_BITS, 8);

How can I set this when running hover run/build?

@pchampio pchampio added MacOS Specifically concerns MacOS wontfix This will not be worked on labels Jul 9, 2019
@zephylac
Copy link
Collaborator

zephylac commented Aug 1, 2019

I'm using MacOSX 10.13.6 but I didn't had the issue.
But with the fix below I don't have any drawbacks, maybe this will fix your issue.

First clone go-flutter repo
Then edit go.mod of one of your app or example app like that :

replace (
	github.com/go-flutter-desktop/go-flutter => ../../../go-flutter
)

Note that ../../../go-flutter is where is located you local go-flutter with the following modification.
The relative path is fixed from you go.mod

Go to your local go-flutter then edit application.go here.
Add the following code above :
glfw.WindowHint(glfw.StencilBits, 8);

Maybe you will also need to add the same line just above here.

Then launch you app using hover by running hover run and test.

N.B @Drakirus, I tried to check the value I set by using a.window.GetAttrib(glfw.StencilBits)
after the window was created, my app ended up crashing with :
panic: InvalidEnum: Invalid window attribute 135174.

@pchampio
Copy link
Member

pchampio commented Aug 1, 2019

@alexelisenko sorry I didn't understand your issue. The comment of @zephylac is correct, can you give it a try, and report back here!

@pchampio pchampio added needs info More information is required from the reporter and removed wontfix This will not be worked on labels Aug 1, 2019
@alexelisenko
Copy link
Author

@zephylac @Drakirus The above fix did not work, still getting the same crash, I also tested this on 10.15, which also crashes, it seems that only 10.14 works. Any ideas are greatly welcomed!

@alexelisenko
Copy link
Author

Im starting to wonder if this is related to OSX VMs, Since my machine is on 10.14 and it works fine, and all other versions do not, could it be related to the fact that I am testing in parallels VMs?

Ive looked through GLFW and found that the default for STENCIL_BITS is 8:

Window hint                   | Default value               | Supported values
----------------------------- | --------------------------- | ----------------
GLFW_RESIZABLE                | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_VISIBLE                  | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_DECORATED                | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_FOCUSED                  | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_AUTO_ICONIFY             | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_FLOATING                 | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_MAXIMIZED                | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_CENTER_CURSOR            | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_TRANSPARENT_FRAMEBUFFER  | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_FOCUS_ON_SHOW            | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_SCALE_TO_MONITOR         | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_RED_BITS                 | 8                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_GREEN_BITS               | 8                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_BLUE_BITS                | 8                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_ALPHA_BITS               | 8                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_DEPTH_BITS               | 24                          | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_STENCIL_BITS             | 8                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_ACCUM_RED_BITS           | 0                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_ACCUM_GREEN_BITS         | 0                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_ACCUM_BLUE_BITS          | 0                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_ACCUM_ALPHA_BITS         | 0                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_AUX_BUFFERS              | 0                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_SAMPLES                  | 0                           | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_REFRESH_RATE             | `GLFW_DONT_CARE`            | 0 to `INT_MAX` or `GLFW_DONT_CARE`
GLFW_STEREO                   | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_SRGB_CAPABLE             | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_DOUBLEBUFFER             | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_CLIENT_API               | `GLFW_OPENGL_API`           | `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API`
GLFW_CONTEXT_CREATION_API     | `GLFW_NATIVE_CONTEXT_API`   | `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API` or `GLFW_OSMESA_CONTEXT_API`
GLFW_CONTEXT_VERSION_MAJOR    | 1                           | Any valid major version number of the chosen client API
GLFW_CONTEXT_VERSION_MINOR    | 0                           | Any valid minor version number of the chosen client API
GLFW_CONTEXT_ROBUSTNESS       | `GLFW_NO_ROBUSTNESS`        | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET`
GLFW_CONTEXT_RELEASE_BEHAVIOR | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`
GLFW_OPENGL_FORWARD_COMPAT    | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_OPENGL_DEBUG_CONTEXT     | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_OPENGL_PROFILE           | `GLFW_OPENGL_ANY_PROFILE`   | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE`
GLFW_COCOA_RETINA_FRAMEBUFFER | `GLFW_TRUE`                 | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_COCOA_FRAME_NAME         | `""`                        | A UTF-8 encoded frame autosave name
GLFW_COCOA_GRAPHICS_SWITCHING | `GLFW_FALSE`                | `GLFW_TRUE` or `GLFW_FALSE`
GLFW_X11_CLASS_NAME           | `""`                        | An ASCII encoded `WM_CLASS` class name
GLFW_X11_INSTANCE_NAME        | `""`                        | An ASCII encoded `WM_CLASS` instance name

@pchampio
Copy link
Member

I was about to ask you if you where running those test in a VM. 😂
OpenGL doesn't works well on VM and hackintosh.
I'm super confident that it's a VM related issue, closing the issue since we cannot do anything.

@pchampio pchampio added the wontfix This will not be worked on label Aug 30, 2019
@alexelisenko
Copy link
Author

I just tested a 10.14 VM, and it also crashes, while not definitive, this does point to a Virtualization issue.. I am now searching for Host OSX 10.11-13 machine to test on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MacOS Specifically concerns MacOS needs info More information is required from the reporter wontfix This will not be worked on
Development

No branches or pull requests

3 participants