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

Windows dual GPU: invalid memory address or nil pointer dereference #191

Open
veliev opened this issue Mar 27, 2019 · 21 comments
Open

Windows dual GPU: invalid memory address or nil pointer dereference #191

veliev opened this issue Mar 27, 2019 · 21 comments
Labels
bug Something isn't working information-needed Further information is requested OS:Windows Tickets affecting only Microsoft Windows

Comments

@veliev
Copy link

veliev commented Mar 27, 2019

I read the topic #148 with a similar question. I did not find a solution in it. Пробовал откатить версию OpenGL
git checkout downgrage_opengl
Got an error

error: pathspec 'downgrage_opengl' did not match any file(s) known to git

Demo code:

package main

import (
	"fyne.io/fyne/app"
	"fyne.io/fyne/widget"
)

func main() {
	app := app.New()

	w := app.NewWindow("Hello")
	w.SetContent(widget.NewVBox(
		widget.NewLabel("Hello Fyne!"),
		widget.NewButton("Quit", func() {
			app.Quit()
		}),
	))
	w.ShowAndRun()
}

error

2019/03/27 15:20:45 Fyne error: failed to initialise OpenGL
2019/03/27 15:20:45 Cause: glClientWaitSync
2019/03/27 15:20:45 At: C:/Users/ivc-tveliev/go/src/fyne.io/fyne/driver/gl/window.go:843
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0x5f717d]

goroutine 1 [running, locked to thread]:
fyne.io/fyne/driver/gl.(*window).SetContent(0x0, 0xeee9a0, 0xc000050b40)
C:/Users/ivc-tveliev/go/src/fyne.io/fyne/driver/gl/window.go:329 +0x2d
main.main()
C:/gopath/src/Ihtest/СИС.go:26 +0x296
exit status 2

Windows 7 64

@andydotxyz
Copy link
Member

The downgrade_opengl branch was merged to master for the release so you already have the latest code from 'go get'.
Is it possible to provide more information about the hardware, specifically graphics card / chip on your device?

@veliev
Copy link
Author

veliev commented Mar 28, 2019

@andydotxyz
CPU Type DualCore Intel Pentium G620, 2600 MHz (26 x 100)
Motherboard Name Fujitsu D3061-A1
Motherboard Chipset Intel Cougar Point Q65, Intel Sandy Bridge
Video Adapter Intel(R) HD Graphics Family (3932380 KB)

OpenGL Properties:
Vendor Intel
Renderer Intel(R) HD Graphics Family
Version 3.0.0 - Build 8.15.10.2342
Shading Language Version 1.30 - Intel Build 8.15.10.2342
OpenGL DLL 6.1.7600.16385(win7_rtm.090713-1255)
Multitexture Texture Units 8
Occlusion Query Counter Bits 64
Sub-Pixel Precision 4-bit
OpenGL Compliancy:
OpenGL 1.1 Yes (100%)
OpenGL 1.2 Yes (100%)
OpenGL 1.3 Yes (100%)
OpenGL 1.4 Yes (100%)
OpenGL 1.5 Yes (100%)
OpenGL 2.0 Yes (100%)
OpenGL 2.1 Yes (100%)
OpenGL 3.0 Yes (100%)
OpenGL 3.1 No (50%)

@th3noname
Copy link

I have a similar problem on my notebook which has a Nvidia optimus hybrid gpu. By default the app launches on the integrated gpu (Intel HD graphics 3000) and i get a similar error (nil pointer) but a different cause (have to check later today). If i configure the app to start on the nvidia gpu everything works just fine.

@andydotxyz
Copy link
Member

@veliev For a while we required OpenGL 3.2 so it would not have worked but now it's 2.0 so it should be fine on that computer.

Can you confirm which git commit is current in your version of fyne please? ($GOPATH/src/fyne.io/fyne/ )

@th3noname
Copy link

I finaly got the time to test this again. Same problem with the current fyne version (did a pull and rebuild)

2019/04/03 18:01:04 Fyne error:  failed to initialise OpenGL
2019/04/03 18:01:05   Cause: glGetBufferParameteri64v
2019/04/03 18:01:05   At: C:/Users/Jan/go/src/fyne.io/fyne/driver/gl/window.go:8
34
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0x5f311d]

goroutine 1 [running, locked to thread]:
fyne.io/fyne/driver/gl.(*window).SetContent(0x0, 0xf65840, 0xc00007c230)
        C:/Users/Jan/go/src/fyne.io/fyne/driver/gl/window.go:314 +0x2d
main.welcome(0xf658a0, 0xc00003e6c0)
        C:/Users/Jan/go/src/github.com/fyne-io/examples/main.go:52 +0x2ca
main.main()
        C:/Users/Jan/go/src/github.com/fyne-io/examples/main.go:86 +0xa89

@andydotxyz
Copy link
Member

Thanks @th3noname this is strange indeed. I have read up on that chip and it is indeed supported by the code that we have written. This leads me to wonder about the operating system drivers. Does the inbuilt graphics hardware have the latest driver installed? Is the Windows installation completely up to date with all drivers and patches?

I know it's probably obvious but I have to ask...

@th3noname
Copy link

That was the first thing i checked and they are up to date.

One curious thing i noticed is that GPU Caps Viewer reports no OpenGL Version for the internal Intel based GPU. It just says that this is not the primary OpenGL GPU. I wonder if the problem is just that fyne doesn't properly indicate what GPU it needs to run on? I'm not shure how Nvidia Optimus detects that.

@th3noname
Copy link

A quick Google search got me the Nvidia Optimus developer guid:

http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf

The most promising way seems to be the "Global Variable" option. I'm going to try that option (probably next week) and report back the results.

@andydotxyz
Copy link
Member

oh, excellent - let us know how that goes, thanks.

@tgmeow
Copy link

tgmeow commented Oct 26, 2019

I am also getting this issue.
Windows 10, i5 2520M (Intel HD 3000)
For me at least, there also seems to be an issue with basic OpenGL support on my machine, since other OpenGL programs don't seem to be working either. (even though various programs give information that OpenGL should work.)

However, everything works fine when I build and run my program inside a local Ubuntu virtual machine.

@andydotxyz
Copy link
Member

Sorry @tgmeow, but it looks like that GPU is not supported in Windows 10 so I don't know that we can help. https://forums.intel.com/s/question/0D50P0000490V76SAE/i-need-opengl-for-hd-graphics-3000-under-win10?language=en_US

@SuperKirik
Copy link

SuperKirik commented Dec 23, 2020

@andydotxyz
We faced the same issue on one of our testing computers.

Screen Shot 2020-12-23 at 17 35 05

This is virtual Windows 8.1 Corporate started on VMware Workstation

Here the screenshots with Windows and OpenGL details
(sorry for Russian on the screenshots)

I was looking through some of the similar issues but didn't find the answer... As I understood it may be related to OpenGL version. In our case, it is really the old one - 2.1, but fyne currently supports OpenGL starting from 2.0 as I understood.

The main point is could it happen with a wide range of users ?
It would be good to understand what is the actual reason for this to understand how much users it could affect

2020-12-22_17h58_54
)
2020-12-23_16h39_22
2020-12-23_16h47_06

@andydotxyz
Copy link
Member

@SuperKirik Can you please provide the whole error? It's the beginning of the log that will help us most.
This is an issue that is specific to virtual machines and headless computers (as well as a few really out of date Windows graphics drivers and some systems configured to only use CPU-emulated GPUs). It is not a widespread issue, though we do want to continually improve :).

It is possible that your VM is capable of OpenGL 2.0 but that your installation does not have graphics drivers installed?

@SuperKirik
Copy link

SuperKirik commented Dec 24, 2020

Thank you for the clarification!

The error is flashing fast in the window... so didn't find a way to get it, other than record the video :) here the ordinal screenshots:

opengl 00_00_10_25 Still001
opengl 00_00_10_27 Still002
opengl 00_00_10_29 Still003
opengl 00_00_11_01 Still004

dxdiag in 'Display' tab 'Drivers' section shows the following information:

Version: 7.14.1.5026,
Feautures level:9.3, 9.2,9.1,
Driver Model: WDDM 1.0,

@SuperKirik
Copy link

I just noticed that the other build (I did it later in the new directory from the beginning) showed some other error stack trace.

2nd 00_00_10_01 Still001
2nd 00_00_10_03 Still002
2nd 00_00_10_05 Still003

@changkun
Copy link
Member

As I read though this bug report, it looks like this is a hardware/driver issue in the system which irrelevant to fyne itself and somewhat relates to glfw?

Since there is a lack of information, shall we close this?

@Jacalz
Copy link
Member

Jacalz commented Oct 31, 2021

I think so too. We have had a lot of issues in the past with missing driver support on Windows (drivers usually aren't installed or don't expose a new enough OpenGL version) and especially on virtual machines where hardware acceleration might not be turned on. Thoughts @andydotxyz?

@Bluebugs
Copy link
Contributor

We have seen quite a few issue on Windows due to OpenGL driver not being preset, or wrong version. It make me wonder if we could not do more check at startup to make sure that the driver looks ok and report on the console of any issue before starting the application.

@andydotxyz
Copy link
Member

It make me wonder if we could not do more check at startup to make sure that the driver looks ok and report on the console of any issue before starting the application.

That does make sense, though the top of the panic was 2019/03/27 15:20:45 Fyne error: failed to initialise OpenGL, so we are making an attempt already.
I think the one real issue we have to resolve on Windows is the dual-GPU where builtin does not support OpenGL and the larger GPU does... If this issue does not look like that case then it can be closed.

@Jacalz Jacalz added information-needed Further information is requested and removed question A question has been asked labels Nov 21, 2021
@allesharr
Copy link

Hey, I have the same issue on my RPI 4b with basic fyne-demo program. Is any solution exist on linux-base systems?

@Jacalz
Copy link
Member

Jacalz commented May 5, 2022

Hey, I have the same issue on my RPI 4b with basic fyne-demo program. Is any solution exist on linux-base systems?

I think this issue is mostly Windows related. Would you mind opening a new issue, with all the relevant information, so we can have a look at it?

@andydotxyz andydotxyz changed the title runtime error: invalid memory address or nil pointer dereference Windows dual GPU: invalid memory address or nil pointer dereference Jun 3, 2022
@andydotxyz andydotxyz removed this from the Bowmore Release (early 2022) milestone Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working information-needed Further information is requested OS:Windows Tickets affecting only Microsoft Windows
Projects
None yet
Development

No branches or pull requests

9 participants