Score:0

Problem with PyGame - libGL error: failed to load driver: swrast

sy flag

I am approaching pygame now, I am running a small program that opens a pygame window and shows an intro, which is a simple screen with a background and two buttons (they light up only when the mouse is hovered over).

When I run the code I am shown the following terminal error:

Hello from the pygame community. https://www.pygame.org/contribute.html
[ WARN:0] global /tmp/pip-req-build-driubr42/opencv/modules/videoio/src/cap_v4l.cpp (890) open VIDEOIO(V4L2:/dev/video1): can't open camera by index
libGL error: MESA-LOADER: failed to open crocus: /usr/lib/dri/crocus_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: crocus
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  105
  Current serial number in output stream:  106

From how I read it looks like a video driver problem, I have the Mesa Intel® HD Graphics 4600 (HSW GT2) , and my Ubuntu version is 21.10 . My laptop is DELL LATITUDE E6440 with Intel® Core™ i5-4300M CPU @ 2.60GHz × 4 .

Someone can help me??

Someone avatar
my flag
Try running `suso apt update && sudo apt install libgl1-mesa-dri` or try running your script with `MESA_LOADER_DRIVER_OVERRIDE=i965 script.py`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.