{
  "id": 13447,
  "title": "Problems with installing theano",
  "url": "/competitions/diabetic-retinopathy-detection/discussion/13447",
  "author_name": "",
  "post_date": "2015-04-16T21:28:07.917Z",
  "votes": null,
  "comment_count": 8,
  "views": 5245,
  "content": "<p>I am desperately trying to install Theano library, but keep failing :( Could someone kindly help me with it?</p>\n<p>after installation of theano and setting environment veriables to this</p>\n<p>export THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True,optimizer_including=cudnn'</p>\n<p>export CUDA_ROOT=/path/to/cudnn</p>\n<p>I type python -c &quot;import theano&quot; and get this</p>\n<p>Using gpu device 0: GeForce GTX TITAN Black<br>1 #include &lt;Python.h&gt;<br>2 #include &lt;iostream&gt;<br>3 #include &quot;cudnn.h&quot;<br>4 //////////////////////<br>5 //// Support Code<br>6 //////////////////////<br>7 <br>8 #if PY_MAJOR_VERSION &gt;= 3<br>9 #define PyInt_FromLong PyLong_FromLong<br>10 #endif<br>11 <br>12 <br>13 namespace {<br>14 struct __struct_compiled_op_f90a7a397ede0965c66895e171db1485 {<br>15 PyObject* __ERROR;<br>16 <br>17 PyObject* storage_V1;<br>18 <br>19 <br>20 __struct_compiled_op_f90a7a397ede0965c66895e171db1485() {}<br>21 ~__struct_compiled_op_f90a7a397ede0965c66895e171db1485(void) {<br>22 cleanup();<br>23 }<br>24 <br>25 int init(PyObject* __ERROR, PyObject* storage_V1) {<br>26 Py_XINCREF(storage_V1);<br>27 this-&gt;storage_V1 = storage_V1;<br>28 <br>29 <br>30 <br>31 this-&gt;__ERROR = __ERROR;<br>32 return 0;<br>33 }<br>34 void cleanup(void) {<br>35 __label_1:<br>36 <br>37 double __DUMMY_1;<br>38 __label_4:<br>39 <br>40 double __DUMMY_4;<br>41 <br>42 Py_XDECREF(this-&gt;storage_V1);<br>43 }<br>44 int run(void) {<br>45 int __failure = 0;<br>46 <br>47 PyObject* py_V1;<br>48 <br>49 PyObject* V1;<br>50 <br>51 {<br>52 <br>53 py_V1 = Py_None;<br>54 {Py_XINCREF(py_V1);}<br>55 <br>56 V1 = NULL;<br>57 <br>58 {<br>59 // Op class DnnVersion<br>60 <br>61 #if defined(CUDNN_VERSION)<br>62 V1 = PyTuple_Pack(2, PyInt_FromLong(CUDNN_VERSION), PyInt_FromLong(cudnnGetVersion()));<br>63 #else<br>64 V1 = PyInt_FromLong(-1);<br>65 #endif<br>66 __label_3:<br>67 <br>68 double __DUMMY_3;<br>69 <br>70 }<br>71 __label_2:<br>72 <br>73 if (!__failure) {<br>74 <br>75 assert(py_V1-&gt;ob_refcnt &gt; 1);<br>76 Py_DECREF(py_V1);<br>77 py_V1 = V1 ? V1 : Py_None;<br>78 Py_INCREF(py_V1);<br>79 <br>80 PyObject* old = PyList_GET_ITEM(storage_V1, 0);<br>81 {Py_XINCREF(py_V1);}<br>82 PyList_SET_ITEM(storage_V1, 0, py_V1);<br>83 {Py_XDECREF(old);}<br>84 }<br>85 <br>86 Py_XDECREF(V1);<br>87 <br>88 {Py_XDECREF(py_V1);}<br>89 <br>90 double __DUMMY_2;<br>91 <br>92 }<br>93 <br>94 <br>95 if (__failure) {<br>96 // When there is a failure, this code puts the exception<br>97 // in __ERROR.<br>98 PyObject* err_type = NULL;<br>99 PyObject* err_msg = NULL;<br>100 PyObject* err_traceback = NULL;<br>101 PyErr_Fetch(&amp;err_type, &amp;err_msg, &amp;err_traceback);<br>102 if (!err_type) {err_type = Py_None;Py_INCREF(Py_None);}<br>103 if (!err_msg) {err_msg = Py_None; Py_INCREF(Py_None);}<br>104 if (!err_traceback) {err_traceback = Py_None; Py_INCREF(Py_None);}<br>105 PyObject* old_err_type = PyList_GET_ITEM(__ERROR, 0);<br>106 PyObject* old_err_msg = PyList_GET_ITEM(__ERROR, 1);<br>107 PyObject* old_err_traceback = PyList_GET_ITEM(__ERROR, 2);<br>108 PyList_SET_ITEM(__ERROR, 0, err_type);<br>109 PyList_SET_ITEM(__ERROR, 1, err_msg);<br>110 PyList_SET_ITEM(__ERROR, 2, err_traceback);<br>111 {Py_XDECREF(old_err_type);}<br>112 {Py_XDECREF(old_err_msg);}<br>113 {Py_XDECREF(old_err_traceback);}<br>114 }<br>115 // The failure code is returned to index what code block failed.<br>116 return __failure;<br>117 <br>118 }<br>119 };<br>120 }<br>121 <br>122 <br>123 static int __struct_compiled_op_f90a7a397ede0965c66895e171db1485_executor(__struct_compiled_op_f90a7a397ede0965c66895e171db1485* self) {<br>124 return self-&gt;run();<br>125 }<br>126 <br>127 static void __struct_compiled_op_f90a7a397ede0965c66895e171db1485_destructor(void* executor, void* self) {<br>128 delete ((__struct_compiled_op_f90a7a397ede0965c66895e171db1485*)self);<br>129 }<br>130 <br>131 //////////////////////<br>132 //// Functions<br>133 //////////////////////<br>134 static PyObject * instantiate(PyObject * self, PyObject *argtuple) {<br>135 assert(PyTuple_Check(argtuple));<br>136 if (2 != PyTuple_Size(argtuple)){ <br>137 PyErr_Format(PyExc_TypeError, &quot;Wrong number of arguments, expected 2, got %i&quot;, (int)PyTuple_Size(argtuple));<br>138 return NULL;<br>139 }<br>140 __struct_compiled_op_f90a7a397ede0965c66895e171db1485* struct_ptr = new __struct_compiled_op_f90a7a397ede0965c66895e171db1485();<br>141 if (struct_ptr-&gt;init( PyTuple_GET_ITEM(argtuple, 0),PyTuple_GET_ITEM(argtuple, 1) ) != 0) {<br>142 delete struct_ptr;<br>143 return NULL;<br>144 }<br>145 PyObject* thunk = PyCObject_FromVoidPtrAndDesc((void*)(&amp;__struct_compiled_op_f90a7a397ede0965c66895e171db1485_executor), struct_ptr, __struct_compiled_op_f90a7a397ede0965c66895e171db1485_destructor);<br>146 return thunk; }<br>147 <br>148 //////////////////////<br>149 //// Module init<br>150 //////////////////////<br>151 static PyMethodDef MyMethods[] = {<br>152 {&quot;instantiate&quot;, instantiate, METH_VARARGS, &quot;undocumented&quot;} ,<br>153 {NULL, NULL, 0, NULL}<br>154 };<br>155 PyMODINIT_FUNC initf90a7a397ede0965c66895e171db1485(void){<br>156 (void) Py_InitModule(&quot;f90a7a397ede0965c66895e171db1485&quot;, MyMethods);<br>157 }<br>158 <br>===============================<br>In file included from /usr/include/python2.7/Python.h:8:0,<br> from mod.cu:1:<br>/usr/include/python2.7/pyconfig.h:1161:0: warning: &quot;_POSIX_C_SOURCE&quot; redefined [enabled by default]<br>In file included from /usr/local/cuda-6.5/bin/..//include/host_config.h:119:0,<br> from /usr/local/cuda-6.5/bin/..//include/cuda_runtime.h:59,<br> from &lt;command-line&gt;:0:<br>/usr/include/features.h:163:0: note: this is the location of the previous definition<br>In file included from /usr/include/python2.7/Python.h:8:0,<br> from mod.cu:1:<br>/usr/include/python2.7/pyconfig.h:1183:0: warning: &quot;_XOPEN_SOURCE&quot; redefined [enabled by default]<br>In file included from /usr/local/cuda-6.5/bin/..//include/host_config.h:119:0,<br> from /usr/local/cuda-6.5/bin/..//include/cuda_runtime.h:59,<br> from &lt;command-line&gt;:0:<br>/usr/include/features.h:165:0: note: this is the location of the previous definition<br>mod.cu:3:19: fatal error: cudnn.h: No such file or directory<br>compilation terminated.</p>\n<p>['nvcc', '-shared', '-O3', '-use_fast_math', '-arch=sm_35', '-m64', '-Xcompiler', '-fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=b0c165044f8fd1e0f58745b1202dab6e,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY,-D NPY_ARRAY_ALIGNED=NPY_ALIGNED,-D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE,-D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_ALL,-D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS,-D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS,-fPIC', '-Xlinker', '-rpath,/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/cuda_ndarray', '-I/usr/lib/pymodules/python2.7/numpy/core/include', '-I/usr/include/python2.7', '-I/mnt/home.dokt/antonkos/code/Theano/theano/sandbox/cuda', '-o', '/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/tmpOc31Ki/f90a7a397ede0965c66895e171db1485.so', 'mod.cu', '-L/usr/lib', '-lpython2.7', '-lcudnn', '-lcudart']<br>ERROR (theano.gof.opt): SeqOptimizer apply &lt;theano.sandbox.cuda.dnn.NoCuDNNRaise object at 0x3a32250&gt;<br>ERROR (theano.gof.opt): Traceback:<br>ERROR (theano.gof.opt): Traceback (most recent call last):<br> File &quot;theano/gof/opt.py&quot;, line 195, in apply<br> sub_prof = optimizer.optimize(fgraph)<br> File &quot;theano/gof/opt.py&quot;, line 81, in optimize<br> ret = self.apply(fgraph, *args, **kwargs)<br> File &quot;theano/sandbox/cuda/dnn.py&quot;, line 1680, in apply<br> if not dnn_available():<br> File &quot;theano/sandbox/cuda/dnn.py&quot;, line 75, in dnn_available<br> v = version()<br> File &quot;theano/sandbox/cuda/dnn.py&quot;, line 206, in version<br> theano.Mode(optimizer=None))<br> File &quot;theano/compile/function.py&quot;, line 286, in function<br> output_keys=output_keys)<br> File &quot;theano/compile/pfunc.py&quot;, line 511, in pfunc<br> on_unused_input=on_unused_input, output_keys=output_keys)<br> File &quot;theano/compile/function_module.py&quot;, line 1484, in orig_function<br> defaults)<br> File &quot;theano/compile/function_module.py&quot;, line 1335, in create<br> input_storage=input_storage_lists)<br> File &quot;theano/gof/link.py&quot;, line 559, in make_thunk<br> output_storage=output_storage)[:3]<br> File &quot;theano/gof/vm.py&quot;, line 996, in make_all<br> no_recycling))<br> File &quot;theano/sandbox/cuda/__init__.py&quot;, line 258, in make_thunk<br> compute_map, no_recycling)<br> File &quot;theano/gof/op.py&quot;, line 749, in make_thunk<br> output_storage=node_output_storage)<br> File &quot;theano/gof/cc.py&quot;, line 1072, in make_thunk<br> keep_lock=keep_lock)<br> File &quot;theano/gof/cc.py&quot;, line 1014, in __compile__<br> keep_lock=keep_lock)<br> File &quot;theano/gof/cc.py&quot;, line 1441, in cthunk_factory<br> key=key, lnk=self, keep_lock=keep_lock)<br> File &quot;theano/gof/cmodule.py&quot;, line 1075, in module_from_key<br> module = lnk.compile_cmodule(location)<br> File &quot;theano/gof/cc.py&quot;, line 1353, in compile_cmodule<br> preargs=preargs)<br> File &quot;theano/sandbox/cuda/nvcc_compiler.py&quot;, line 423, in compile_str<br> 'for cmd', ' '.join(cmd))<br>Exception: ('The following error happened while compiling the node', &lt;theano.sandbox.cuda.dnn.DnnVersion object at 0xc10f610&gt;(), '\\n', 'nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -use_fast_math -arch=sm_35 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=b0c165044f8fd1e0f58745b1202dab6e,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY,-D NPY_ARRAY_ALIGNED=NPY_ALIGNED,-D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE,-D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_ALL,-D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS,-D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS,-fPIC -Xlinker -rpath,/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/cuda_ndarray -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -I/mnt/home.dokt/antonkos/code/Theano/theano/sandbox/cuda -o /mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/tmpOc31Ki/f90a7a397ede0965c66895e171db1485.so mod.cu -L/usr/lib -lpython2.7 -lcudnn -lcudart', '[&lt;theano.sandbox.cuda.dnn.DnnVersion object at 0xc10f610&gt;()]')</p>\n<p>when I run the command on which node building failed i.e.</p>\n<p>nvcc -shared -O3 -use_fast_math -arch=sm_35 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=b0c165044f8fd1e0f58745b1202dab6e,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY,-D NPY_ARRAY_ALIGNED=NPY_ALIGNED,-fPIC -Xlinker -rpath,/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/cuda_ndarray -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -I/mnt/home.dokt/antonkos/code/Theano/theano/sandbox/cuda -o /mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/tmpOc31Ki/f90a7a397ede0965c66895e171db1485.so mod.cu -L/usr/lib -lpython2.7 -lcudnn -lcudart</p>\n<p>it says me&nbsp;nvcc fatal : Don't know what to do with 'NPY_ARRAY_ALIGNED=NPY_ALIGNED,-fPIC'</p>\n<p>I'm puzzled with this. Would appreciate a lot if someone can give relevant advises...</p>",
  "messages": [
    {
      "id": "72002",
      "postDate": "04/16/2015 21:28:07",
      "content": "<p>I am desperately trying to install Theano library, but keep failing :( Could someone kindly help me with it?</p>\n<p>after installation of theano and setting environment veriables to this</p>\n<p>export THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True,optimizer_including=cudnn'</p>\n<p>export CUDA_ROOT=/path/to/cudnn</p>\n<p>I type python -c &quot;import theano&quot; and get this</p>\n<p>Using gpu device 0: GeForce GTX TITAN Black<br>1 #include &lt;Python.h&gt;<br>2 #include &lt;iostream&gt;<br>3 #include &quot;cudnn.h&quot;<br>4 //////////////////////<br>5 //// Support Code<br>6 //////////////////////<br>7 <br>8 #if PY_MAJOR_VERSION &gt;= 3<br>9 #define PyInt_FromLong PyLong_FromLong<br>10 #endif<br>11 <br>12 <br>13 namespace {<br>14 struct __struct_compiled_op_f90a7a397ede0965c66895e171db1485 {<br>15 PyObject* __ERROR;<br>16 <br>17 PyObject* storage_V1;<br>18 <br>19 <br>20 __struct_compiled_op_f90a7a397ede0965c66895e171db1485() {}<br>21 ~__struct_compiled_op_f90a7a397ede0965c66895e171db1485(void) {<br>22 cleanup();<br>23 }<br>24 <br>25 int init(PyObject* __ERROR, PyObject* storage_V1) {<br>26 Py_XINCREF(storage_V1);<br>27 this-&gt;storage_V1 = storage_V1;<br>28 <br>29 <br>30 <br>31 this-&gt;__ERROR = __ERROR;<br>32 return 0;<br>33 }<br>34 void cleanup(void) {<br>35 __label_1:<br>36 <br>37 double __DUMMY_1;<br>38 __label_4:<br>39 <br>40 double __DUMMY_4;<br>41 <br>42 Py_XDECREF(this-&gt;storage_V1);<br>43 }<br>44 int run(void) {<br>45 int __failure = 0;<br>46 <br>47 PyObject* py_V1;<br>48 <br>49 PyObject* V1;<br>50 <br>51 {<br>52 <br>53 py_V1 = Py_None;<br>54 {Py_XINCREF(py_V1);}<br>55 <br>56 V1 = NULL;<br>57 <br>58 {<br>59 // Op class DnnVersion<br>60 <br>61 #if defined(CUDNN_VERSION)<br>62 V1 = PyTuple_Pack(2, PyInt_FromLong(CUDNN_VERSION), PyInt_FromLong(cudnnGetVersion()));<br>63 #else<br>64 V1 = PyInt_FromLong(-1);<br>65 #endif<br>66 __label_3:<br>67 <br>68 double __DUMMY_3;<br>69 <br>70 }<br>71 __label_2:<br>72 <br>73 if (!__failure) {<br>74 <br>75 assert(py_V1-&gt;ob_refcnt &gt; 1);<br>76 Py_DECREF(py_V1);<br>77 py_V1 = V1 ? V1 : Py_None;<br>78 Py_INCREF(py_V1);<br>79 <br>80 PyObject* old = PyList_GET_ITEM(storage_V1, 0);<br>81 {Py_XINCREF(py_V1);}<br>82 PyList_SET_ITEM(storage_V1, 0, py_V1);<br>83 {Py_XDECREF(old);}<br>84 }<br>85 <br>86 Py_XDECREF(V1);<br>87 <br>88 {Py_XDECREF(py_V1);}<br>89 <br>90 double __DUMMY_2;<br>91 <br>92 }<br>93 <br>94 <br>95 if (__failure) {<br>96 // When there is a failure, this code puts the exception<br>97 // in __ERROR.<br>98 PyObject* err_type = NULL;<br>99 PyObject* err_msg = NULL;<br>100 PyObject* err_traceback = NULL;<br>101 PyErr_Fetch(&amp;err_type, &amp;err_msg, &amp;err_traceback);<br>102 if (!err_type) {err_type = Py_None;Py_INCREF(Py_None);}<br>103 if (!err_msg) {err_msg = Py_None; Py_INCREF(Py_None);}<br>104 if (!err_traceback) {err_traceback = Py_None; Py_INCREF(Py_None);}<br>105 PyObject* old_err_type = PyList_GET_ITEM(__ERROR, 0);<br>106 PyObject* old_err_msg = PyList_GET_ITEM(__ERROR, 1);<br>107 PyObject* old_err_traceback = PyList_GET_ITEM(__ERROR, 2);<br>108 PyList_SET_ITEM(__ERROR, 0, err_type);<br>109 PyList_SET_ITEM(__ERROR, 1, err_msg);<br>110 PyList_SET_ITEM(__ERROR, 2, err_traceback);<br>111 {Py_XDECREF(old_err_type);}<br>112 {Py_XDECREF(old_err_msg);}<br>113 {Py_XDECREF(old_err_traceback);}<br>114 }<br>115 // The failure code is returned to index what code block failed.<br>116 return __failure;<br>117 <br>118 }<br>119 };<br>120 }<br>121 <br>122 <br>123 static int __struct_compiled_op_f90a7a397ede0965c66895e171db1485_executor(__struct_compiled_op_f90a7a397ede0965c66895e171db1485* self) {<br>124 return self-&gt;run();<br>125 }<br>126 <br>127 static void __struct_compiled_op_f90a7a397ede0965c66895e171db1485_destructor(void* executor, void* self) {<br>128 delete ((__struct_compiled_op_f90a7a397ede0965c66895e171db1485*)self);<br>129 }<br>130 <br>131 //////////////////////<br>132 //// Functions<br>133 //////////////////////<br>134 static PyObject * instantiate(PyObject * self, PyObject *argtuple) {<br>135 assert(PyTuple_Check(argtuple));<br>136 if (2 != PyTuple_Size(argtuple)){ <br>137 PyErr_Format(PyExc_TypeError, &quot;Wrong number of arguments, expected 2, got %i&quot;, (int)PyTuple_Size(argtuple));<br>138 return NULL;<br>139 }<br>140 __struct_compiled_op_f90a7a397ede0965c66895e171db1485* struct_ptr = new __struct_compiled_op_f90a7a397ede0965c66895e171db1485();<br>141 if (struct_ptr-&gt;init( PyTuple_GET_ITEM(argtuple, 0),PyTuple_GET_ITEM(argtuple, 1) ) != 0) {<br>142 delete struct_ptr;<br>143 return NULL;<br>144 }<br>145 PyObject* thunk = PyCObject_FromVoidPtrAndDesc((void*)(&amp;__struct_compiled_op_f90a7a397ede0965c66895e171db1485_executor), struct_ptr, __struct_compiled_op_f90a7a397ede0965c66895e171db1485_destructor);<br>146 return thunk; }<br>147 <br>148 //////////////////////<br>149 //// Module init<br>150 //////////////////////<br>151 static PyMethodDef MyMethods[] = {<br>152 {&quot;instantiate&quot;, instantiate, METH_VARARGS, &quot;undocumented&quot;} ,<br>153 {NULL, NULL, 0, NULL}<br>154 };<br>155 PyMODINIT_FUNC initf90a7a397ede0965c66895e171db1485(void){<br>156 (void) Py_InitModule(&quot;f90a7a397ede0965c66895e171db1485&quot;, MyMethods);<br>157 }<br>158 <br>===============================<br>In file included from /usr/include/python2.7/Python.h:8:0,<br> from mod.cu:1:<br>/usr/include/python2.7/pyconfig.h:1161:0: warning: &quot;_POSIX_C_SOURCE&quot; redefined [enabled by default]<br>In file included from /usr/local/cuda-6.5/bin/..//include/host_config.h:119:0,<br> from /usr/local/cuda-6.5/bin/..//include/cuda_runtime.h:59,<br> from &lt;command-line&gt;:0:<br>/usr/include/features.h:163:0: note: this is the location of the previous definition<br>In file included from /usr/include/python2.7/Python.h:8:0,<br> from mod.cu:1:<br>/usr/include/python2.7/pyconfig.h:1183:0: warning: &quot;_XOPEN_SOURCE&quot; redefined [enabled by default]<br>In file included from /usr/local/cuda-6.5/bin/..//include/host_config.h:119:0,<br> from /usr/local/cuda-6.5/bin/..//include/cuda_runtime.h:59,<br> from &lt;command-line&gt;:0:<br>/usr/include/features.h:165:0: note: this is the location of the previous definition<br>mod.cu:3:19: fatal error: cudnn.h: No such file or directory<br>compilation terminated.</p>\n<p>['nvcc', '-shared', '-O3', '-use_fast_math', '-arch=sm_35', '-m64', '-Xcompiler', '-fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=b0c165044f8fd1e0f58745b1202dab6e,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY,-D NPY_ARRAY_ALIGNED=NPY_ALIGNED,-D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE,-D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_ALL,-D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS,-D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS,-fPIC', '-Xlinker', '-rpath,/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/cuda_ndarray', '-I/usr/lib/pymodules/python2.7/numpy/core/include', '-I/usr/include/python2.7', '-I/mnt/home.dokt/antonkos/code/Theano/theano/sandbox/cuda', '-o', '/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/tmpOc31Ki/f90a7a397ede0965c66895e171db1485.so', 'mod.cu', '-L/usr/lib', '-lpython2.7', '-lcudnn', '-lcudart']<br>ERROR (theano.gof.opt): SeqOptimizer apply &lt;theano.sandbox.cuda.dnn.NoCuDNNRaise object at 0x3a32250&gt;<br>ERROR (theano.gof.opt): Traceback:<br>ERROR (theano.gof.opt): Traceback (most recent call last):<br> File &quot;theano/gof/opt.py&quot;, line 195, in apply<br> sub_prof = optimizer.optimize(fgraph)<br> File &quot;theano/gof/opt.py&quot;, line 81, in optimize<br> ret = self.apply(fgraph, *args, **kwargs)<br> File &quot;theano/sandbox/cuda/dnn.py&quot;, line 1680, in apply<br> if not dnn_available():<br> File &quot;theano/sandbox/cuda/dnn.py&quot;, line 75, in dnn_available<br> v = version()<br> File &quot;theano/sandbox/cuda/dnn.py&quot;, line 206, in version<br> theano.Mode(optimizer=None))<br> File &quot;theano/compile/function.py&quot;, line 286, in function<br> output_keys=output_keys)<br> File &quot;theano/compile/pfunc.py&quot;, line 511, in pfunc<br> on_unused_input=on_unused_input, output_keys=output_keys)<br> File &quot;theano/compile/function_module.py&quot;, line 1484, in orig_function<br> defaults)<br> File &quot;theano/compile/function_module.py&quot;, line 1335, in create<br> input_storage=input_storage_lists)<br> File &quot;theano/gof/link.py&quot;, line 559, in make_thunk<br> output_storage=output_storage)[:3]<br> File &quot;theano/gof/vm.py&quot;, line 996, in make_all<br> no_recycling))<br> File &quot;theano/sandbox/cuda/__init__.py&quot;, line 258, in make_thunk<br> compute_map, no_recycling)<br> File &quot;theano/gof/op.py&quot;, line 749, in make_thunk<br> output_storage=node_output_storage)<br> File &quot;theano/gof/cc.py&quot;, line 1072, in make_thunk<br> keep_lock=keep_lock)<br> File &quot;theano/gof/cc.py&quot;, line 1014, in __compile__<br> keep_lock=keep_lock)<br> File &quot;theano/gof/cc.py&quot;, line 1441, in cthunk_factory<br> key=key, lnk=self, keep_lock=keep_lock)<br> File &quot;theano/gof/cmodule.py&quot;, line 1075, in module_from_key<br> module = lnk.compile_cmodule(location)<br> File &quot;theano/gof/cc.py&quot;, line 1353, in compile_cmodule<br> preargs=preargs)<br> File &quot;theano/sandbox/cuda/nvcc_compiler.py&quot;, line 423, in compile_str<br> 'for cmd', ' '.join(cmd))<br>Exception: ('The following error happened while compiling the node', &lt;theano.sandbox.cuda.dnn.DnnVersion object at 0xc10f610&gt;(), '\\n', 'nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -use_fast_math -arch=sm_35 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=b0c165044f8fd1e0f58745b1202dab6e,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY,-D NPY_ARRAY_ALIGNED=NPY_ALIGNED,-D NPY_ARRAY_WRITEABLE=NPY_WRITEABLE,-D NPY_ARRAY_UPDATE_ALL=NPY_UPDATE_ALL,-D NPY_ARRAY_C_CONTIGUOUS=NPY_C_CONTIGUOUS,-D NPY_ARRAY_F_CONTIGUOUS=NPY_F_CONTIGUOUS,-fPIC -Xlinker -rpath,/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/cuda_ndarray -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -I/mnt/home.dokt/antonkos/code/Theano/theano/sandbox/cuda -o /mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/tmpOc31Ki/f90a7a397ede0965c66895e171db1485.so mod.cu -L/usr/lib -lpython2.7 -lcudnn -lcudart', '[&lt;theano.sandbox.cuda.dnn.DnnVersion object at 0xc10f610&gt;()]')</p>\n<p>when I run the command on which node building failed i.e.</p>\n<p>nvcc -shared -O3 -use_fast_math -arch=sm_35 -m64 -Xcompiler -fno-math-errno,-Wno-unused-label,-Wno-unused-variable,-Wno-write-strings,-DCUDA_NDARRAY_CUH=b0c165044f8fd1e0f58745b1202dab6e,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-D NPY_ARRAY_ENSURECOPY=NPY_ENSURECOPY,-D NPY_ARRAY_ALIGNED=NPY_ALIGNED,-fPIC -Xlinker -rpath,/mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/cuda_ndarray -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -I/mnt/home.dokt/antonkos/code/Theano/theano/sandbox/cuda -o /mnt/home.dokt/antonkos/.theano/compiledir_Linux-3.2--amd64-x86_64-with-debian-7.8--2.7.3-64/tmpOc31Ki/f90a7a397ede0965c66895e171db1485.so mod.cu -L/usr/lib -lpython2.7 -lcudnn -lcudart</p>\n<p>it says me&nbsp;nvcc fatal : Don't know what to do with 'NPY_ARRAY_ALIGNED=NPY_ALIGNED,-fPIC'</p>\n<p>I'm puzzled with this. Would appreciate a lot if someone can give relevant advises...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "72352",
      "postDate": "04/18/2015 21:08:06",
      "content": "<p>Not exactly sure where your problem lies, but this blog post and nvidia documentation really helped me to get cuda c and theano (and pylearn2 as well) to play nice with each other. &nbsp;</p>\n<p>http://markus.com/install-theano-on-aws/</p>\n<p>http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#axzz3XhIiPlrK</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "72353",
      "postDate": "04/18/2015 21:12:07",
      "content": "<p>I want to use cudnn for theano, however I can't simply copy *.so &amp; *.h files in /usr/lib64 &amp; /usr/include folders because I don't have rights for that. It seems theano has some bug in case if one sets it through CUDA_ROOT or LD_LIBRARY_PATH or just PATH variables.&nbsp;</p>\n<p>Currently I am trying to fix this issue in theano source code.</p>\n\n<p>UPD. I am not trying to install it on Amazon server. This is some local cluster without admin rights.</p>\n<p>-K.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "72498",
      "postDate": "04/19/2015 19:00:49",
      "content": "<p>There is a few suspicious things over there, I think:</p>\n<p>export CUDA_ROOT=/path/to/cudnn<br>- did you set exactly the above string to CUDA_ROOT?</p>\n<p>export THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True,optimizer_including=cudnn'<br>- you may use .theanoarc file to configure theano, because that is more transparent to use.</p>\n<p>I can't simply copy *.so &amp; *.h files in /usr/lib64 &amp; /usr/include folders because I don't have rights for that<br>- you will be able if you'll try to do it as root</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "72514",
      "postDate": "04/19/2015 20:01:19",
      "content": "<p>Here's what I added to my .bashrc to get Theano to use cuDNN (without needing root):</p>\n<p style=\"padding-left: 30px\">export PATH=$PATH:/usr/local/cuda/bin<br>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export LIBRARY_PATH=$LIBRARY_PATH:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export CPATH=/mnt/storage/users/sedielem/lib/cudnn-R2</p>\n<p>The directory /mnt/storage/users/sedielem/lib/cudnn-R2 contains all the files from the archive you can download from NVIDIA.</p>\n<p>Note that depending on your distro, the CUDA path may be different as well.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "72522",
      "postDate": "04/19/2015 21:12:12",
      "content": "<p>[quote=George Solymosi;72498]</p>\n<p>There is a few suspicious things over there, I think:</p>\n<p>export CUDA_ROOT=/path/to/cudnn<br>- did you set exactly the above string to CUDA_ROOT?</p>\n<p>[/quote]</p>\n<p>yes, CUDA_ROOT indeed should be set to the directory with CUDA.</p>\n<p>I had this when I was trying different options, but after going through theano's source code I understood that setting CUDA_ROOT to directory with cudnn is wrong thing.</p>\n<p>[quote]</p>\n<p>export THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True,optimizer_including=cudnn'<br>- you may use .theanoarc file to configure theano, because that is more transparent to use.</p>\n<p>I can't simply copy *.so &amp; *.h files in /usr/lib64 &amp; /usr/include folders because I don't have rights for that<br>- you will be able if you'll try to do it as root</p>\n<p>[/quote]</p>\n<p>The problem is that I can't get root rights on that machine, so solution with simply putting cudnn's *.so &amp; *.h in proper place is not suitable for me. Browsing through internet I understood that actually nobody who tried was able to put cudnn to different directory than CUDA_ROOT and make theano working with cudnn. Going through theano's source code I figured out&nbsp;that theano&nbsp;actually assumes that cudnn is in CUDA_ROOT. So, I modified theano to be able to find cudnn in different directory from CUDA_ROOT. Now, my version of theano works with CUDNN_ROOT additionally, i.e. if such environment variable exists theano additionally looks into this directory when it needs cudnn for compilation.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "72523",
      "postDate": "04/19/2015 21:14:18",
      "content": "<p>[quote=sedielem;72514]</p>\n<p>Here's what I added to my .bashrc to get Theano to use cuDNN (without needing root):</p>\n<p style=\"padding-left: 30px\">export PATH=$PATH:/usr/local/cuda/bin<br>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export LIBRARY_PATH=$LIBRARY_PATH:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export CPATH=/mnt/storage/users/sedielem/lib/cudnn-R2</p>\n<p>The directory /mnt/storage/users/sedielem/lib/cudnn-R2 contains all the files from the archive you can download from NVIDIA.</p>\n<p>Note that depending on your distro, the CUDA path may be different as well.</p>\n<p>[/quote]</p>\n\n<p>I saw these solutions on theano web-page dedicated to cudnn, however for some reason none of these worked for me.&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "73150",
      "postDate": "04/22/2015 12:12:00",
      "content": "<p>Hi, I am new here.</p>\n<p>I am just wondering is cuDNN library allowed to use in this competition?</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "79396",
      "postDate": "05/20/2015 07:09:25",
      "content": "<p>I fiddled around with al lot of these kinds of errors and solutions. It was only after I put all the settings in a .theanoarc file that I got it to work without errors.</p>",
      "rawMarkdown": "",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 72352,
      "author_name": "gobrewers14",
      "author_url": "",
      "post_date": "04/18/2015 21:08:06",
      "content": "<p>Not exactly sure where your problem lies, but this blog post and nvidia documentation really helped me to get cuda c and theano (and pylearn2 as well) to play nice with each other. &nbsp;</p>\n<p>http://markus.com/install-theano-on-aws/</p>\n<p>http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#axzz3XhIiPlrK</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 72353,
      "author_name": "",
      "author_url": "",
      "post_date": "04/18/2015 21:12:07",
      "content": "<p>I want to use cudnn for theano, however I can't simply copy *.so &amp; *.h files in /usr/lib64 &amp; /usr/include folders because I don't have rights for that. It seems theano has some bug in case if one sets it through CUDA_ROOT or LD_LIBRARY_PATH or just PATH variables.&nbsp;</p>\n<p>Currently I am trying to fix this issue in theano source code.</p>\n\n<p>UPD. I am not trying to install it on Amazon server. This is some local cluster without admin rights.</p>\n<p>-K.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 72498,
      "author_name": "",
      "author_url": "",
      "post_date": "04/19/2015 19:00:49",
      "content": "<p>There is a few suspicious things over there, I think:</p>\n<p>export CUDA_ROOT=/path/to/cudnn<br>- did you set exactly the above string to CUDA_ROOT?</p>\n<p>export THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True,optimizer_including=cudnn'<br>- you may use .theanoarc file to configure theano, because that is more transparent to use.</p>\n<p>I can't simply copy *.so &amp; *.h files in /usr/lib64 &amp; /usr/include folders because I don't have rights for that<br>- you will be able if you'll try to do it as root</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 72514,
      "author_name": "sedielem",
      "author_url": "",
      "post_date": "04/19/2015 20:01:19",
      "content": "<p>Here's what I added to my .bashrc to get Theano to use cuDNN (without needing root):</p>\n<p style=\"padding-left: 30px\">export PATH=$PATH:/usr/local/cuda/bin<br>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export LIBRARY_PATH=$LIBRARY_PATH:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export CPATH=/mnt/storage/users/sedielem/lib/cudnn-R2</p>\n<p>The directory /mnt/storage/users/sedielem/lib/cudnn-R2 contains all the files from the archive you can download from NVIDIA.</p>\n<p>Note that depending on your distro, the CUDA path may be different as well.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 72522,
      "author_name": "",
      "author_url": "",
      "post_date": "04/19/2015 21:12:12",
      "content": "<p>[quote=George Solymosi;72498]</p>\n<p>There is a few suspicious things over there, I think:</p>\n<p>export CUDA_ROOT=/path/to/cudnn<br>- did you set exactly the above string to CUDA_ROOT?</p>\n<p>[/quote]</p>\n<p>yes, CUDA_ROOT indeed should be set to the directory with CUDA.</p>\n<p>I had this when I was trying different options, but after going through theano's source code I understood that setting CUDA_ROOT to directory with cudnn is wrong thing.</p>\n<p>[quote]</p>\n<p>export THEANO_FLAGS='floatX=float32,device=gpu0,nvcc.fastmath=True,optimizer_including=cudnn'<br>- you may use .theanoarc file to configure theano, because that is more transparent to use.</p>\n<p>I can't simply copy *.so &amp; *.h files in /usr/lib64 &amp; /usr/include folders because I don't have rights for that<br>- you will be able if you'll try to do it as root</p>\n<p>[/quote]</p>\n<p>The problem is that I can't get root rights on that machine, so solution with simply putting cudnn's *.so &amp; *.h in proper place is not suitable for me. Browsing through internet I understood that actually nobody who tried was able to put cudnn to different directory than CUDA_ROOT and make theano working with cudnn. Going through theano's source code I figured out&nbsp;that theano&nbsp;actually assumes that cudnn is in CUDA_ROOT. So, I modified theano to be able to find cudnn in different directory from CUDA_ROOT. Now, my version of theano works with CUDNN_ROOT additionally, i.e. if such environment variable exists theano additionally looks into this directory when it needs cudnn for compilation.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 72523,
      "author_name": "",
      "author_url": "",
      "post_date": "04/19/2015 21:14:18",
      "content": "<p>[quote=sedielem;72514]</p>\n<p>Here's what I added to my .bashrc to get Theano to use cuDNN (without needing root):</p>\n<p style=\"padding-left: 30px\">export PATH=$PATH:/usr/local/cuda/bin<br>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export LIBRARY_PATH=$LIBRARY_PATH:/mnt/storage/users/sedielem/lib/cudnn-R2<br>export CPATH=/mnt/storage/users/sedielem/lib/cudnn-R2</p>\n<p>The directory /mnt/storage/users/sedielem/lib/cudnn-R2 contains all the files from the archive you can download from NVIDIA.</p>\n<p>Note that depending on your distro, the CUDA path may be different as well.</p>\n<p>[/quote]</p>\n\n<p>I saw these solutions on theano web-page dedicated to cudnn, however for some reason none of these worked for me.&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 73150,
      "author_name": "rbnwkt",
      "author_url": "",
      "post_date": "04/22/2015 12:12:00",
      "content": "<p>Hi, I am new here.</p>\n<p>I am just wondering is cuDNN library allowed to use in this competition?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 79396,
      "author_name": "dfjmulder",
      "author_url": "",
      "post_date": "05/20/2015 07:09:25",
      "content": "<p>I fiddled around with al lot of these kinds of errors and solutions. It was only after I put all the settings in a .theanoarc file that I got it to work without errors.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "72002": "",
    "72352": "",
    "72353": "",
    "72498": "",
    "72514": "",
    "72522": "",
    "72523": "",
    "73150": "",
    "79396": ""
  },
  "source": "meta"
}