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

[Bug] Enabling USE_CPP_RPC and using cross compiler requires HEXAGON_SDK #10202

Closed
pfk-beta opened this issue Feb 9, 2022 · 4 comments
Closed

Comments

@pfk-beta
Copy link
Contributor

pfk-beta commented Feb 9, 2022

When I try to build rpc_server binary, I have changed config.cmake:

sed -i 's/set(USE_CPP_RPC OFF)/set(USE_CPP_RPC ON)/g' config.cmake

And I'm getting following error:

-- Checking Hexagon SDK root: /path/to/sdk
CMake Error at cmake/modules/HexagonSDK.cmake:47 (message):
  Cannot validate Hexagon SDK in /path/to/sdk
Call Stack (most recent call first):
  apps/cpp_rpc/CMakeLists.txt:49 (find_hexagon_sdk_root)

--edit--
After some digging, I can see, than not only USE_CPP_RPC, but with CPP_RPC and cross compilers from NDK causes this error

@mehrdadh
Copy link
Member

mehrdadh commented Feb 9, 2022

@pfk-beta can you post your full config.cmake file?

@pfk-beta
Copy link
Contributor Author

pfk-beta commented Feb 10, 2022

Hello @mehrdadh , thanks for reply. Here is simple script for reproducing error:

sudo apt-get install llvm-12\* git
sudo mkdir -p /tvm
sudo chown `whoami`:`whoami` /tvm
git clone --recursive -b main --depth 1 git@github.com:apache/tvm.git /tvm
virtualenv -p /usr/bin/python3 /tvm/.venv/tvm
source /tvm/.venv/tvm/bin/activate
rm -rf /tvm/build-llvm12/*
mkdir -p /tvm/build-llvm12
cp /tvm/cmake/config.cmake /tvm/build-llvm12
cd /tvm/build-llvm12
sed -i 's/set(USE_LLVM OFF)/set(USE_LLVM \/usr\/lib\/llvm-12\/bin\/llvm-config)/g' config.cmake
sed -i 's/set(USE_RPC OFF)/set(USE_RPC ON)/g' config.cmake
sed -i 's/set(USE_CPP_RPC OFF)/set(USE_CPP_RPC ON)/g' config.cmake
cmake .. \
    -DUSE_RPC=ON \
    -DCMAKE_SYSTEM_NAME=Linux \
    -DCMAKE_SYSTEM_VERSION=1 \
    -DCMAKE_C_COMPILER=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang \
    -DCMAKE_CXX_COMPILER=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ \
    -DCMAKE_FIND_ROOT_PATH=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/ \
    -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
    -DMACHINE_NAME=armv8a-linux-gnu \
    -DUSE_LLVM=/usr/lib/llvm-12/bin/llvm-config
make -j4 runtime

Here is my config (grep -o '^[^#]*' config.cmake):

set(USE_CUDA OFF)
set(USE_ROCM OFF)
set(USE_SDACCEL OFF)
set(USE_AOCL OFF)
set(USE_OPENCL OFF)
set(USE_METAL OFF)
set(USE_VULKAN OFF)
set(USE_OPENGL OFF)
set(USE_MICRO OFF)
set(USE_RPC ON)
set(USE_CPP_RPC ON)
set(USE_IOS_RPC OFF)
set(USE_STACKVM_RUNTIME OFF)
set(USE_GRAPH_EXECUTOR ON)
set(USE_GRAPH_EXECUTOR_CUDA_GRAPH OFF)
set(USE_PIPELINE_EXECUTOR OFF)
set(USE_PROFILER ON)
set(USE_MICRO_STANDALONE_RUNTIME OFF)
set(USE_LLVM /usr/lib/llvm-12/bin/llvm-config)
set(USE_BYODT_POSIT OFF)
set(USE_BLAS none)
set(USE_MKL OFF)
set(USE_MKLDNN OFF)
set(USE_OPENMP none)
set(USE_RANDOM ON)
set(USE_NNPACK OFF)
set(USE_TFLITE OFF)
set(USE_TENSORFLOW_PATH none)
set(USE_FLATBUFFERS_PATH none)
set(USE_EDGETPU OFF)
set(USE_CUDNN OFF)
set(USE_CUBLAS OFF)
set(USE_MIOPEN OFF)
set(USE_MPS OFF)
set(USE_ROCBLAS OFF)
set(USE_SORT ON)
set(USE_DNNL_CODEGEN OFF)
set(USE_ARM_COMPUTE_LIB OFF)
set(USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR OFF)
set(USE_ETHOSN OFF)
set(USE_ETHOSN_HW OFF)
set(USE_ETHOSU OFF)
set(USE_CMSISNN OFF)
set(USE_TENSORRT_CODEGEN OFF)
set(USE_TENSORRT_RUNTIME OFF)
set(USE_VITIS_AI OFF)
set(USE_VERILATOR OFF)
set(USE_ANTLR OFF)
set(USE_RELAY_DEBUG OFF)
set(USE_VTA_FSIM OFF)
set(USE_VTA_TSIM OFF)
set(USE_VTA_FPGA OFF)
set(USE_THRUST OFF)
set(USE_TF_TVMDSOOP OFF)
set(USE_PT_TVMDSOOP OFF)
set(USE_FALLBACK_STL_MAP OFF)
set(USE_HEXAGON_DEVICE OFF)
set(USE_HEXAGON_SDK /path/to/sdk)
set(USE_HEXAGON_LAUNCHER OFF)
set(USE_HEXAGON_PROXY_RPC OFF)
set(USE_HEXAGON_ARCH "v66")
set(USE_TARGET_ONNX OFF)
set(USE_BNNS OFF)
set(USE_LIBBACKTRACE AUTO)
set(BUILD_STATIC_RUNTIME OFF)
set(USE_CCACHE AUTO)
set(USE_PAPI OFF)
set(USE_GTEST AUTO)
set(USE_CUTLASS OFF)
set(SUMMARIZE OFF)

I think the problem is little complex than I posted in title.

@pfk-beta
Copy link
Contributor Author

It is really, really strange imho. When I turn off cross-compilers in cmake command, then it work correctly:

sudo apt-get install llvm-12\* git
sudo mkdir -p /tvm
sudo chown `whoami`:`whoami` /tvm
git clone --recursive -b main --depth 1 git@github.com:apache/tvm.git /tvm
virtualenv -p /usr/bin/python3 /tvm/.venv/tvm
source /tvm/.venv/tvm/bin/activate
rm -rf /tvm/build-llvm12/*
mkdir -p /tvm/build-llvm12
cp /tvm/cmake/config.cmake /tvm/build-llvm12
cd /tvm/build-llvm12
sed -i 's/set(USE_LLVM OFF)/set(USE_LLVM \/usr\/lib\/llvm-12\/bin\/llvm-config)/g' config.cmake
sed -i 's/set(USE_RPC OFF)/set(USE_RPC ON)/g' config.cmake
sed -i 's/set(USE_CPP_RPC OFF)/set(USE_CPP_RPC ON)/g' config.cmake
cmake .. \
    -DUSE_RPC=ON \
    -DCMAKE_SYSTEM_NAME=Linux \
    -DCMAKE_SYSTEM_VERSION=1 \
    -DCMAKE_FIND_ROOT_PATH=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/ \
    -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
    -DMACHINE_NAME=armv8a-linux-gnu
make -j4 runtime

@pfk-beta pfk-beta changed the title [Bug] Enabling USE_CPP_RPC ON requires HEXAGON_SDK [Bug] Enabling USE_CPP_RPC and using cross compiler requires HEXAGON_SDK Feb 10, 2022
@pfk-beta
Copy link
Contributor Author

Issue should be solved by PR #10227 . I'm closing issue as the issue author:)

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

No branches or pull requests

2 participants