Add explicit validator-cuda crate (#5985)

This commit is contained in:
Michael Vines
2019-09-19 20:50:34 -07:00
committed by GitHub
parent d379786c90
commit 1d0be265d9
32 changed files with 778 additions and 706 deletions

View File

@@ -26,7 +26,7 @@ build() {
$genPipeline && return
source ci/rust-version.sh stable
source scripts/ulimit-n.sh
_ cargo +$rust_stable build --all
_ cargo +$rust_stable build
}
runTest() {

View File

@@ -37,14 +37,14 @@ if [[ -z $CHANNEL_OR_TAG ]]; then
exit 1
fi
PERF_LIBS=false
maybeCUDA=
case "$CI_OS_NAME" in
osx)
TARGET=x86_64-apple-darwin
;;
linux)
TARGET=x86_64-unknown-linux-gnu
PERF_LIBS=true
maybeCUDA=cuda
;;
windows)
TARGET=x86_64-pc-windows-msvc
@@ -70,27 +70,18 @@ echo --- Creating tarball
) > solana-release/version.yml
source ci/rust-version.sh stable
scripts/cargo-install-all.sh +"$rust_stable" solana-release
scripts/cargo-install-all.sh +"$rust_stable" solana-release $maybeCUDA
# Reduce the archive size until
# Reduce the Windows archive size until
# https://github.com/appveyor/ci/issues/2997 is fixed
if [[ -n $APPVEYOR ]]; then
rm -f solana-release/bin/solana-validator.exe solana-release/bin/solana-bench-exchange.exe
fi
if $PERF_LIBS; then
rm -rf target/perf-libs
./fetch-perf-libs.sh
mkdir solana-release/target
if $maybeCUDA; then
# Wrap `solana-validator-cuda` with a script that loads perf-libs
# automatically
cp -a target/perf-libs solana-release/target/
# shellcheck source=/dev/null
source ./target/perf-libs/env.sh
(
cd validator
cargo +"$rust_stable" install --path . --features=cuda --root ../solana-release-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'
@@ -105,9 +96,10 @@ if [[ -z $SOLANA_PERF_LIBS_CUDA ]]; then
fi
exec .bin/solana-validator-cuda "$@"
EOF
chmod +x solana-release/bin/solana-validator-cuda
chmod +x solana-release/bin/solana-validator-cuda
fi
# TODO: Remove scripts/ and multinode/... from tarball
cp -a scripts multinode-demo solana-release/
# Add a wrapper script for validator.sh

View File

@@ -45,7 +45,7 @@ test -d target/debug/bpf && find target/debug/bpf -name '*.d' -delete
test -d target/release/bpf && find target/release/bpf -name '*.d' -delete
# Ensure all dependencies are built
_ cargo +$rust_nightly build --all --release
_ cargo +$rust_nightly build --release
# Remove "BENCH_FILE", if it exists so that the following commands can append
rm -f "$BENCH_FILE"

View File

@@ -15,7 +15,7 @@ _ cargo +"$rust_stable" fmt --all -- --check
# Clippy gets stuck for unknown reasons if sdk-c is included in the build, so check it separately.
# See https://github.com/solana-labs/solana/issues/5503
_ cargo +"$rust_stable" clippy --version
_ cargo +"$rust_stable" clippy --all --exclude solana-sdk-c -- --deny=warnings
_ cargo +"$rust_stable" clippy --all --exclude solana-sdk-c --exclude solana-validator-cuda -- --deny=warnings
_ cargo +"$rust_stable" clippy --manifest-path sdk-c/Cargo.toml -- --deny=warnings
_ cargo +"$rust_stable" audit --version

View File

@@ -32,8 +32,8 @@ case $testName in
test-stable)
echo "Executing $testName"
_ cargo +"$rust_stable" build --all --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --all --exclude solana-local-cluster ${V:+--verbose} --features="$ROOT_FEATURES" -- --nocapture
_ cargo +"$rust_stable" build --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --all --exclude solana-local-cluster --exclude solana-validator-cuda ${V:+--verbose} -- --nocapture
;;
test-stable-perf)
echo "Executing $testName"
@@ -62,7 +62,7 @@ test-stable-perf)
--no-default-features --features=bpf_c,bpf_rust
# Run root package tests with these features
ROOT_FEATURES=
maybeCuda=
if [[ $(uname) = Linux ]]; then
# Enable persistence mode to keep the CUDA kernel driver loaded, avoiding a
# lengthy and unexpected delay the first time CUDA is involved when the driver
@@ -73,17 +73,17 @@ test-stable-perf)
./fetch-perf-libs.sh
# shellcheck source=/dev/null
source ./target/perf-libs/env.sh
ROOT_FEATURES=cuda
maybeCuda=--features=cuda
export SOLANA_CUDA=1
fi
# Run root package library tests
_ cargo +"$rust_stable" build --all --tests --bins ${V:+--verbose} --features="$ROOT_FEATURES"
_ cargo +"$rust_stable" test --manifest-path=core/Cargo.toml ${V:+--verbose} --features="$ROOT_FEATURES" -- --nocapture
_ cargo +"$rust_stable" build --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --manifest-path=core/Cargo.toml ${V:+--verbose} $maybeCuda -- --nocapture
;;
test-local-cluster)
echo "Executing $testName"
_ cargo +"$rust_stable" build --all --release --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" build --release --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --release --manifest-path=local_cluster/Cargo.toml ${V:+--verbose} -- --nocapture
exit 0
;;