Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot compile the example #105

Open
jianingy opened this issue May 12, 2016 · 5 comments
Open

cannot compile the example #105

jianingy opened this issue May 12, 2016 · 5 comments

Comments

@jianingy
Copy link

jianingy commented May 12, 2016

Hi, all
I try to compile and run leaf example with the following command,
cargo run --release --no-default-features --features cuda --example benchmarks alexnet
but got errors like this

In function `convolution_descriptor::ConvolutionDescriptor::new::hbe3406e228523108khb':
cudnn.0.rs:(.text._ZN22convolution_descriptor21ConvolutionDescriptor3new20hbe3406e228523108khbE+0x29c): undefined reference to `cudnnSetConvolutionNdDescriptor_v3'
cudnn.0.rs:(.text._ZN22convolution_descriptor21ConvolutionDescriptor3new20hbe3406e228523108khbE+0x346): undefined reference to `cudnnSetConvolutionNdDescriptor_v3'
cudnn.0.rs:(.text._ZN22convolution_descriptor21ConvolutionDescriptor3new20hbe3406e228523108khbE+0x3a2): undefined reference to `cudnnSetConvolutionNdDescriptor_v3'

I am using rustc 1.8.0 with cargo 0.10.0.

please give me some hints.

thanks

@jakelee8
Copy link

Did you install Cuda and cudnn?

https://developer.nvidia.com/accelerated-computing-toolkit

@jianingy
Copy link
Author

jianingy commented May 30, 2016

yep, i am sure i've installed them since I can compile and run other applications.

they are located at

/usr/lib/x86_64-linux-gnu/libcudnn.so
/usr/lib/x86_64-linux-gnu/libcuda.so

@lvitol
Copy link

lvitol commented May 30, 2016

may be the cudnn version not match, try cudnn v3

@jakelee8
Copy link

This Stack Overflow answer fix that problem for me.

export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/

@jakelee8
Copy link

jakelee8 commented May 30, 2016

Though now, I'm running into undefined symbol errors.

note: Undefined symbols for architecture x86_64:
  "_cudnnConvolutionBackwardData_v3", referenced from:
      cudnn::api::convolution::_$LT$impl$u20$API$GT$::convolution_backward_data::he8223ff51775f8a6 in libcudnn-e530283dd2c0d0c1.rlib(cudnn-e530283dd2c0d0c1.0.o)
  "_cudnnConvolutionBackwardFilter_v3", referenced from:
      cudnn::api::convolution::_$LT$impl$u20$API$GT$::convolution_backward_filter::h75fc249aacd45956 in libcudnn-e530283dd2c0d0c1.rlib(cudnn-e530283dd2c0d0c1.0.o)
  "_cudnnSetConvolutionNdDescriptor_v3", referenced from:
      cudnn::convolution_descriptor::ConvolutionDescriptor::new::h06812852cb5d2f0b in libcudnn-e530283dd2c0d0c1.rlib(cudnn-e530283dd2c0d0c1.0.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

OS: Mac OS X 10.11.5

Cargo configuration: native + cuda

[features]
default = ["native", "cuda"]
native = ["leaf/native", "collenchyma/native"]
opencl = ["leaf/opencl", "collenchyma/opencl"]
cuda = ["leaf/cuda", "collenchyma/cuda"]

btw, I had to disable opencl support because the crate uses the -lOpenCL instead of '-framework OpenCL` flag needed on Mac OS.

Edit: there's an issue for this in the examples directory: autumnai/leaf-examples#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants