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

Missing libglu32 and libopengl32 in aarch64-w64-mingw32 #209

Closed
adiantek opened this issue Jun 27, 2021 · 39 comments
Closed

Missing libglu32 and libopengl32 in aarch64-w64-mingw32 #209

adiantek opened this issue Jun 27, 2021 · 39 comments

Comments

@adiantek
Copy link
Contributor

find /opt/llvm-mingw/ | grep -i "opengl32\|glu32"
/opt/llvm-mingw/i686-w64-mingw32/lib/libglu32.a
/opt/llvm-mingw/i686-w64-mingw32/lib/libopengl32.a
/opt/llvm-mingw/x86_64-w64-mingw32/lib/libglu32.a
/opt/llvm-mingw/x86_64-w64-mingw32/lib/libopengl32.a

Why libopengl32.a is missing in aarch64-w64-mingw32? I would like to build wxWidgets for Windows arch64.

@adiantek adiantek changed the title Missing libglu32 and libopengl32 Missing libglu32 and libopengl32 in aarch64-w64-mingw32 Jun 27, 2021
@adiantek
Copy link
Contributor Author

Ugh, Windows doesn't have opengl32.a for Windows 10 arm64 :/
https://developercommunity.visualstudio.com/t/cannot-link-opengl-programs-on-arm64/164107

@Biswa96
Copy link

Biswa96 commented Jun 28, 2021

Windows 10 ARM has opengl32 and glu32 but in newer versions. I sgguested those in mingw-w64 mailing list years ago. But mstorsjo said that may cause some issue in vlc.

@mstorsjo
Copy link
Owner

Yeah, the short story simply is that arm64 devices don’t have OpenGL drivers at all.

Since winsdk 10.0.19041.0, the sdk does actually contain import libs for linking against opengl32.lib, but to the best of my knowledge, the intended OpenGL emulation driver hasn’t actually shipped yet in 21H1, it’s just available as a separately installable preview, https://devblogs.microsoft.com/directx/announcing-the-opencl-and-opengl-compatibility-pack-for-windows-10-on-arm/.

So until it’s actually available out of the box on any version, I don’t think mingw-w64 should be shipping those libs, otherwise you’d accidentally be making builds that just work for people at the bleeding edge, if at all. Now it’s much more clear that you simply have to avoid OpenGL, or use something like ANGLE.

@Biswa96
Copy link

Biswa96 commented Jun 28, 2021

@adiantek Oops, forgot to share the link. Here is the discussion in mingw-w64 mailing list. If you want to test something you can take the DEF file and create import library with dlltool.

@driver1998
Copy link

driver1998 commented Jul 16, 2021

Since winsdk 10.0.19041.0, the sdk does actually contain import libs for linking against opengl32.lib, but to the best of my knowledge, the intended OpenGL emulation driver hasn’t actually shipped yet in 21H1, it’s just available as a separately installable preview.

If you actually get the compatibility pack and take a look, it is just a special OpenGL ICD driver based on Mesa3D with GLonD3D12 support. The opengl32.dll file is shipped inbox, just unsure about which version have it. (19041.264 didn't, I just checked, but 22000.1 do).

@mstorsjo
Copy link
Owner

Yeah I think actually shipping it (outside of the separate compatibility pack, and even that one only was available for specific apps, except for the insider version of the compatibility pack), it's been bumped to Windows 11, where it's probably needed to get better compatibility for x86_64 apps (but it's available for native arm64 apps too, I just recently checked).

@mstorsjo
Copy link
Owner

Does anyone of you in this thread happen to have Windows 11 installed (on arm64), without having installed the OpenGL compatibility pack? I'm curious about the level of support there out of the box.

If you have such a setup, can you download the executables from https://martin.st/temp/wglinfo/ and run them, and let me know what each of them print? I don't need to see the full printout, just whether they print this:

[WGL] OpenGL vendor string: Microsoft Corporation
[WGL] OpenGL renderer string: GDI Generic
[WGL] OpenGL version string: 1.1.0

Or this:

[WGL] OpenGL vendor string: Microsoft Corporation
[WGL] OpenGL renderer string: D3D12 (Qualcomm( R ) Adreno( TM ) 540 GPU)
[WGL] OpenGL version string: 3.1 Mesa 20.1.0-devel (git-3a14d67e8e)

I did have the OpenGL compatibility pack installed (possibly the insider version, although I'm not sure any longer exactly how to get that one), and after upgrading to Windows 11, I got the good D3D12 based version for wglinfo-i686.exe and wglinfo-aarch64.exe, but not for the armv7 and x86_64 versions. In order to see how it behaves if I wouldn't have installed the compatibility pack, I uninstalled. Then I got the GDI Generic printout for all 4 cases. Then I tried reinstalling the OpenGL compatibility pack from Microsoft Store (but I think I didn't get the insider version?), because then I still get the GDI Generic printout for all cases.

So while Windows 11 does provide opengl32.dll for all architectures, so executables linking against it will run (contrary to on Windows 10), it's still pretty much unusable as long as most users would get the GDI Generic driver.

Thus, anyone with Windows 11, who haven't touched the OpenGL compatibility pack so far on that installation, can you try running those executables? (And does someone remember how to install the insider version of the compatibility pack, to get the proper driver again?)

@Biswa96
Copy link

Biswa96 commented Dec 16, 2021

May I ping @jeremyd2019 ? He has a working Windows 11 in Raspberry Pi 4B.

@jeremyd2019
Copy link

I don't expect the Raspberry Pi would have real graphics drivers, it just has a ram framebuffer IIRC. All arches say GDI Generic there.

@driver1998
Copy link

@jeremyd2019 The WARP software D3D12 driver (the default one if you don't have a real graphics driver installed) can also be utilized by the OpenGL compatibility pack.

@dennisameling
Copy link

@mstorsjo I have a Surface Pro X but already had the compatibility pack installed - here's my output. I'm on Windows Insider Beta channel by the way.

Windows build: 22000.376
Compatibility pack version: 1.2105.4.0

With the compatibility pack installed:

[WGL] OpenGL vendor string: Microsoft Corporation
[WGL] OpenGL renderer string: D3D12 (Qualcomm(R) Adreno(TM) 680 GPU)
[WGL] OpenGL version string: 3.1 Mesa 21.2.0-devel (git-1208290558)
[WGL] OpenGL shading language version string: 1.40

After removing the compatibility pack:

[WGL] WGL extensions:
    NULL.

[WGL] OpenGL vendor string: Microsoft Corporation
[WGL] OpenGL renderer string: GDI Generic
[WGL] OpenGL version string: 1.1.0
[WGL] OpenGL extensions:
    GL_WIN_swap_hint, GL_EXT_bgra, GL_EXT_paletted_texture.

Hope this helps!

@mstorsjo
Copy link
Owner

@mstorsjo I have a Surface Pro X but already had the compatibility pack installed - here's my output. I'm on Windows Insider Beta channel by the way.

@dennisameling Thanks! If you reinstall the compatibility pack, on which architectures do you get the d3d12 renderer, and on which ones do you get the fallback?

@dennisameling
Copy link

After reinstalling the compatibility pack I get these outputs (yay for consistency!):

aarch64:

[WGL] OpenGL vendor string: Microsoft Corporation
[WGL] OpenGL renderer string: D3D12 (Qualcomm(R) Adreno(TM) 680 GPU)
[WGL] OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.0-devel (git-ea8fa10edd)
[WGL] OpenGL shading language version string: 3.30

armv7:

[WGL] OpenGL vendor string: Microsoft Corporation
[WGL] OpenGL renderer string: D3D12 (Qualcomm(R) Adreno(TM) 680 GPU)
[WGL] OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.0-devel (git-ea8fa10edd)
[WGL] OpenGL shading language version string: 3.30

x86_64:

[WGL] OpenGL (core profile) vendor string: Microsoft Corporation
[WGL] OpenGL (core profile) renderer string: D3D12 (Qualcomm(R) Adreno(TM) 680 GPU)
[WGL] OpenGL (core profile) version string: 3.3 (Core Profile) Mesa 22.0.0-devel (git-ea8fa10edd)
[WGL] OpenGL (core profile) shading language version string: 3.30

i686:

[WGL] OpenGL (core profile) vendor string: Microsoft Corporation
[WGL] OpenGL (core profile) renderer string: D3D12 (Qualcomm(R) Adreno(TM) 680 GPU)
[WGL] OpenGL (core profile) version string: 3.3 (Core Profile) Mesa 22.0.0-devel (git-ea8fa10edd)
[WGL] OpenGL (core profile) shading language version string: 3.30

@mstorsjo
Copy link
Owner

@dennisameling Awesome, thanks for testing! (I had installed an older version of the compatibility pack, but then stepped back to a non-insider version of Windows, so I no longer get the fully functional version from the store. With the older version of the driver, I only got the d3d12 version of aarch64 and i686.)

@zap8600
Copy link

zap8600 commented Jan 5, 2022

Hi. Has anyone got a copy of the OpenGL library file? I'm using Windows 10 on my Raspberry Pi 4 and am trying to compile a SDL2 and OpenGL game. I have the GL headers but not the library file.

@driver1998
Copy link

driver1998 commented Jan 5, 2022

@zap8600 Install the the latest cumulative update and you should have it. It is added sometime in the 1904x updates.

@zap8600
Copy link

zap8600 commented Jan 5, 2022 via email

@driver1998
Copy link

opengl32.dll is added in some updates late in the 1904x cycle, install the latest updates (19041.1415) you should have it.

@zap8600
Copy link

zap8600 commented Jan 5, 2022 via email

@zap8600
Copy link

zap8600 commented Jan 5, 2022

Hi. Installing Windows 10 21H2 didn't work. I still don't have the library file. Can I install the compatibility pack?

@zap8600
Copy link

zap8600 commented Jan 5, 2022 via email

@jeremyd2019
Copy link

On Windows 11 on new QC710, no insiders anything having ever touched it, I get the Microsoft GDI Generic for all 4 arches before and after installing the OpenGL compatibility pack.

@mstorsjo
Copy link
Owner

mstorsjo commented Jan 6, 2022

On Windows 11 on new QC710, no insiders anything having ever touched it, I get the Microsoft GDI Generic for all 4 arches before and after installing the OpenGL compatibility pack.

Thanks for testing! So while it's now available contrary to before, it's still essentially unusable.

You need to get the insider version of the compatibility pack in order to have a version that actually gives you a sensible driver. And in order to get the insider version of the compatibility pack installed from Microsoft Store, your Windows installation needs to set up to insider versions. It's a bit odd how they've somewhat dropped the ball on taking this further from the initial testing phase...

@zap8600
Copy link

zap8600 commented Jan 6, 2022 via email

@mstorsjo
Copy link
Owner

mstorsjo commented Jan 6, 2022

Hi! So you know how I said that I copied the dlls? Well, they work! My program successfully compiled and ran with no errors (well, exceptfor when I did something wrong in my code). Also, I became an insider before downloading the compatibility pack.

Are you able to share your DLLs from the insider version of it with me somehow? I had it installed before, but uninstalled it (to see how things were out of the box), and I wouldn't want to change the installation to insider mode just for getting it...

@zap8600
Copy link

zap8600 commented Jan 6, 2022 via email

@mstorsjo
Copy link
Owner

mstorsjo commented Jan 6, 2022

I can. Although it'll take a minute. How do you want me to send them? From, Zane Post

Email to martin@martin.st, hoping that mail handling doesn't filter out potentially "scary" files as DLLs... Or maybe via one of those pesky file sharing sites?

@zap8600
Copy link

zap8600 commented Jan 6, 2022 via email

@mstorsjo
Copy link
Owner

mstorsjo commented Jan 6, 2022

Hmm, but then again, I suspect just sharing opengl32.dll from an installation doesn't help me, as that's just the public interface and the fallback implementation - but the proper d3d12 driver is somewhere else, plugged in as an ICD (installable client driver) which gets loaded by opengl32.dll.

@zap8600
Copy link

zap8600 commented Jan 6, 2022 via email

@jeremyd2019
Copy link

You might be able to use https://store.rg-adguard.net/, plugging in the URL https://www.microsoft.com/en-us/p/opencl-and-opengl-compatibility-pack/9nqpsl29bfff. With that I get a 117MB ARM64 appx 1.2112.2.0 and a 305.81MB ARM64 eappx 1.2112.2.70 for any ring other than retail. For retail, I get a 110.81MB ARM64 appx 0.2109.1.0 and a 284.22MB ARM64 eappx 0.2109.1.70.

@jeremyd2019
Copy link

jeremyd2019 commented Jan 7, 2022

Installing the 1.2112.2.0 appx gave me D3D12 renderer for all 4 arches. Trying to install the Eappx with Add-AppxPackage gave an error that it is not compatible with the device, it can only be installed on Windows.Xbox.

@mstorsjo
Copy link
Owner

mstorsjo commented Jan 7, 2022

Installing the 1.2112.2.0 appx gave me D3D12 renderer for all 4 arches. Trying to install the Eappx with Add-AppxPackage gave an error that it is not compatible with the device, it can only be installed on Windows.Xbox.

Awesome, thanks! That worked nicely for me too!

@zap8600 So with that I don't need copied DLLs any longer - thanks for the offer of helping anyway :-)

@zap8600
Copy link

zap8600 commented Jan 7, 2022 via email

@zap8600
Copy link

zap8600 commented Jan 7, 2022 via email

@jeremyd2019
Copy link

The appx I have doesn't seem to contain opengl32.dll, just clon12compiler.dll dxil.dll OpenCLOn12.dll and OpenGLOn12.dll for each of the four arches. I don't have any ARM32 install either.

@mstorsjo
Copy link
Owner

mstorsjo commented Jan 7, 2022

Hey @jeremyd2019 I'm trying to get the ARM copies of opengl32.dll (not ARM64, but ARM32). I can't install the ARM appx because it is a ARM package. The x64 package only gives me the x64 version. Can you upload the dlls or something?

I mailed you the DLLs (opengl32.dll and glu32.dll) from C:\Windows\SysArm32 from a Windows 11 installation, in case they work for you.

@zap8600
Copy link

zap8600 commented Jan 7, 2022 via email

@driver1998
Copy link

driver1998 commented Mar 24, 2022

So for more context, it seems that the OpenGL Compatibility Pack lists Windows 10 19041.488 (KB4571744) as the minimum supported version. And sure enough, installing that update on top of 19041.264 drops opengl32.dll and opencl.dll to C:\Windows\system32, sysarm32 and syswow64.

Hopefully nobody is using anything older than 19041 now on ARM64 systems (ARM64 does not have LTSC versions so they should be all EOLed)...

Also version 1.2202.1.70 (aka the working one) of the compatibility pack seems to be available on Retail channel as well.
image

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

7 participants