HarukaMa/aleo-prover

CUDA build failed

emkman opened this issue · 4 comments

using CUDA 11.2 on Ubuntu 18.04

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustc34h9Yw/symbols.o" "/root/aleo-prover/target/release/deps/aleo_prover-18d199d49d2a8ded.aleo_prover.1d97f3f0-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/root/aleo-prover/target/release/deps" "-L" "/root/aleo-prover/target/release/build/snarkvm-cuda-ecfceb3bcf9c7dd3/out" "-L" "/root/aleo-prover/target/release/build/blst-a1efdb917a5ef45b/out" "-L" "/root/aleo-prover/target/release/build/curl-sys-57f21fcae3bbf520/out/build" "-L" "/root/aleo-prover/target/release/build/libz-sys-299ca258f4d02532/out/lib" "-L" "/root/aleo-prover/target/release/build/libz-sys-299ca258f4d02532/out/lib" "-L" "/root/aleo-prover/target/release/build/ring-e88af84875cf3f54/out" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustc34h9Yw/libring-c300d20d950cad5b.rlib" "/tmp/rustc34h9Yw/libsnarkvm_cuda-abdc56e5a0f6a673.rlib" "/tmp/rustc34h9Yw/libblst-da5eb185f18af887.rlib" "/tmp/rustc34h9Yw/libcurl_sys-3bf80d05cdb1333e.rlib" "/tmp/rustc34h9Yw/liblibz_sys-97c515cd179fdaae.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-272ca28f0b8538d5.rlib" "-Wl,-Bdynamic" "-lssl" "-lcrypto" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/root/aleo-prover/target/release/deps/aleo_prover-18d199d49d2a8ded" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  = note: /root/aleo-prover/target/release/deps/aleo_prover-18d199d49d2a8ded.aleo_prover.1d97f3f0-cgu.0.rcgu.o: In function `rayon_core::thread_pool::ThreadPool::install::{{closure}}':
          aleo_prover.1d97f3f0-cgu.0:(.text._ZN10rayon_core11thread_pool10ThreadPool7install28_$u7b$$u7b$closure$u7d$$u7d$17h2a6910cc806e82e5E+0x192): undefined reference to `snarkvm_ntt'
          /root/aleo-prover/target/release/deps/aleo_prover-18d199d49d2a8ded.aleo_prover.1d97f3f0-cgu.0.rcgu.o: In function `snarkvm_algorithms::msm::variable_base::VariableBase::msm':
          aleo_prover.1d97f3f0-cgu.0:(.text._ZN18snarkvm_algorithms3msm13variable_base12VariableBase3msm17hd2f277f0ea0033ebE+0x53): undefined reference to `snarkvm_msm'
          collect2: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

nvcc needs to be in PATH, or use NVCC=/path/to/nvcc

Got it working, thanks! It seems that there is max 1 thread pool per gpu enforced, correct? I am actually getting worse performance with the GPU than without due to this limitation. Is that normal?

While you can actually use multiple thread pools per GPU, CUDA calls are not parallelized so the GPU usage will be low. I know nothing about GPU programming so don't know how to fix that.

Makes sense but in my testing the thread flag gets ignored when activating the GPU flag. Closing this issue, appreciate the help.