libEGL warning: MESA-LOADER: failed to open swrast

82 Views Asked by At

I am using WSL on Windows 11. Inside WSL, I have created an Anaconda environment, through which I launch Jupyter Lab. I am trying to use OpenCV to load an avi video file into my code and read its frames with Google's Mediapipe. These first code cells run just fine:

import cv2
import mediapipe as mp
import pandas as pd
import numpy as np
import tensorflow as tf

mp_hands = mp.solutions.hands
mp_pose = mp.solutions.pose
mp_drawing = mp.solutions.drawing_utils

cap = cv2.VideoCapture('/Ready0/MVI_0025_0003.avi')

columns = ['frame', 'hand_landmarks', 'pose_landmarks
df = pd.DataFrame(columns=columns)`

but this last code cell gives me errors. Here is the code itself:

with mp_hands.Hands(max_num_hands=2) as hands, mp_pose.Pose() as pose:
    while True:
        ret, img = cap.read()
        if not ret:
            break

and here is the error:

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

libEGL warning: 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)

I am using the latest version of all the packages mentioned.

I searched the web and found related problems which had been answered but their solutions didn't seem to work for me. For example, someone suggested to run this code in the command prompt:

MESA_LOADER_DRIVER_OVERRIDE=i965 ./kiwix-deskop

First I ran it in the normal Windows command prompt and got this:

'MESA_LOADER_DRIVER_OVERRIDE' is not recognized as an internal or external command,
operable program or batch file.

And then I ran it again in WSL in my Anaconda environment and got this:

-bash: ./kiwix-deskop: No such file or directory
0

There are 0 best solutions below