Skip to content

Commit

Permalink
chore: script n stuff (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
brodeynewman authored Sep 12, 2024
1 parent b72735a commit 3d83f6e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,36 @@
SCUDA is a GPU over IP bridge allowing GPUs on remote machines to be attached
to CPU-only machines.

## Running the server
## Local development

Make the local dev script executable

```sh
chmod +x local.sh
```

Also helpful to alias this local script in your bash profile.

```sh
cargo run --features=disable-preload
alias s='/home/brodey/scuda-latest/local.sh'
```

It's required to run scuda server before initiating client commands.

```sh
s server
```

## Running the client

If the server above is running:

```sh
cargo build --lib
LD_PRELOAD=$(pwd)/target/debug/libscuda.so nvidia-smi
s run
```

The above will rebuild the client and run nvidia-smi for you.

## Installation

To install SCUDA, run the server binary on the GPU host:
Expand Down
44 changes: 44 additions & 0 deletions local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

build() {
echo "rebuilding client..."
cargo build
}

server() {
echo "starting server..."
build

cargo run --features=disable-preload
}

run() {
build
local libscuda_path="$(pwd)/target/debug/libscuda.so"

echo "Full path to libscuda.so: $libscuda_path"

if [ ! -f "$libscuda_path" ]; then
echo "libscuda.so not found. build may have failed."
exit 1
fi

LD_PRELOAD="$libscuda_path" nvidia-smi
}

# Main script logic using a switch case
case "$1" in
build)
build
;;
run)
run
;;
server)
server
;;
*)
echo "Usage: $0 {build|run|server}"
exit 1
;;
esac

0 comments on commit 3d83f6e

Please sign in to comment.