Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pipetogrep

macrumors 6502
Original poster
Jan 27, 2021
361
505
I'm pretty sure I already know the answer to this. "Don't expect anything GLX related to work, ancient hardware, yada yada..." It doesn't hurt to ask though.

I'm trying to do some simple pygame development in NetBSD. pygame before vs 2 works fine as it's working against SDL 1.2. The latest version, however, errors out with this when running "pygame.display.set_mode()"

Code:
MESA-LOADER: failed to open swrast (search paths /usr/X11R7/lib/modules/dri)
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  167
  Current serial number in output stream:  0

glx seems to somewhat work as I can get a (very slow) glxgears running. In /usr/X11R7/lib/modules/dri I see

Code:
ibook-bsd$ ls -l /usr/X11R7/lib/modules/dri/
total 26752
lrwxr-xr-x  1 root  wheel        16 Mar 28 04:33 gallium_dri.so -> gallium_dri.so.0
-r--r--r--  1 root  wheel  13804980 Mar 28 04:33 gallium_dri.so.0
lrwxr-xr-x  1 root  wheel        14 Mar 28 04:33 kms_swrast_dri.so -> gallium_dri.so
lrwxr-xr-x  1 root  wheel        16 Mar 28 04:33 kms_swrast_dri.so.0 -> gallium_dri.so.0
lrwxr-xr-x  1 root  wheel        14 Mar 28 04:33 swrast_dri.so -> gallium_dri.so
lrwxr-xr-x  1 root  wheel        16 Mar 28 04:33 swrast_dri.so.0 -> gallium_dri.so.0

I've been trying to figure if it's possible to disable the use of GLX entirely or anything to do with hardware acceleration. Disabling GL_ACCELERATED_VISUAL doesn't fix the issue. At this point I'm rather stumped on this very obscure issue but am hoping someone here might have some insight.

Thanks as always.

Edit: This is on an iBook G4 with an ATI Mobility Radeon 9200. Dmesg output looks like this:

Code:
ibook-bsd$ dmesg | grep radeon
[     1.000000] radeonfb0 at pci0 dev 16 function 0: ATI Technologies Radeon Mobility 9200 (M9+) (rev. 0x01)
[     1.000000] radeonfb0: No video BIOS, using default clocks
[     1.000000] radeonfb0: refclk = 27.000 MHz, refdiv = 12 minpll = 125000, maxpll = 400000
[     1.000000] radeonfb0: 64 MB aperture at 0x98000000, 64 KB registers at 0x90000000
[     1.000000] radeonfb0: display 0: initial virtual resolution 1024x768 at 8 bpp
[     1.000000] radeonfb0: using 32 MB per display
[     1.000000] radeonfb0: port 0: physical 1024x768 60Hz
[     1.000000] radeonfb0: port 1: physical 1024x768 60Hz
[     1.000000] wsdisplay0 at radeonfb0 kbdmux 1: console (fb, vt100 emulation)
[     1.000000] drm at radeonfb0 not configured
 
Last edited:
Hmm, looks like SDL2 by itself works. Running this c++ tutorial, I was able to have it create a window and load in a bitmap with the end result looking similar to this.

amkaenduil98xs6abdir.png

At least this sort of narrows it down to a pygame specific issue?
 
Hmm, looks like SDL2 by itself works. Running this c++ tutorial, I was able to have it create a window and load in a bitmap with the end result looking similar to this.

amkaenduil98xs6abdir.png

At least this sort of narrows it down to a pygame specific issue?

Why don’t you try rebuilding SDL2 with GLX turned off?

`--enable-video-opengl=no`: https://github.com/libsdl-org/SDL/b...cf45ef0ab5c7cca2c4ae/configure.ac#L2505-L2508
Or specifically delete this chunk: https://github.com/libsdl-org/SDL/b...cf45ef0ab5c7cca2c4ae/configure.ac#L2510-L2525
 
Old AMD drivers for Linux are terrible.

Nvidia drivers are good.

Disclaimer: I am an Ubuntu user who uses Pop!_OS when necessary; I have never used FreeBSD.
 
Old AMD drivers for Linux are terrible.

Nvidia drivers are good.

Disclaimer: I am an Ubuntu user who uses Pop!_OS when necessary; I have never used FreeBSD.
NetBSD is a whole different bag I think. GLX actually works on this machine to some extent, better than on Linux. At least I can get glxgears to run without distortion or crashes, albeit with a low frame rate.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.