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