Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Remove CUDA feature (#6094)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines authored Sep 26, 2019
1 parent a964570 commit b4da83a
Show file tree
Hide file tree
Showing 33 changed files with 374 additions and 511 deletions.
33 changes: 25 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 0 additions & 62 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,65 +1,4 @@
[workspace]
# The members list excluding the `validator-cuda` crate
default-members = [
"bench-exchange",
"bench-streamer",
"bench-tps",
"banking_bench",
"chacha-sys",
"client",
"core",
"drone",
"validator",
"genesis",
"genesis_programs",
"gossip",
"install",
"keygen",
"ledger-tool",
"local_cluster",
"logger",
"merkle-tree",
"measure",
"metrics",
"programs/bpf_loader_api",
"programs/bpf_loader_program",
"programs/budget_api",
"programs/budget_program",
"programs/btc_spv_program",
"programs/btc_spv_api",
"programs/btc_spv_bin",
"programs/config_api",
"programs/config_program",
"programs/config_tests",
"programs/exchange_api",
"programs/exchange_program",
"programs/failure_program",
"programs/move_loader_api",
"programs/move_loader_program",
"programs/librapay_api",
"programs/noop_program",
"programs/stake_api",
"programs/stake_program",
"programs/stake_tests",
"programs/storage_api",
"programs/storage_program",
"programs/token_api",
"programs/token_program",
"programs/vote_api",
"programs/vote_program",
"replicator",
"runtime",
"sdk",
"sdk-c",
"upload-perf",
"netutil",
"fixed-buf",
"vote-signer",
"cli",
"rayon-threadlimit",
]

# The default-members list and the `validator-cuda` crate
members = [
"bench-exchange",
"bench-streamer",
Expand Down Expand Up @@ -117,7 +56,6 @@ members = [
"vote-signer",
"cli",
"rayon-threadlimit",
"validator-cuda",
]

exclude = [
Expand Down
10 changes: 0 additions & 10 deletions book/src/running-validator/validator-software.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,3 @@ If you are unable to use the prebuilt binaries or prefer to build it yourself fr
$ ./scripts/cargo-install-all.sh .
$ export PATH=$PWD/bin:$PATH
```

If building for CUDA \(Linux only\), fetch the perf-libs first then include the `cuda` feature flag when building:

```bash
$ ./fetch-perf-libs.sh
$ source target/perf-libs/env.sh
$ ./scripts/cargo-install-all.sh . cuda
$ export PATH=$PWD/bin:$PATH
```

4 changes: 2 additions & 2 deletions book/src/running-validator/validator-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ $ NDEBUG=1 USE_INSTALL=1 ./multinode-demo/validator.sh --identity ~/validator-ke

### Enabling CUDA

If your machine has a GPU with CUDA installed \(Linux-only currently\), use the `solana-validator-cuda` executable instead of `solana-validator`.
If your machine has a GPU with CUDA installed \(Linux-only currently\), include the `--cuda` argument to `solana-validator`.

Or if you built from source, define the SOLANA\_CUDA flag in your environment _before_ running any of the previusly mentioned commands
Or if you built from source, define the SOLANA\_CUDA flag in your environment _before_ running any of the previously mentioned commands

```bash
$ export SOLANA_CUDA=1
Expand Down
48 changes: 4 additions & 44 deletions ci/publish-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ if [[ -z $CHANNEL_OR_TAG ]]; then
exit 1
fi

maybeCUDA=
case "$CI_OS_NAME" in
osx)
TARGET=x86_64-apple-darwin
;;
linux)
TARGET=x86_64-unknown-linux-gnu
maybeCUDA=cuda
;;
windows)
TARGET=x86_64-pc-windows-msvc
Expand All @@ -70,55 +68,17 @@ echo --- Creating tarball
) > solana-release/version.yml

source ci/rust-version.sh stable
scripts/cargo-install-all.sh +"$rust_stable" solana-release $maybeCUDA
scripts/cargo-install-all.sh +"$rust_stable" solana-release

# 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
rm -f \
solana-release/bin/solana-validator.exe \
solana-release/bin/solana-bench-exchange.exe \

if [[ -n $maybeCUDA ]]; then
# Wrap `solana-validator-cuda` with a script that loads perf-libs
# automatically if possible
mkdir -p solana-release/target
cp -a target/perf-libs solana-release/target/perf-libs
mkdir -p solana-release/bin/_
cp solana-release/bin/solana-validator-cuda solana-release/bin/_/solana-validator-cuda
cp -a solana-release/bin/deps solana-release/bin/_/deps
cat > solana-release/bin/solana-validator-cuda <<'EOF'
#!/usr/bin/env bash
set -e
SOLANA_ROOT="$(dirname "$0")"/..
if [[ -f "$SOLANA_ROOT"/target/perf-libs/env.sh ]]; then
source "$SOLANA_ROOT"/target/perf-libs/env.sh
fi
if [[ -z $SOLANA_PERF_LIBS_CUDA ]]; then
echo
echo Error: SOLANA_PERF_LIBS_CUDA environment variable undefined
exit 1
fi
exec "$SOLANA_ROOT"/bin/_/solana-validator-cuda "$@"
EOF
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
# TODO: Remove multinode/... from tarball
cat > solana-release/bin/validator.sh <<'EOF'
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"/..
export USE_INSTALL=1
export REQUIRE_LEDGER_DIR=1
export REQUIRE_KEYPAIRS=1
exec multinode-demo/validator.sh "$@"
EOF
chmod +x solana-release/bin/validator.sh

tar cvf solana-release-$TARGET.tar solana-release
bzip2 solana-release-$TARGET.tar
cp solana-release/bin/solana-install-init solana-install-init-$TARGET
Expand Down
2 changes: 1 addition & 1 deletion ci/test-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 --exclude solana-validator-cuda -- --deny=warnings
_ cargo +"$rust_stable" clippy --all --exclude solana-sdk-c -- --deny=warnings
_ cargo +"$rust_stable" clippy --manifest-path sdk-c/Cargo.toml -- --deny=warnings

_ cargo +"$rust_stable" audit --version
Expand Down
19 changes: 9 additions & 10 deletions ci/test-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test-stable)
echo "Executing $testName"

_ cargo +"$rust_stable" build --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --all --exclude solana-local-cluster --exclude solana-validator-cuda ${V:+--verbose} -- --nocapture
_ cargo +"$rust_stable" test --all --exclude solana-local-cluster ${V:+--verbose} -- --nocapture
;;
test-stable-perf)
echo "Executing $testName"
Expand Down Expand Up @@ -61,8 +61,6 @@ test-stable-perf)
--manifest-path programs/bpf/Cargo.toml \
--no-default-features --features=bpf_c,bpf_rust

# Run root package tests with these 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
Expand All @@ -71,19 +69,20 @@ test-stable-perf)

rm -rf target/perf-libs
./fetch-perf-libs.sh
# shellcheck source=/dev/null
source ./target/perf-libs/env.sh
maybeCuda=--features=cuda

# Force CUDA for solana-core unit tests
export TEST_PERF_LIBS_CUDA=1

# Force CUDA in ci/localnet-sanity.sh
export SOLANA_CUDA=1
fi

# Run root package library tests
_ cargo +"$rust_stable" build --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --all --manifest-path=core/Cargo.toml ${V:+--verbose} $maybeCuda --exclude solana-local-cluster -- --nocapture
_ cargo +"$rust_stable" build --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --package solana-core --lib ${V:+--verbose} -- --nocapture
;;
test-local-cluster)
echo "Executing $testName"
_ cargo +"$rust_stable" build --release --tests --bins ${V:+--verbose}
_ cargo +"$rust_stable" build --release --bins ${V:+--verbose}
_ cargo +"$rust_stable" test --release --package solana-local-cluster ${V:+--verbose} -- --nocapture
exit 0
;;
Expand Down
4 changes: 2 additions & 2 deletions ci/testnet-automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ launchTestnet() {

echo --- start "$nodeCount" node test
if [[ -n $USE_PREBUILT_CHANNEL_TARBALL ]]; then
net/net.sh start -f "cuda" -o noValidatorSanity -t "$CHANNEL"
net/net.sh start -o noValidatorSanity -t "$CHANNEL"
else
net/net.sh start -f "cuda" -o noValidatorSanity -T solana-release*.tar.bz2
net/net.sh start -o noValidatorSanity -T solana-release*.tar.bz2
fi

echo --- wait "$ITERATION_WAIT" seconds to complete test
Expand Down
3 changes: 2 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ edition = "2018"
codecov = { repository = "solana-labs/solana", branch = "master", service = "github" }

[features]
cuda = []
pin_gpu_memory = []

[dependencies]
Expand All @@ -27,6 +26,8 @@ core_affinity = "0.5.9"
crc = { version = "1.8.1", optional = true }
crossbeam-channel = "0.3"
dir-diff = "0.3.1"
dlopen = "0.1.8"
dlopen_derive = "0.1.4"
fs_extra = "1.1.0"
indexmap = "1.1"
itertools = "0.8.0"
Expand Down
50 changes: 0 additions & 50 deletions core/build.rs

This file was deleted.

Loading

0 comments on commit b4da83a

Please sign in to comment.