Skip to content

Commit def5920

Browse files
committed
finish reverting the nofvm logic
1 parent 0d4ffbc commit def5920

7 files changed

Lines changed: 27 additions & 7 deletions

File tree

cgo/fvm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build fvm
1+
//go:build !nofvm
22

33
package cgo
44

cgo/types_fvm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build fvm
1+
//go:build !nofvm
22

33
package cgo
44

fvm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//go:build cgo && (amd64 || arm64 || riscv64) && fvm
1+
//go:build cgo && (amd64 || arm64 || riscv64) && !nofvm
22
// +build cgo
33
// +build amd64 arm64 riscv64
4-
// +build fvm
4+
// +build !nofvm
55

66
package ffi
77

fvm_stub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !fvm
1+
//go:build nofvm
22

33
package ffi
44

install-filcrypto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ build_from_source() {
218218
fi
219219
fi
220220

221+
# Use -no-fvm GPU feature variants when FVM is disabled
222+
if [ -n "${FFI_DISABLE_FVM}" ] && [ -n "${gpu_flags}" ]; then
223+
echo "FFI_DISABLE_FVM is set, using no-fvm GPU variant"
224+
gpu_flags="${gpu_flags}-no-fvm"
225+
fi
226+
echo "DEBUG: FFI_DISABLE_FVM=${FFI_DISABLE_FVM} gpu_flags=${gpu_flags}"
227+
221228
# Default to use multicore_sdr flags, unless specified to disable
222229
use_multicore_sdr="multicore-sdr"
223230
if [ "${FFI_USE_MULTICORE_SDR}" == "0" ]; then
@@ -237,7 +244,7 @@ build_from_source() {
237244
[ -n "${use_multicore_sdr}" ] && features+=("${use_multicore_sdr}")
238245

239246
[ -n "${gpu_flags}" ] && features+=("${gpu_flags#,}")
240-
[ "${FFI_DISABLE_FVM}" != "1" ] && features+=("fvm")
247+
[ -z "${FFI_DISABLE_FVM}" ] && features+=("fvm")
241248
[ -n "${use_fixed_rows_to_discard}" ] && features+=("${use_fixed_rows_to_discard#,}")
242249
if [ "${FFI_USE_BLST_PORTABLE}" == "1" ] || [ "${FFI_PORTABLE}" == "1" ]; then
243250
features+=("blst-portable")

rust/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ opencl = [
8787
"fvm3/opencl",
8888
"fvm4/opencl",
8989
]
90+
# GPU features without FVM (for builds that disable FVM)
91+
cuda-no-fvm = [
92+
"filecoin-proofs-api/cuda",
93+
"rust-gpu-tools/cuda",
94+
]
95+
cuda-supraseal-no-fvm = [
96+
"filecoin-proofs-api/cuda-supraseal",
97+
"rust-gpu-tools/cuda",
98+
]
99+
opencl-no-fvm = [
100+
"filecoin-proofs-api/opencl",
101+
"rust-gpu-tools/opencl",
102+
]
90103
multicore-sdr = ["filecoin-proofs-api/multicore-sdr"]
91104
c-headers = ["safer-ffi/headers"]
92105
# This feature enables a fixed number of discarded rows for TreeR. The `FIL_PROOFS_ROWS_TO_DISCARD`

rust/scripts/build-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ main() {
7575
# generate filcrypto.h
7676
# Check if FVM is in the build features - if so, include it in header generation
7777
local __header_features="c-headers"
78-
if echo "${@:2}" | grep -q "fvm"; then
78+
if echo "${@:2}" | tr ' ,' '\n' | grep -qx "fvm"; then
7979
__header_features="c-headers,fvm"
8080
fi
8181
RUSTFLAGS="${__rust_flags}" HEADER_DIR="." \

0 commit comments

Comments
 (0)