autumnai / leaf-examples

Examples for the Hacker's Machine Learning Framework Leaf
78 stars 18 forks source link

Undefined reference to 'cudnnConvolutionBackwardData_v3' #22

Open poppingtonic opened 7 years ago

poppingtonic commented 7 years ago

I'm running Arch Linux, with CUDA 8.0, installed to CUDNN_LIB_DIR=/opt/cuda/lib64, which is an environment variable I set so rust-cudnn could build. When I run cargo build --release, all packages compile except leaf-examples, which fails with:

cudnn.cgu-0.rs:(.text._ZN5cudnn22convolution_descriptor21ConvolutionDescriptor3new17hd52d835ac171c334E+0x2c5): undefined reference to 'cudnnSetConvolutionNdDescriptor_v3'

Here's the complete stack trace:

Compiling leaf-examples v0.1.0 (file:///home/brian/src/LEAF/leaf-examples)
     Running `rustc --crate-name leaf_examples src/main.rs --crate-type bin -C opt-level=3 --cfg feature=\"collenchyma\" --cfg feature=\"cuda\" --cfg feature=\"opencl\" --cfg feature=\"leaf\" --cfg feature=\"native\" --cfg feature=\"default\" -C metadata=ae5ef3f9c6bfe84b -C extra-filename=-ae5ef3f9c6bfe84b --out-dir /home/brian/src/LEAF/leaf-examples/target/release/deps --emit=dep-info,link -L dependency=/home/brian/src/LEAF/leaf-examples/target/release/deps --extern env_logger=/home/brian/src/LEAF/leaf-examples/target/release/deps/libenv_logger-898336b63180939c.rlib --extern log=/home/brian/src/LEAF/leaf-examples/target/release/deps/liblog-45992a9fecd52540.rlib --extern docopt=/home/brian/src/LEAF/leaf-examples/target/release/deps/libdocopt-6acf94c652da5da9.rlib --extern hyper=/home/brian/src/LEAF/leaf-examples/target/release/deps/libhyper-2876fae34ddaaae3.rlib --extern csv=/home/brian/src/LEAF/leaf-examples/target/release/deps/libcsv-fa7c7e68b69d8e3d.rlib --extern collenchyma=/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma-14110c1f55835827.rlib --extern rustc_serialize=/home/brian/src/LEAF/leaf-examples/target/release/deps/librustc_serialize-caafd732392a084b.rlib --extern leaf=/home/brian/src/LEAF/leaf-examples/target/release/deps/libleaf-63d30561567bf472.rlib -L native=/usr/lib -L native=/home/brian/src/LEAF/leaf-examples/target/release/build/openssl-sys-5caadec7e6f1f6b8/out -L native=/opt/cuda/lib64`
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/leaf_examples-ae5ef3f9c6bfe84b.0.o" "-o" "/home/brian/src/LEAF/leaf-examples/target/release/deps/leaf_examples-ae5ef3f9c6bfe84b" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/brian/src/LEAF/leaf-examples/target/release/deps" "-L" "/usr/lib" "-L" "/home/brian/src/LEAF/leaf-examples/target/release/build/openssl-sys-5caadec7e6f1f6b8/out" "-L" "/opt/cuda/lib64" "-L" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libleaf-63d30561567bf472.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma_blas-ec053a0bbe0fbf70.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libhyper-2876fae34ddaaae3.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libhttparse-f04252c6a6e5d4c6.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libunicase-a284c14c101e6107.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libenv_logger-898336b63180939c.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcookie-2f796acb767bdb3c.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libopenssl-68dc63589bfa90ad.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libsolicit-d8e6830b07855294.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libhpack-e4ba59af8835f1f6.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma_nn-a6aeb3e4cbdb124e.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcudnn-ff85c95eebc4ea5c.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcudnn_sys-80cfb69383b3b7fd.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcsv-fa7c7e68b69d8e3d.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libbyteorder-97f20359cc6ae7fe.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libopenssl_sys-31d816d6bf55d6fc.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libtypeable-f0ed0017e3fcca89.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libtraitobject-a1d2a583fb41ef5d.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libmime-dfc320e8b2335a58.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libserde-d321cb2b6f9f6141.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liblog-45992a9fecd52540.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma-14110c1f55835827.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liblinear_map-46676a48d9ffd41b.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libbyteorder-3f7dc7cdfc06d203.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liblazy_static-809e8878608ba913.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libenum_primitive-48f81948729dc16d.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libbitflags-1755d85512daa2be.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcublas-9f2db1748a12c4b5.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libcublas_sys-9e1e79942fc97df8.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libdocopt-6acf94c652da5da9.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libstrsim-869774ecf05f23a6.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libregex-c570712e9d025d01.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libregex_syntax-cbacc108f12333b2.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libaho_corasick-f4e044fd39863840.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libmemchr-6eaa2ac287ea4899.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libutf8_ranges-eee6e01646fa8d92.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liburl-5a603dce7660e966.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libmatches-a2b873ec0933e1a1.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libuuid-838adb6564344aa1.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liblibc-020680db6d48b4b8.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libnum_cpus-b89916b657cc137c.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liblanguage_tags-5e73368b30fd717a.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libtimeit-16fc94022225b588.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libtime-7575bceadb0fc3ef.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/librblas-cba47c817245deff.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/libnum-29f1cfb2cad99f27.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/librand-a0b7947e73251f01.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/librustc_serialize-caafd732392a084b.rlib" "/home/brian/src/LEAF/leaf-examples/target/release/deps/liblibc-70a837b016065202.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2ddb28df747fcb8c.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-21709492a058d9ce.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e19aa6725ab01bfd.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-99ff2e008613b591.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-e2513aecb8fbb70c.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f3200ab7e7fe644c.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-e83ac2302b5439a3.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-dba58b8da674d203.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-6d4348bcabf40a71.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-9f45c45fdcba4301.rlib" "/home/brian/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b4ef8c9d93bc879a.rlib" "-l" "cudnn" "-l" "ssl" "-l" "crypto" "-l" "OpenCL" "-l" "OpenCL" "-l" "cuda" "-l" "cublas" "-l" "c" "-l" "m" "-l" "blas" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
  = note: /home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma_blas-ec053a0bbe0fbf70.rlib(collenchyma_blas-ec053a0bbe0fbf70.0.o): In function `collenchyma_blas::frameworks::native::_$LT$impl$u20$collenchyma_blas..operation..IOperationAxpy$LT$f32$GT$$u20$for$u20$collenchyma..backend..Backend$LT$collenchyma..frameworks..native..Native$GT$$GT$::compute::h406b1a3277e7535b':
collenchyma_blas.cgu-0.rs:(.text._ZN16collenchyma_blas10frameworks6native161_$LT$impl$u20$collenchyma_blas..operation..IOperationAxpy$LT$f32$GT$$u20$for$u20$collenchyma..backend..Backend$LT$collenchyma..frameworks..native..Native$GT$$GT$7compute17h406b1a3277e7535bE+0xa8): undefined reference to `cblas_saxpy'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma_blas-ec053a0bbe0fbf70.rlib(collenchyma_blas-ec053a0bbe0fbf70.0.o): In function `collenchyma_blas::frameworks::native::_$LT$impl$u20$collenchyma_blas..plugin..Copy$LT$f32$GT$$u20$for$u20$collenchyma..backend..Backend$LT$collenchyma..frameworks..native..Native$GT$$GT$::copy_plain::h6e919c2a565e1d45':
collenchyma_blas.cgu-0.rs:(.text._ZN16collenchyma_blas10frameworks6native148_$LT$impl$u20$collenchyma_blas..plugin..Copy$LT$f32$GT$$u20$for$u20$collenchyma..backend..Backend$LT$collenchyma..frameworks..native..Native$GT$$GT$10copy_plain17h6e919c2a565e1d45E+0x210): undefined reference to `cblas_scopy'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma_blas-ec053a0bbe0fbf70.rlib(collenchyma_blas-ec053a0bbe0fbf70.0.o): In function `collenchyma_blas::frameworks::native::_$LT$impl$u20$collenchyma_blas..plugin..Scal$LT$f32$GT$$u20$for$u20$collenchyma..backend..Backend$LT$collenchyma..frameworks..native..Native$GT$$GT$::scal_plain::ha51040994dd4270a':
collenchyma_blas.cgu-0.rs:(.text._ZN16collenchyma_blas10frameworks6native148_$LT$impl$u20$collenchyma_blas..plugin..Scal$LT$f32$GT$$u20$for$u20$collenchyma..backend..Backend$LT$collenchyma..frameworks..native..Native$GT$$GT$10scal_plain17ha51040994dd4270aE+0x214): undefined reference to `cblas_sscal'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libopenssl-68dc63589bfa90ad.rlib(openssl-68dc63589bfa90ad.0.o): In function `openssl::ssl::SslContext::new::h67a75ca537477949':
openssl.cgu-0.rs:(.text._ZN7openssl3ssl10SslContext3new17h67a75ca537477949E+0x29): undefined reference to `SSLv3_method'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libopenssl-68dc63589bfa90ad.rlib(openssl-68dc63589bfa90ad.0.o): In function `openssl::ssl::Ssl::get_ssl_method::h517bf417c9542b4c':
openssl.cgu-0.rs:(.text._ZN7openssl3ssl3Ssl14get_ssl_method17h517bf417c9542b4cE+0xf): undefined reference to `SSLv3_method'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libcudnn-ff85c95eebc4ea5c.rlib(cudnn-ff85c95eebc4ea5c.0.o): In function `cudnn::convolution_descriptor::ConvolutionDescriptor::new::hd52d835ac171c334':
cudnn.cgu-0.rs:(.text._ZN5cudnn22convolution_descriptor21ConvolutionDescriptor3new17hd52d835ac171c334E+0x1d7): undefined reference to `cudnnSetConvolutionNdDescriptor_v3'
cudnn.cgu-0.rs:(.text._ZN5cudnn22convolution_descriptor21ConvolutionDescriptor3new17hd52d835ac171c334E+0x285): undefined reference to `cudnnSetConvolutionNdDescriptor_v3'
cudnn.cgu-0.rs:(.text._ZN5cudnn22convolution_descriptor21ConvolutionDescriptor3new17hd52d835ac171c334E+0x2c5): undefined reference to `cudnnSetConvolutionNdDescriptor_v3'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libcudnn-ff85c95eebc4ea5c.rlib(cudnn-ff85c95eebc4ea5c.0.o): In function `cudnn::api::convolution::_$LT$impl$u20$cudnn..API$GT$::convolution_backward_filter::h56a369ee38156273':
cudnn.cgu-0.rs:(.text._ZN5cudnn3api11convolution28_$LT$impl$u20$cudnn..API$GT$27convolution_backward_filter17h56a369ee38156273E+0x4b): undefined reference to `cudnnConvolutionBackwardFilter_v3'
/home/brian/src/LEAF/leaf-examples/target/release/deps/libcudnn-ff85c95eebc4ea5c.rlib(cudnn-ff85c95eebc4ea5c.0.o): In function `cudnn::api::convolution::_$LT$impl$u20$cudnn..API$GT$::convolution_backward_data::hc00b3fb68dfe8f09':
cudnn.cgu-0.rs:(.text._ZN5cudnn3api11convolution28_$LT$impl$u20$cudnn..API$GT$25convolution_backward_data17hc00b3fb68dfe8f09E+0x4b): undefined reference to `cudnnConvolutionBackwardData_v3'
collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile `leaf-examples`.

Caused by:
  process didn't exit successfully: `rustc --crate-name leaf_examples src/main.rs --crate-type bin -C opt-level=3 --cfg feature="collenchyma" --cfg feature="cuda" --cfg feature="opencl" --cfg feature="leaf" --cfg feature="native" --cfg feature="default" -C metadata=ae5ef3f9c6bfe84b -C extra-filename=-ae5ef3f9c6bfe84b --out-dir /home/brian/src/LEAF/leaf-examples/target/release/deps --emit=dep-info,link -L dependency=/home/brian/src/LEAF/leaf-examples/target/release/deps --extern env_logger=/home/brian/src/LEAF/leaf-examples/target/release/deps/libenv_logger-898336b63180939c.rlib --extern log=/home/brian/src/LEAF/leaf-examples/target/release/deps/liblog-45992a9fecd52540.rlib --extern docopt=/home/brian/src/LEAF/leaf-examples/target/release/deps/libdocopt-6acf94c652da5da9.rlib --extern hyper=/home/brian/src/LEAF/leaf-examples/target/release/deps/libhyper-2876fae34ddaaae3.rlib --extern csv=/home/brian/src/LEAF/leaf-examples/target/release/deps/libcsv-fa7c7e68b69d8e3d.rlib --extern collenchyma=/home/brian/src/LEAF/leaf-examples/target/release/deps/libcollenchyma-14110c1f55835827.rlib --extern rustc_serialize=/home/brian/src/LEAF/leaf-examples/target/release/deps/librustc_serialize-caafd732392a084b.rlib --extern leaf=/home/brian/src/LEAF/leaf-examples/target/release/deps/libleaf-63d30561567bf472.rlib -L native=/usr/lib -L native=/home/brian/src/LEAF/leaf-examples/target/release/build/openssl-sys-5caadec7e6f1f6b8/out -L native=/opt/cuda/lib64` (exit code: 101)