2021-11-04 04:50:58 -05:00
|
|
|
#!/usr/bin/env bash
|
2021-11-03 15:32:29 -05:00
|
|
|
|
|
|
|
# make sure errors in sourced scripts will cause this script to stop
|
|
|
|
set -e
|
|
|
|
|
2021-11-04 04:50:58 -05:00
|
|
|
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"
|
|
|
|
|
2021-11-03 15:32:29 -05:00
|
|
|
this_dir="$(readlink -f "$(dirname "$0")")"
|
|
|
|
|
2021-11-04 04:50:58 -05:00
|
|
|
# TODO: are these even necessary now anymore?
|
2021-11-03 15:32:29 -05:00
|
|
|
# fix the GPU crashes here
|
|
|
|
# AMD should already be fixed due it executing a file named "runner"
|
2021-11-04 04:50:58 -05:00
|
|
|
if lspci | grep -q "VGA compatible controller: Advanced Micro Devices" ; then
|
2021-11-03 15:32:29 -05:00
|
|
|
echo "AMD GPU detected"
|
2021-11-04 04:50:58 -05:00
|
|
|
#export radeonsi_sync_compile=true
|
2021-11-03 15:32:29 -05:00
|
|
|
# Intel fix. Won't care to differentiate for ubuntu here
|
2021-11-04 04:50:58 -05:00
|
|
|
elif lspci | grep -q "VGA compatible controller: Intel"; then
|
2021-11-03 15:32:29 -05:00
|
|
|
echo "Intel GPU detected"
|
2021-11-04 04:50:58 -05:00
|
|
|
#export LIBGL_DRI3_DISABLE=1
|
2021-11-03 15:32:29 -05:00
|
|
|
# Nvidia fix.
|
2021-11-04 04:50:58 -05:00
|
|
|
elif echo gpuText | grep -q "VGA compatible controller: NVIDIA Corporation"; then
|
2021-11-03 15:32:29 -05:00
|
|
|
echo "NVIDIA GPU detected"
|
2021-11-04 04:50:58 -05:00
|
|
|
#export LIBGL_ALWAYS_INDIRECT=1
|
2021-11-03 15:32:29 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2021-11-04 04:50:58 -05:00
|
|
|
exec "$this_dir"/AppRun-game
|