mmcv
mmcv copied to clipboard
rcom4.01+pytorch1.10 install mmcv failed
Checklist
- I have searched related issues but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- Thanks for the work,When I install mmcv in rocm4.0.1+pytorch1.10 I get the following error,and I have verified that pytorch can call gpu,
- runing MMCV_WITH_OPS=1 python3 setup.py develop
gcc -pthread -B /root/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHIP_DIFF -DMMCV_WITH_CUDA -I/mmcv/mmcv/ops/csrc/common -I/mmcv/mmcv/ops/csrc/common/cuda -I/root/miniconda3/lib/python3.7/site-packages/torch/include -I/root/miniconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.7/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.7/site-packages/torch/include/THC -I/root/miniconda3/lib/python3.7/site-packages/torch/include/THH -I/opt/rocm/include -I/opt/rocm/miopen/include -I/root/miniconda3/include/python3.7m -c /mmcv/mmcv/ops/csrc/pytorch/hip/hipbind.cpp -o build/temp.linux-x86_64-3.7/mmcv/mmcv/ops/csrc/pytorch/hip/hipbind.o -fPIC -D__HIP_PLATFORM_HCC__=1 -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -DTORCH_EXTENSION_NAME=ext -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ /opt/rocm/bin/hipcc -DHIP_DIFF -DMMCV_WITH_CUDA -I/mmcv/mmcv/ops/csrc/common -I/mmcv/mmcv/ops/csrc/common/cuda -I/root/miniconda3/lib/python3.7/site-packages/torch/include -I/root/miniconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/lib/python3.7/site-packages/torch/include/TH -I/root/miniconda3/lib/python3.7/site-packages/torch/include/THC -I/root/miniconda3/lib/python3.7/site-packages/torch/include/THH -I/opt/rocm/include -I/opt/rocm/miopen/include -I/root/miniconda3/include/python3.7m -c /mmcv/mmcv/ops/csrc/pytorch/hip/sparse_indice.hip -o build/temp.linux-x86_64-3.7/mmcv/mmcv/ops/csrc/pytorch/hip/sparse_indice.o -fPIC -D__HIP_PLATFORM_HCC=1 -DCUDA_HAS_FP16=1 -D__HIP_NO_HALF_OPERATORS=1 -D__HIP_NO_HALF_CONVERSIONS__=1 -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 --amdgpu-target=gfx906 -fno-gpu-rdc In file included from /mmcv/mmcv/ops/csrc/pytorch/hip/sparse_indice.hip:28: In file included from /mmcv/mmcv/ops/csrc/pytorch/hip/../spconv_utils.h:17: /root/miniconda3/lib/python3.7/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:10: fatal error: 'cuda_runtime_api.h' file not found #include <cuda_runtime_api.h> ^~~~~~~~~~~~~~~~~~~~ 1 error generated when compiling for gfx906. error: command '/opt/rocm/bin/hipcc' failed with exit status 1
Hi~ you can try to compile mmcv-full like this:
MMCV_WITH_OPS=1 ROCM_HOME=/opt/rocm-4.0.0 python3 setup.py install
ROCM_HOME just like CUDA_HOME, and it should contain your rocm toolkit