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

More robust EGL library loading on a range of platforms #14

Open
rayzchen opened this issue May 17, 2022 · 8 comments
Open

More robust EGL library loading on a range of platforms #14

rayzchen opened this issue May 17, 2022 · 8 comments
Milestone

Comments

@rayzchen
Copy link

Installed pegl from source. Seems that libEGL.dll is expected to be put under pegl/egl/common/lib. Windows 10 supplies libEGL.dll under C:\WINDOWS\system32\libEGL.dll as declared by ctypes.util.find_library("libEGL"). Maybe first check find_library first and then try the pegl/egl/common/lib directory?

@perey perey changed the title ImportError: could not find EGL library More robust EGL library loading on a range of platforms May 18, 2022
@perey
Copy link
Owner

perey commented May 18, 2022

Thanks for the report. More robust DLL loading is certainly needed, and I'm sure you're right that find_library is the way to go. Looking in a package-local directory is fine for testing, but it will only work for release versions if the EGL library (probably Google's ANGLE) is bundled with a Windows package.

But maybe that's the best strategy? I'm not sure that Microsoft supplies libEGL.dll with Windows. (At least, not as standard; maybe it comes with WSL or something?)

Could you check the file info on C:\WINDOWS\system32\libEGL.dll (right click, Properties, Details)?

@perey perey added this to the 0.3 milestone May 18, 2022
@rayzchen
Copy link
Author

rayzchen commented May 18, 2022 via email

@perey
Copy link
Owner

perey commented May 18, 2022

@rayzchen
Copy link
Author

Seems that it doesn't appear to be on my old laptop, though my new one has it.

@rayzchen
Copy link
Author

Looking in a package-local directory is fine for testing, but it will only work for release versions if the EGL library (probably Google's ANGLE) is bundled with a Windows package.

Where are you currently getting the library from? I've looked at google/angle but it seems to be source-only. Of course, many general purpose DLL files are out there, but I don't trust them enough.

@rayzchen
Copy link
Author

rayzchen commented May 24, 2022

Funny, seems that Python can access a C:\Windows\System32\libEGL.dll but even using cmd with dir yields nothing.

EDIT: C:\Windows\SysWOW64\libEGL.dll exists... The created date is around when I got the laptop.

image

@perey
Copy link
Owner

perey commented May 25, 2022

Where are you currently getting the library from? I've looked at google/angle but it seems to be source-only. Of course, many general purpose DLL files are out there, but I don't trust them enough.

I grabbed it from a Google Chrome installation, but I’m not positive that’s the only place I’ve gotten the DLL; I recall looking up some other projects that bundle ANGLE.

C:\Windows\SysWOW64\libEGL.dll exists... The created date is around when I got the laptop.

Hmm. Very peculiar that it doesn’t list a product name. That in itself suggests that it’s not an official Microsoft DLL, which answers my question… but I’m still curious, if you’re willing to do a bit more digging? Is there any vendor info under the Digital Signatures tab? What about if you load it in pegl, like so:

>>> import pegl
>>> dpy = pegl.Display()
>>> dpy.vendor
'Google Inc. (adapter LUID: 000000000000b56d)'
>>> dpy.version
(1, 5, '(ANGLE 2.1.0.ea8043b73f93)')

@rayzchen
Copy link
Author

Running dpy = pegl.Display() raises pegl.errors.NotInitializedError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants