solana-validator-cuda wrapper is now net.sh compatible

This commit is contained in:
Michael Vines 2019-09-20 11:37:25 -07:00
parent 078a3aeccd
commit 4b1de02bbb
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 8 additions and 6 deletions

View File

@ -80,21 +80,23 @@ echo --- Creating tarball
if [[ -n $maybeCUDA ]]; then
# Wrap `solana-validator-cuda` with a script that loads perf-libs
# automatically
# automatically if possible
cp -a target/perf-libs solana-release/target/
mkdir solana-release/.bin
cp solana-release-cuda/bin/solana-validator solana-release/.bin/solana-validator-cuda
mkdir solana-release/bin/_
cp solana-release-cuda/bin/solana-validator solana-release/bin/_/solana-validator-cuda
cat > solana-release/bin/solana-validator-cuda <<'EOF'
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"/..
source target/perf-libs/env.sh
if [[ -f target/perf-libs/env.sh ]]; then
source target/perf-libs/env.sh
fi
if [[ -z $SOLANA_PERF_LIBS_CUDA ]]; then
echo
echo Error: CUDA not available
echo Error: SOLANA_PERF_LIBS_CUDA environment variable undefined
exit 1
fi
exec .bin/solana-validator-cuda "$@"
exec _/solana-validator-cuda "$@"
EOF
chmod +x solana-release/bin/solana-validator-cuda
fi