Skip to content

Commit

Permalink
Update sppark fork with proper features for CUDA and ROCm that also…
Browse files Browse the repository at this point in the history
… fixes linking `amdhip64` into CUDA builds
  • Loading branch information
nazar-pc committed Oct 9, 2024
1 parent 2866e8f commit 8f4a907
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,12 @@ jobs:
if: runner.os == 'Linux' || runner.os == 'Windows'

- name: cargo clippy (ROCm)
env:
NVCC: off
run: |
cargo -Zgitoxide -Zgit clippy --locked --all-targets --features rocm -- -D warnings
if: runner.os == 'Linux'

- name: cargo clippy (ROCm)
env:
NVCC: off
# Why `PROGRA~1` instead of `Program Files`? Because Windows!
HIPCC: C:\PROGRA~1\AMD\ROCm\6.1\bin\hipcc.bin.exe
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ jobs:
# ROCm can't be enabled together with CUDA for now
- name: Build farmer (ROCm, Windows)
env:
NVCC: off
# Why `PROGRA~1` instead of `Program Files`? Because Windows!
HIPCC: C:\PROGRA~1\AMD\ROCm\6.1\bin\hipcc.bin.exe
run: |
Expand All @@ -228,8 +227,6 @@ jobs:

# ROCm can't be enabled together with CUDA for now
- name: Build farmer (ROCm, Ubuntu)
env:
NVCC: off
run: |
cargo -Zgitoxide -Zgit build --locked -Z build-std --target ${{ matrix.build.target }} --profile production --bin subspace-farmer --features rocm
mv ${{ env.PRODUCTION_TARGET }}/subspace-farmer ${{ env.PRODUCTION_TARGET }}/subspace-farmer-rocm
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 1 addition & 2 deletions Dockerfile-farmer
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ RUN \
ldconfig \
; fi

# TODO: Remove `NVCC=off` hack once `sppark` has proper features for CUDA and ROCm
# ROCm is only used on x86-64 since they don't have other packages
RUN \
if [ $BUILDARCH != "arm64" ] && [ $TARGETARCH = "arm64" ]; then \
Expand All @@ -113,7 +112,7 @@ RUN \
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} && \
RUSTC_TARGET_ARCH=$(echo $TARGETARCH | sed "s/amd64/x86_64/g" | sed "s/arm64/aarch64/g" | sed "s/riscv64/riscv64gc/g") && \
if [ $BUILDARCH = "amd64" ] && [ $TARGETARCH = "amd64" ]; then \
NVCC=off /root/.cargo/bin/cargo -Zgitoxide -Zgit build \
/root/.cargo/bin/cargo -Zgitoxide -Zgit build \
--locked \
-Z build-std \
--profile $PROFILE \
Expand Down
9 changes: 4 additions & 5 deletions shared/subspace-proof-of-space-gpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ include = [
[dependencies]
blst = { version = "0.3.13", optional = true }
rust-kzg-blst = { git = "https://github.com/grandinetech/rust-kzg", rev = "6c8fcc623df3d7e8c0f30951a49bfea764f90bf4", default-features = false, optional = true }
# TODO: Fork with ROCm support, switch to upstream once `rocm` branch from `https://github.com/dot-asm/sppark` is upstreamed
sppark = { version = "0.1.8", git = "https://github.com/autonomys/sppark", rev = "71c49160d7aa24f92c20592d2d26ef16f5400a04", optional = true }
# TODO: Fork with ROCm support, switch to upstream once `rocm` branch from `https://github.com/dot-asm/sppark` + https://github.com/dot-asm/sppark/pull/2 are upstreamed
sppark = { version = "0.1.8", git = "https://github.com/autonomys/sppark", rev = "b2a181eb99c8200f1a604f04122551ea39fbf63f", optional = true }
subspace-core-primitives = { version = "0.1.0", path = "../../crates/subspace-core-primitives", default-features = false, optional = true }
subspace-kzg = { version = "0.1.0", path = "../subspace-kzg", optional = true }

Expand All @@ -30,15 +30,14 @@ cc = "1.1.23"

[features]
# Only Volta+ architectures are supported (GeForce RTX 16xx consumer GPUs and newer)
cuda = ["_gpu"]
cuda = ["_gpu", "sppark/cuda"]
# TODO: ROCm can't be enabled at the same time as `cuda` feature at the moment
# Seems to support RDNA 2+, at least on Linux
rocm = ["_gpu"]
rocm = ["_gpu", "sppark/rocm"]
# Internal feature, shouldn't be used directly
_gpu = [
"dep:blst",
"dep:rust-kzg-blst",
"dep:sppark",
"dep:subspace-core-primitives",
"dep:subspace-kzg",
]
5 changes: 0 additions & 5 deletions shared/subspace-proof-of-space-gpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,3 @@ For other operating systems/platforms check official documentation: <https://doc
### ROCm

For AMD/ROCm support follow their official documentation: <https://rocm.docs.amd.com/en/latest/>

For compilation `NVCC=off` environment variable must be additionally used:
```bash
NVCC=off cargo build
```

0 comments on commit 8f4a907

Please sign in to comment.