1

I have Go code that opens a Fyne window. I run this on my MacBook and it works. I am trying to get it to run on a KVM Windows server. This issue isn't related to this specific KVM server as I've tried this on multiple windows servers and faced the same issue. When I run my code and it tries to opens a Fyne window, I get a dialog with the error:

Fyne error: window creation error Cause:APIUnavailable: WGL: The driver does not appear to support OpenGL At: C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/in ternal/driver/glfw/driver.go:149

I saw this SO thread. The driver on my server is from "6/21/2006", has version "10.0.17763.1", and model basicdisplay.inf_amd64_5103ac179273be89\Basic Display.sys. So it seems expired since that SO thread mentions

OpenGL required is 13 years old

I tried updating windows but that didn't fix it. I also tried doing Update Driver option in Display Adapters Properties, this said driver up to date. My server provider said:

The server doesn’t have a GPU or display so naturally it doesn’t need a graphics driver. Virtual machines don't come with graphics drivers on them because they don't have GPUs. Hence why the driver is the most basic one from Windows

They also mentioned that it's not Virtual Box so there is no 3D acceleration option. My user base is mainly going to be running my app on windows servers. I don't want to have my users go through this hassle. This Github Thread mentions I can use a Mesa DLL to make this work. Is this Mesa DLL something I can just include in my download link for my users if their on windows so that they never encounter this error?

If so I tried downloading mesa3d-25.0.1-release-msvc.7z, then I extracted it and put all the DLL files in the root folder of my project. However this did not fix the issue with Fyne.

Update

  • For the DLL to be used I guess I need to build the code first then run the exe. When I do so the fyne window is successfully shown but after a quick second the program crashes. I had to encapsulate the execution in a .bat file to see the crash logs. They are very long but include:
runtime.cgocall(0x7ff60e2b8cd0, 0xc000e23000) C:/Program Files/Go/src/runtime/cgocall.go:167 +0x3e fp=0xc000e22fd8 sp=0xc000e22f70 pc=0x7ff60d5c171e github.com/go-gl/gl/v2.1/gl._Cfunc_glowTexImage2D(0x7ffb3b6dc220, 0xde1, 0x0, 0x1908, 0x48, 0x13, 0x0, 0x1908, 0x1401, 0xc000e7d000) _cgo_gotypes.go:41396 +0x48 fp=0xc000e23000 sp=0xc000e22fd8 pc=0x7ff60e1829a8 fyne.io/fyne/v2/internal/painter/gl.(*coreContext).TexImage2D.TexImage2D.func1(...) C:/Users/Administrator/go/pkg/mod/github.com/go-gl/[email protected]/v2.1/gl/package.go:26528 github.com/go-gl/gl/v2.1/gl.TexImage2D(...) C:/Users/Administrator/go/pkg/mod/github.com/go-gl/[email protected]/v2.1/gl/package.go:26528 fyne.io/fyne/v2/internal/painter/gl.(*coreContext).TexImage2D(0x7ff60ece0340?, 0xde1, 0x0, 0x48, 0x13, 0x1908, 0x1401, {0xc000e7d000, 0x1560, 0x1560}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/gl_core.go:231 +0xe8 fp=0xc000e23050 sp=0xc000e23000 pc=0x7ff60e1b8b68 fyne.io/fyne/v2/internal/painter/gl.(*painter).imgToTexture(0xc000e80000, {0x7ff60efd4980?, 0xc000328880}, 0x0) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/texture.go:72 +0xea fp=0xc000e23100 sp=0xc000e23050 pc=0x7ff60e1ba0aa fyne.io/fyne/v2/internal/painter/gl.(*painter).imgToTexture(0xc000e80000, {0x7ff60efd4920, 0xc00034fec0}, 0x0) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/texture.go:86 +0x2e8 fp=0xc000e231b0 sp=0xc000e23100 pc=0x7ff60e1ba2a8 fyne.io/fyne/v2/internal/painter/gl.(*painter).newGlTextTexture(0xc000e80000, {0x7ff60efdf6c0?, 0xc000322ab0}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/texture.go:153 +0x28f fp=0xc000e23278 sp=0xc000e231b0 pc=0x7ff60e1baa2f fyne.io/fyne/v2/internal/painter/gl.(*painter).newGlTextTexture-fm({0x7ff60efdf6c0?, 0xc000322ab0?}) <autogenerated>:1 +0x33 fp=0xc000e232a0 sp=0xc000e23278 pc=0x7ff60e1baf33 fyne.io/fyne/v2/internal/painter/gl.(*painter).getTexture(0xc000e80000, {0x7ff60efdf6c0, 0xc000322ab0}, 0xc000e233c8) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/texture.go:39 +0x49 fp=0xc000e232e0 sp=0xc000e232a0 pc=0x7ff60e1b9f09 fyne.io/fyne/v2/internal/painter/gl.(*painter).drawTextureWithDetails(0xc000e80000, {0x7ff60efdf6c0, 0xc000322ab0}, 0xc000e51578?, {0xe23400?, 0xc0?}, {0xd89b1b2?, 0x7ff6?}, {0x5ad158?, 0xc0?}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/draw.go:249 +0x6d fp=0xc000e23368 sp=0xc000e232e0 pc=0x7ff60e1b620d fyne.io/fyne/v2/internal/painter/gl.(*painter).drawText(0xc000e80000, 0xc000322ab0, {0x0?, 0x0?}, {0xe23470?, 0xc0?}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/draw.go:243 +0x1f6 fp=0xc000e233e8 sp=0xc000e23368 pc=0x7ff60e1b6136 fyne.io/fyne/v2/internal/painter/gl.(*painter).drawObject(0x7ff60d56739f?, {0x7ff60efdf6c0?, 0xc000322ab0?}, {0xd5c8a01?, 0x7ff6?}, {0x67db8bff?, 0x0?}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/draw.go:139 +0x105 fp=0xc000e23438 sp=0xc000e233e8 pc=0x7ff60e1b56e5 fyne.io/fyne/v2/internal/painter/gl.(*painter).Paint(0xc000e80000, {0x7ff60efdf6c0, 0xc000322ab0}, {0x1?, 0x0?}, {0xe234e8?, 0xc0?}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/painter.go:93 +0x70 fp=0xc000e23480 sp=0xc000e23438 pc=0x7ff60e1b9250 fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).paint.func1(0xc000e23528?, {0xd56739f?, 0x7ff6?}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/canvas.go:296 +0x128 fp=0xc000e234e8 sp=0xc000e23480 pc=0x7ff60e1d8388 fyne.io/fyne/v2/internal/driver/common.(*Canvas).walkTree.func1({0x7ff60efdf6c0, 0xc000322ab0}, {0xefdfa20?, 0x7ff6?}, {0x12b140?, 0xc0?}, {0xe62e40?, 0xc0?}) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:503 +0x222 fp=0xc000e23538 sp=0xc000e234e8 pc=0x7ff60e1bdc22 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf6c0, 0xc000322ab0}, 0x0, {0x7ff60efdfa20, 0xc00012b140}, {0xe23658?, 0xc0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:171 +0x24a fp=0xc000e235f8 sp=0xc000e23538 pc=0x7ff60e174baa fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdfa20, 0xc00012b140}, 0x0, {0x7ff60efdf420, 0xc00044aee0}, {0xe23718?, 0xc0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e236b8 sp=0xc000e235f8 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf420, 0xc00044aee0}, 0x0, {0x7ff60efdfc60, 0xc00030d730}, {0x400008?, 0xc0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e23778 sp=0xc000e236b8 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdfc60, 0xc00030d730}, 0x0, {0x7ff60efdf360, 0xc0008e80f0}, {0xe23898?, 0xc0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e23838 sp=0xc000e23778 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf360, 0xc0008e80f0}, 0x0, {0x7ff60efdf3c0, 0xc0008e8140}, {0xe23958?, 0xc0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e238f8 sp=0xc000e23838 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf3c0, 0xc0008e8140}, 0x0, {0x7ff60efdf480, 0xc00047c000}, {0xe23a18?, 0xc0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e239b8 sp=0xc000e238f8 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf480, 0xc00047c000}, 0x0, {0x7ff60efdf3c0, 0xc00047e000}, {0x0?, 0x0?}, {0x43960000?, 0x440b4000?}, {0x40800000?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e23a78 sp=0xc000e239b8 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf3c0, 0xc00047e000}, 0x0, {0x7ff60efdf360, 0xc0008e8000}, {0xf94ace0?, 0x7ff6?}, {0xeff61e0?, 0x7ff6?}, {0xe3a320?, ...}, ...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:192 +0x36c fp=0xc000e23b38 sp=0xc000e23a78 pc=0x7ff60e174ccc fyne.io/fyne/v2/internal/driver.walkObjectTree.func1(...) C:/Users/Administrator/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:178 fyne.io/fyne/v2/internal/driver.walkObjectTree({0x7ff60efdf360, 0xc0008e8000}, 0x0, {0x0, 0x0}, {0x3?, 0x2?}, {0x0?, 0x0?}, {0x0?, ...}, ...) 
1
  • FWIW, I would recommend looking at <pkg.go.dev/modernc.org/tk9.0>: it provides cross-platform "plain" GUI which has two upshots for your case: 1) it does not require any 3D acceleration in order to work; 2) it uses native (core) UI functionality on Windows and MacOS (on Linux-based systems the's simply no such things as "native UI" but it looks OK there, too). Commented Mar 20 at 8:17

2 Answers 2

1

First I had to build my code using go build. Only this way was the program able to recognize the Mesa DLL.

Second of all, only the opengl32.dll file was needed from the Mesa download. I put this next to the exe build. But when I run like this I got the error in the question.

To fix this I created a run.bat file and inserted the following code which worked.

@echo off set GALLIUM_DRIVER=llvmpipe Main.exe pause 
Sign up to request clarification or add additional context in comments.

3 Comments

You should remove those environment variables - they won’t help and some (FYNE_RENDERER at least) are made up, maybe an AI confused you? Just having the .dll next to the running app should be enough.
«First I had to build my code using go build.» ­— can you clarify what this is supposed to mean? There are only two ways to produce an executable image file from a Go program: by running go build or go install, and the latter merely calls the former.
(I've modified this answer to remove material that needed to be asked as a new question. It looks like you have in fact asked that separately now, which is the correct approach.)
0

Fyne apps should just work on every system out of the box - the only requirement is that your system has a graphics driver capable of supporting OpenGL.

Sadly windows server accessed over a remote connection blocks this capability, it’s the only configuration that we know does not work, and placing mesa3d.dll next to the app should work.

Those who have done this have had success so I wonder if the crash in your build is caused by the extra configuration put into environment variables which is overriding our internal code.

1 Comment

Hi thanks for the answer. I tried simply running the exe (Mesa dll in same dir, and NO env variables) but I got the crash and it did not work. Then I tried the same thing but only included set GALLIUM_DRIVER=llvmpipe in the run.bat file, doing so worked and I got no crash. So it seems like this env var is the only one needed.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.