Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

compiling error when USE_CUDA=1 and USE_CUDNN=0 with make command #11339

Closed
wenyangchu opened this issue Jun 19, 2018 · 4 comments
Closed

compiling error when USE_CUDA=1 and USE_CUDNN=0 with make command #11339

wenyangchu opened this issue Jun 19, 2018 · 4 comments

Comments

@wenyangchu
Copy link
Contributor

wenyangchu commented Jun 19, 2018

Description

compiling error when USE_CUDA=1 and USE_CUDNN=0 with make command

Environment info (Required)

Ubuntu 16.04 

Build info (Required if built from source)

Compiler g++/gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609

Error Message:

src/operator/nn/convolution.cu(93): error: identifier "param_" is undefined
src/operator/nn/convolution.cu(171): error: identifier "param_" is undefined

and fix it in the code, get more errors:

build/src/engine/naive_engine.o: In function mxnet::engine::NaiveEngine::~NaiveEngine()': naive_engine.cc:(.text._ZN5mxnet6engine11NaiveEngineD2Ev[_ZN5mxnet6engine11NaiveEngineD5Ev]+0xd35): undefined reference to cudnnDestroy'

Minimum reproducible example

Use the latest master branch

Steps to reproduce

(Paste the commands you ran that produced the error.)

  1. checkout latest master branch
  2. run
    make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=0

What have you tried to solve it?

  1. By changing the following:
    diff --git a/src/operator/nn/convolution.cu b/src/operator/nn/convolution.cu
    index 9f61212..9f573f1 100644
    --- a/src/operator/nn/convolution.cu
    +++ b/src/operator/nn/convolution.cu
    @@ -89,7 +89,7 @@ void ConvolutionCompute(const nnvm::NodeAttrs& attrs,
    const ConvolutionParam& param = nnvm::get(attrs.parsed);
    int dtype = inputs[conv::kData].type_flag_;

-#if CUDNN_MAJOR < 5
+#if MXNET_USE_CUDNN ==1 && CUDNN_MAJOR < 5
if (param_.layout.value() != kNCW &&
param_.layout.value() != kNCHW &&
param_.layout.value() != kNCDHW) {
@@ -167,7 +167,7 @@ void ConvolutionGradCompute(const nnvm::NodeAttrs& attrs,
const std::vector &in_grad = outputs;
int dtype = out_grad.type_flag_;

-#if CUDNN_MAJOR < 5
+#if MXNET_USE_CUDNN ==1 && CUDNN_MAJOR < 5
if (param_.layout.value() != kNCW &&
param_.layout.value() != kNCHW &&
param_.layout.value() != kNCDHW) {

I can continue compiling but get another error below:

build/src/engine/naive_engine.o: In function mxnet::engine::NaiveEngine::~NaiveEngine()': naive_engine.cc:(.text._ZN5mxnet6engine11NaiveEngineD2Ev[_ZN5mxnet6engine11NaiveEngineD5Ev]+0xd35): undefined reference to cudnnDestroy'
naive_engine.cc:(.text._ZN5mxnet6engine11NaiveEngineD2Ev[_ZN5mxnet6engine11NaiveEngineD5Ev]+0x1ce4): undefined reference to cudnnGetErrorString' build/src/engine/naive_engine.o: In function void mshadow::DeleteStreammshadow::gpu(mshadow::Streammshadow::gpu*)':
naive_engine.cc:(.text._ZN7mshadow12DeleteStreamINS_3gpuEEEvPNS_6StreamIT_EE[_ZN7mshadow12DeleteStreamINS_3gpuEEEvPNS_6StreamIT_EE]+0x12a): undefined reference to `cudnnDestroy'
....

The cudnn flag is set in mshadow I suppose but I haven't found out what makes the cudnn flag is true
By the way, I think jenkins does not test this configuration I suppose

@vrakesh
Copy link
Contributor

vrakesh commented Jun 24, 2018

@wenyangchu thank you for reporting the issue, @sandeep-krishnamurthy Requesting this to labeled under Installation

@haojin2
Copy link
Contributor

haojin2 commented Jul 11, 2018

@wenyangchu It's actually a typo, it should be param instead of param_. Fixed in #11470

@haojin2
Copy link
Contributor

haojin2 commented Jul 17, 2018

@wenyangchu Would you please verify whether this has been fixed on your end when you have a minute? I've tried this out and verified that the fix works on my end.

@Kaiser-Yang
Copy link

when I downloaded source from https://mxnet.apache.org/get_started/download (version 1.2.1) I got the same question; I recommend you to update codes on this page.

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

No branches or pull requests

5 participants