Getting 'Unable to retrieve OpenGL version' with macOS Catalina & MonoGame 3.8

Hi everyone :smile:

I’m having trouble getting started with MonoGame 3.8 on macOS Catalina. I’m following the Getting Started guide but I’m getting an Unable to retrieve OpenGL version error when trying to run the game. As in the tutorial, I’ve selected a MonoGame Cross Platform Desktop Project.

The exact error when trying to run the application is this:

Unhandled exception. Microsoft.Xna.Framework.Graphics.NoSuitableGraphicsDeviceException: Unable to retrieve OpenGL version
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformSetup()
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Setup()
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor(GraphicsAdapter adapter, GraphicsProfile graphicsProfile, Boolean preferHalfPixelOffset, PresentationParameters presentationParameters)
   at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice(GraphicsDeviceInformation gdi)
   at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice()
   at Microsoft.Xna.Framework.Game.DoInitialize()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at MyGame.Program.Main() in /Users/martin/Code/monogame/MyGame/Program.cs:line 11

This is the current installed version:

  MonoGame.Templates.CSharp
    Details:
      NuGetPackageId: MonoGame.Templates.CSharp
      Version: 3.8.0.1641
      Author: MonoGame Team
    Templates:
      MonoGame Android Application (mgandroid) C#
      MonoGame Cross-Platform Desktop Application (OpenGL) (mgdesktopgl) C#
      MonoGame iPhone/iPad Application (mgios) C#
      MonoGame Windows Universal Application (CoreApp) (mguwpcore) C#
      MonoGame Windows Universal Application (XAML) (mguwpxaml) C#
      MonoGame Windows Desktop Application (Windows DirectX) (mgwindowsdx) C#
      MonoGame NetStandard Library (mgnetstandard) C#
      MonoGame Pipeline Extension (mgpipeline) C#
      MonoGame Shared Library Project (mgshared) C#
    Uninstall Command:
      dotnet new -u MonoGame.Templates.CSharp

And here’s my dotnet information:

➜ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.405
 Commit:    65f9d75b1c

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.405/

Host (useful for support):
  Version: 3.1.11
  Commit:  f5eceb8105

.NET Core SDKs installed:
  3.1.405 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Any nuggets of information would be super appreciated!

Thanks!

OpenGL is officially deprecated by Apple starting with macOS Mojave 10.14. However, Apple is still maintaining the standard.

So I have no idea if opengl is available for Monogame on Catalina

Anyone else know for sure?

I’m also on macOS 10.15 with MonoGame 3.8, and I don’t get the same error message. I do have Xcode installed with all of the additional tools. I haven’t bothered investigating what’s in the additional tools, but maybe Xcode itself or the additional tools include OpenGL. Xcode will ask if you’d like to install them the first time you open Xcode.

Unless you already have Xcode installed, it could be worth trying?

A good shout! Thanks for the suggestion. I didn’t have full-blown Xcode installed but I did have the command-line tools. I installed the full Xcode but that wasn’t enough to make this error message go away - still a NoSuitableGraphicsDriverException :frowning:

Interesting that it’s running on another Mac - means there’s hope I can find a fix :smile:

Here’s the details on this Mac:

Model: MacBookPro15,1, BootROM 1554.60.15.0.0 (iBridge: 18.16.13030.0.0,0), 6 processors, 6-Core Intel Core i7, 2.6 GHz, 16 GB, SMC 
Graphics: kHW_IntelUHDGraphics630Item, Intel UHD Graphics 630, spdisplays_builtin
Graphics: kHW_AMDRadeonPro555XItem, Radeon Pro 555X, spdisplays_pcie_device, 4 GB

Darn. At least there’s hope. :smile:

I thought maybe I had installed something via brew, but I’m not sure what all of these programs do. Some have names with very little meaning. Maybe you recognize some?

aom, cairo, cmake, dav1d, ffmpeg, flac, fontconfig, freetype, frei0r, fribidi, gdbm, gettext, giflib, git, git-lfs, glib, gmp, gnutls, graphite2, harfbuzz, heroku, heroku-node, highlight, icu4c, jpeg, lame, leptonica, libass, libbluray, libevent, libffi, libidn2, libogg, libpng, libsamplerate, libsndfile, libsoxr, libtasn1, libtiff, libunistring, libvidstab, libvorbis, libvpx, lighttpd, little-cms2, lua, lzo, nettle, node, opencore-amr, openjpeg, openldap, openssl@1.1, opus, p11-kit, pcre, pcre2, pixman, pkg-config, python, python@3.8, readline, rtmpdump, rubberband, sdl2, snappy, speex, sqlite, srt, tesseract, theora, tmx, unbound, webp, x264, x265, xvid, xz, youtube-dl

I have a few versions of Unity installed, but I have no idea if Unity installs any OpenGL software in the OS.

Our machines are comparable. I have mbpro 2018, 2.6Ghz, 32GB RAM, Radeon Pro Vega 20 4GB.

This is awfully embarassing but - after getting frustrated, I wiped everything from brew, uninstalled xcode, restarted and then installed everything again. And now it works. Which is great! But unfortunately I never tracked down exactly what was causing it - but if anyone else stumbles upon the same problem in the future, this is how I managed to resolve it :grimacing:

Thanks again for your help @mandarinx and @Stainless!

I’m glad i worked out in the end. :slight_smile:
Happy coding!

Mate, that happens far more often than you would think :smile: