Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions scripts/linux_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ function install_cuda() {
return
fi

local cuda_override_arg=""
if [ "$distro" == "fedora" ]; then
cuda_override_arg="--override"
fi

local cuda_prefix="https://developer.download.nvidia.com/compute/cuda/"
local cuda_suffix=""
if [ "$architecture" == "aarch64" ]; then
Expand Down Expand Up @@ -371,7 +376,7 @@ function install_cuda() {
echo "cuda url: ${url}"
wget "$url" --progress=bar:force:noscroll -q --show-progress -O "${build_dir}/cuda.run"
chmod a+x "${build_dir}/cuda.run"
"${build_dir}/cuda.run" --silent --toolkit --toolkitpath="${build_dir}/cuda" --no-opengl-libs --no-man-page --no-drm
"${build_dir}/cuda.run" --silent --toolkit --toolkitpath="${build_dir}/cuda" --no-opengl-libs --no-man-page --no-drm "$cuda_override_arg"
rm "${build_dir}/cuda.run"

# run cuda patches
Expand Down Expand Up @@ -455,6 +460,9 @@ function run_step_deps() {
if [ "$distro" == "arch" ]; then
export CC=gcc-14
export CXX=g++-14
elif [ "$distro" == "fedora" ]; then
Comment thread
PVermeer marked this conversation as resolved.
Outdated
export CC=gcc-${gcc_version}
export CXX=g++-${gcc_version}
elif [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then
for file in "${gcc_alternative_files[@]}"; do
file_path="/etc/alternatives/$file"
Expand Down Expand Up @@ -537,6 +545,11 @@ function run_step_cmake() {
nvcc_path=$(detect_nvcc_path)
fi

if [ "$distro" == "fedora" ]; then
export CC=gcc-${gcc_version}
export CXX=g++-${gcc_version}
fi

# prepare CMAKE args
cmake_args=(
"-B=build"
Expand Down Expand Up @@ -579,6 +592,7 @@ function run_step_cmake() {
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON")
if [ -n "$nvcc_path" ]; then
cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=$nvcc_path")
cmake_args+=("-DCMAKE_CUDA_HOST_COMPILER=gcc-${gcc_version}")
fi
else
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF")
Expand Down Expand Up @@ -777,7 +791,7 @@ fi

# get directory of this script
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
build_dir="$script_dir/../build"
build_dir=$(readlink -f "$script_dir/../build")
echo "Script Directory: $script_dir"
echo "Build Directory: $build_dir"
mkdir -p "$build_dir"
Expand Down