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

Building on Arm64 (Jetpack 5.1.1) #7916

Open
oliver-batchelor opened this issue May 2, 2023 · 5 comments
Open

Building on Arm64 (Jetpack 5.1.1) #7916

oliver-batchelor opened this issue May 2, 2023 · 5 comments
Assignees

Comments

@oliver-batchelor
Copy link
Contributor

oliver-batchelor commented May 2, 2023

On a fresh install on a Jetson Xavier AGX with Jetpack 5.1.1-b56, I have installed llvm-15 via. conda (conda-forge) and built it in a conda environment with python 3.9. This same method has worked for building from source for me previously on x86. The error looks very similar to that in #3872

I'm getting this error, regardless if my compiler is gcc-12 or clang-15.

Any tips much appreciated, has anyone had experience building on ARM?

[395/565] cd /home/canterbury/taichi/taichi/runtime/llvm/runtime_module && /home/canterbury/mambafor...cpp -o runtime_cuda.bc -fno-exceptions -emit-llvm -std=c++17 -D ARCH_cuda -I /home/canterbury/taichi
FAILED: taichi/runtime/llvm/runtime_module/CMakeFiles/generate_llvm_runtime_cuda /home/canterbury/taichi/_skbuild/linux-aarch64-3.9/cmake-build/taichi/runtime/llvm/runtime_module/CMakeFiles/generate_llvm_runtime_cuda 
cd /home/canterbury/taichi/taichi/runtime/llvm/runtime_module && /home/canterbury/mambaforge/envs/conan_ros/bin/clang++ -c runtime.cpp -o runtime_cuda.bc -fno-exceptions -emit-llvm -std=c++17 -D ARCH_cuda -I /home/canterbury/taichi
runtime.cpp:1114:23: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
               : "=r"(ret)
                      ^
runtime.cpp:1113:37: note: use constraint modifier "w"
  asm volatile("match.all.sync.b32  %0, %1, %2;"
                                    ^~
                                    %w0
runtime.cpp:1115:22: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
               : "r"(value), "r"(mask));
                     ^
runtime.cpp:1113:41: note: use constraint modifier "w"
  asm volatile("match.all.sync.b32  %0, %1, %2;"
                                        ^~
                                        %w1
runtime.cpp:1115:34: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
               : "r"(value), "r"(mask));
                                 ^
runtime.cpp:1113:45: note: use constraint modifier "w"
  asm volatile("match.all.sync.b32  %0, %1, %2;"
                                            ^~
                                            %w2
runtime.cpp:1127:18: error: invalid input constraint 'l' in asm
               : "l"(value), "r"(mask));
                 ^
runtime.cpp:1137:44: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
  asm volatile("activemask.b32 %0;" : "=r"(mask));
                                           ^
runtime.cpp:1137:32: note: use constraint modifier "w"
  asm volatile("activemask.b32 %0;" : "=r"(mask));
                               ^~
                               %w0
4 warnings and 1 error generated.

/home/canterbury/mambaforge/envs/conan_ros/lib/python3.9/site-packages/cmake/data/bin/cmake /home/canterbury/taichi -G Ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/home/canterbury/taichi/_skbuild/linux-aarch64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.16 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/canterbury/mambaforge/envs/conan_ros/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/home/canterbury/mambaforge/envs/conan_ros/bin/python -DPYTHON_INCLUDE_DIR:PATH=/home/canterbury/mambaforge/envs/conan_ros/include/python3.9 -DPYTHON_LIBRARY:PATH=/home/canterbury/mambaforge/envs/conan_ros/lib/libpython3.9.so -DPython_EXECUTABLE:PATH=/home/canterbury/mambaforge/envs/conan_ros/bin/python -DPython_ROOT_DIR:PATH=/home/canterbury/mambaforge/envs/conan_ros -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/home/canterbury/mambaforge/envs/conan_ros/include/python3.9 -DPython_NumPy_INCLUDE_DIRS:PATH=/home/canterbury/mambaforge/envs/conan_ros/lib/python3.9/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/home/canterbury/mambaforge/envs/conan_ros/bin/python -DPython3_ROOT_DIR:PATH=/home/canterbury/mambaforge/envs/conan_ros -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/home/canterbury/mambaforge/envs/conan_ros/include/python3.9 -DPython3_NumPy_INCLUDE_DIRS:PATH=/home/canterbury/mambaforge/envs/conan_ros/lib/python3.9/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/home/canterbury/mambaforge/envs/conan_ros/lib/python3.9/site-packages/ninja/data/bin/ninja -DTI_WITH_OPENGL=OFF -DTI_WITH_GGUI=OFF -DTI_VERSION_MAJOR=1 -DTI_VERSION_MINOR=7 -DTI_VERSION_PATCH=0 -DCMAKE_BUILD_TYPE:STRING=Release

@github-project-automation github-project-automation bot moved this to Untriaged in Taichi Lang May 2, 2023
@erizmr erizmr moved this from Untriaged to Todo in Taichi Lang May 5, 2023
@houkensjtu
Copy link
Contributor

Hi @oliver-batchelor ! The warning seems to be related to a mismatch in the following inline assembly code in taichi/runtime/llvm/runtime_module/runtime.cpp

  asm volatile("match.any.sync.b64  %0, %1, %2;"
               : "=r"(ret)
               : "l"(value), "r"(mask));
  return ret;

Please try to change the "l" constraint to "i" and see if the warning resolves. BTW, I found using gcc might cause some weird issues after the compilation, so avoid gcc if you can.

@oliver-batchelor
Copy link
Contributor Author

Thanks! It works like a charm.

@oliver-batchelor
Copy link
Contributor Author

Is this a change which can be committed or will it break other architectures?

@bobcao3
Copy link
Collaborator

bobcao3 commented May 8, 2023

Is this a change which can be committed or will it break other architectures?

You can submit a PR changing this and we can trigger a CI run for you

ailzhang pushed a commit that referenced this issue May 19, 2023
Issue: #7916

### Brief Summary

This was a suggested fix for building taichi on arm64 on a jetson.
@jim19930609 jim19930609 moved this from Todo to Backlog in Taichi Lang May 26, 2023
@KuSunoKiAMe
Copy link

Hello,Did you successfully compile the library under the ARM architecture in the end?

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

No branches or pull requests

4 participants