ROCm / hipDNN

A thin wrapper around miOpen and cuDNN
36 stars 15 forks source link

Error Building #42

Closed ali-masoudi closed 5 years ago

ali-masoudi commented 5 years ago

$ cmake

-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE VERSION 3.10.2
-- HIP_PATH : /opt/rocm/hip
-- Found HIP: /opt/rocm (found suitable version "1.5.19055", minimum required is "1.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/hipDNN/build`Údµ

$make

  File "/opt/rocm/bin/rocm_agent_enumerator", line 141
    print "gfx000"
                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("gfx000")?
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:961:17: warning: 
      comparison of two values with different enumeration types
      ('hipdnnDataType_t' and 'miopenDataType_t') [-Wenum-compare]
   if(*dataType == miopenFloat) {
      ~~~~~~~~~ ^  ~~~~~~~~~~~
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:970:24: warning: 
      comparison of two values with different enumeration types
      ('hipdnnDataType_t' and 'miopenDataType_t') [-Wenum-compare]
    else if (*dataType == miopenHalf){
             ~~~~~~~~~ ^  ~~~~~~~~~~
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:3079:1: warning: 
      control may reach end of non-void function [-Wreturn-type]
}
^
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:3112:1: warning: 
      control may reach end of non-void function [-Wreturn-type]
}
^
4 warnings generated.
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:961:17: warning: 
      comparison of two values with different enumeration types
      ('hipdnnDataType_t' and 'miopenDataType_t') [-Wenum-compare]
   if(*dataType == miopenFloat) {
      ~~~~~~~~~ ^  ~~~~~~~~~~~
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:970:24: warning: 
      comparison of two values with different enumeration types
      ('hipdnnDataType_t' and 'miopenDataType_t') [-Wenum-compare]
    else if (*dataType == miopenHalf){
             ~~~~~~~~~ ^  ~~~~~~~~~~
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:3079:1: warning: 
      control may reach end of non-void function [-Wreturn-type]
}
^
/tmp/hipDNN/library/src/hcc_detail/hipdnn_miopen.cpp:3112:1: warning: 
      control may reach end of non-void function [-Wreturn-type]
}
^
4 warnings generated.
[ 66%] Building CXX object library/CMakeFiles/hipdnn.dir/src/hcc_detail/logger.cpp.o
  File "/opt/rocm/bin/rocm_agent_enumerator", line 141
    print "gfx000"
                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("gfx000")?
[100%] Linking CXX shared library libhipdnn.so
  File "/opt/rocm/bin/rocm_agent_enumerator", line 141
    print "gfx000"
                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("gfx000")?
Died at /opt/rocm/hip/bin/hipcc line 669.
No valid AMD GPU target was either specified or found. Please specify a valid target using --amdgpu-target=library/CMakeFiles/hipdnn.dir/build.make:120: recipe for target 'library/libhipdnn.so' failed
make[2]: *** [library/libhipdnn.so] Error 1
CMakeFiles/Makefile2:85: recipe for target 'library/CMakeFiles/hipdnn.dir/all' failed
make[1]: *** [library/CMakeFiles/hipdnn.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
1_
Ëږu

And When i fix python 2to3 for print issue i i get :

Died at /opt/rocm/hip/bin/hipcc line 669.
No valid AMD GPU target was either specified or found. Please specify a valid target using --amdgpu-target=library/CMakeFiles/hipdnn.dir/build.make:120: recipe for target 'library/libhipdnn.so' failed
make[2]: *** [library/libhipdnn.so] Error 1
CMakeFiles/Makefile2:85: recipe for target 'library/CMakeFiles/hipdnn.dir/all' failed
make[1]: *** [library/CMakeFiles/hipdnn.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
ali-masoudi commented 5 years ago

Solved it by Converting to Python 3

2to3 -w /opt/rocm/bin/rocm_agent_enumerator

and Explicitly Mentioning RX580 GCN in /opt/rocm/hip/bin/hipcc Lines 147 & 150

$target_gfx803 = 0 change to 1
$default_amdgpu_target = 1 change to 0