Skip to content

Commit 615f0ff

Browse files
committed
add conda installer script for mesa needed for gui visualization
1 parent a9fb10d commit 615f0ff

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

install_mesa.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# Install Mesa drivers for software rendering in conda environment
3+
4+
echo "Installing Mesa drivers for software rendering..."
5+
6+
if ! command -v conda &> /dev/null; then
7+
echo "Error: conda not found. Please ensure conda is installed and activated."
8+
exit 1
9+
fi
10+
11+
if [ -z "$CONDA_PREFIX" ]; then
12+
echo "Error: No conda environment activated. Please activate a conda environment first."
13+
exit 1
14+
fi
15+
16+
echo "Installing Mesa packages in conda environment: $CONDA_PREFIX"
17+
18+
# Install Mesa packages (double-check libffi and mesa compatibility)
19+
conda install -y -c conda-forge \
20+
mesa-libgl-cos7-x86_64 \
21+
mesa-dri-drivers-cos7-x86_64 \
22+
mesalib \
23+
libglu \
24+
libffi
25+
26+
# Alternative: Install newer mesa packages if available
27+
conda install -y -c conda-forge mesa-libgl-devel-cos7-x86_64 2>/dev/null || true
28+
29+
echo ""
30+
echo "Mesa installation complete. Checking for drivers..."
31+
32+
# Check if drivers are installed
33+
DRI_LOCATIONS=(
34+
"$CONDA_PREFIX/lib/dri"
35+
"$CONDA_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/lib64/dri"
36+
"$CONDA_PREFIX/x86_64-conda-linux-gnu/sysroot/usr/lib/dri"
37+
)
38+
39+
FOUND=0
40+
for dir in "${DRI_LOCATIONS[@]}"; do
41+
if [ -d "$dir" ]; then
42+
echo "Found DRI directory: $dir"
43+
ls -la "$dir"/*swrast* "$dir"/*llvmpipe* 2>/dev/null && FOUND=1
44+
fi
45+
done
46+
47+
if [ "$FOUND" -eq 1 ]; then
48+
echo ""
49+
echo "Success! Mesa drivers installed successfully."
50+
echo "You can now run: ./launch_gui.sh"
51+
else
52+
echo ""
53+
echo "Warning: Could not verify Mesa driver installation."
54+
echo "Try running: ./launch_gui.sh --debug-gl for more information"
55+
fi

0 commit comments

Comments
 (0)