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

failed build from source on NVIDIA Jetson AGX Xavier (ARM64) #6787

Closed
tmxklzp opened this issue Dec 1, 2022 · 6 comments
Closed

failed build from source on NVIDIA Jetson AGX Xavier (ARM64) #6787

tmxklzp opened this issue Dec 1, 2022 · 6 comments
Labels
potential bug Something that looks like a bug but not yet confirmed

Comments

@tmxklzp
Copy link

tmxklzp commented Dec 1, 2022

Describe the bug
Build from source on NVIDIA AGX Xavier TX2 (ARM64)
Ubuntu Ubuntu 18.04.6 LTS
CUDA 10.2
Python 3.8.15
cmake 3.20.5

CPU version of Jetson AGX Xavier is aarch64:

~$ uname -a
Linux surgicalai-xavier 4.9.201-tegra #1 SMP PREEMPT Fri Feb 19 08:42:04 PST 2021 aarch64 aarch64 aarch64 GNU/Linux

Error Log
when I followed https://docs.taichi-lang.org/docs/dev_install and this step errored:
Build Taichi from source

python3 setup.py develop --user

log:

[447/620] cd /home/build/taichi/taichi...+17 -D ARCH_cuda -I /home/build/taichi
FAILED: taichi/runtime/llvm/runtime_module/CMakeFiles/generate_llvm_runtime_cuda 
cd /home/build/taichi/taichi/runtime/llvm/runtime_module && /usr/bin/clang++-10 -c runtime.cpp -o runtime_cuda.bc -fno-exceptions -emit-llvm -std=c++17 -D ARCH_cuda -I /home/build/taichi
runtime.cpp:1121:23: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
               : "=r"(ret)
                      ^
runtime.cpp:1120:37: note: use constraint modifier "w"
  asm volatile("match.all.sync.b32  %0, %1, %2;"
                                    ^~
                                    %w0
runtime.cpp:1122:22: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
               : "r"(value), "r"(mask));
                     ^
runtime.cpp:1120:41: note: use constraint modifier "w"
  asm volatile("match.all.sync.b32  %0, %1, %2;"
                                        ^~
                                        %w1
runtime.cpp:1122:34: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
               : "r"(value), "r"(mask));
                                 ^
runtime.cpp:1120:45: note: use constraint modifier "w"
  asm volatile("match.all.sync.b32  %0, %1, %2;"
                                            ^~
                                            %w2
runtime.cpp:1134:18: error: invalid input constraint 'l' in asm
               : "l"(value), "r"(mask));
                 ^
runtime.cpp:1144: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:1144:32: note: use constraint modifier "w"
  asm volatile("activemask.b32 %0;" : "=r"(mask));
                               ^~
                               %w0
4 warnings and 1 error generated.

cmake arguments:

TAICHI_CMAKE_ARGS="-DTI_WITH_CUDA:BOOL=ON -DTI_WITH_LLVM:BOOL=ON -DTI_WITH_C_API:BOOL=ON "

and this command triggered error with same output:

cd /home/build/taichi/taichi/runtime/llvm/runtime_module && /usr/bin/clang++-10 -c runtime.cpp -o runtime_cuda.bc -fno-exceptions -emit-llvm -std=c++17 -D ARCH_cuda -I /home/build/taichi
@tmxklzp tmxklzp added the potential bug Something that looks like a bug but not yet confirmed label Dec 1, 2022
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Dec 1, 2022
@tmxklzp
Copy link
Author

tmxklzp commented Dec 1, 2022

the error is throwed by this snippet:
~/taichi/taichi/runtime/llvm/runtime_module/runtime.cpp
L1129:

uint32 cuda_match_any_sync_i64(u32 mask, i64 value) {
#if ARCH_cuda
  u32 ret;
  asm volatile("match.any.sync.b64  %0, %1, %2;"
               : "=r"(ret)
               : "l"(value), "r"(mask));
  return ret;
#else
  return 0;
#endif
}

can I annotate this if condition and remain the "return 0;"?

@ailzhang
Copy link
Contributor

ailzhang commented Dec 1, 2022

@tmxklzp Hi, these warnings about register size can be suppressed following the suggestions by clang (adding w which means word register). You can find more details in https://stackoverflow.com/questions/54979550/value-size-does-not-match-register-size-specified-by-the-constraint-and-modifier. ;)
You're more than welcome to send a PR to fix it in taichi!

@tmxklzp
Copy link
Author

tmxklzp commented Dec 1, 2022

@ailzhang Okay I'll check this answer about word register, but there is an error 1134:18: error: invalid input constraint 'l' in asm and this caused the failure of the building process(sorry I haven't paste all Cmake logs earlier):

runtime.cpp:1134:18: error: invalid input constraint 'l' in asm
               : "l"(value), "r"(mask));
                 ^
runtime.cpp:1144: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:1144:32: note: use constraint modifier "w"
  asm volatile("activemask.b32 %0;" : "=r"(mask));
                               ^~
                               %w0
4 warnings and 1 error generated.
[450/620] Building C object taichi/rhi/opengl/C...pengl_rhi.dir/__/__/__/external/glad/src/gl.c.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/username/.local/lib/python3.8/site-packages/skbuild/setuptools_wrap.py", line 640, in setup
    cmkr.make(make_args, install_target=cmake_install_target, env=env)
  File "/home/username/.local/lib/python3.8/site-packages/skbuild/cmaker.py", line 670, in make
    self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
  File "/home/username/.local/lib/python3.8/site-packages/skbuild/cmaker.py", line 701, in make_impl
    raise SKBuildError(

An error occurred while building with CMake.
  Command:
    cmake --build . --target install --config Release -- -j8
  Install target:
    install
  Source directory:
    /home/username/taichi
  Working directory:
    /home/username/taichi/_skbuild/linux-aarch64-3.8/cmake-build
Please check the install target is valid and see CMake's output for more information.

@ailzhang
Copy link
Contributor

ailzhang commented Dec 1, 2022

that constraint might be x86 specific, try replacing it with "i"?

@tmxklzp
Copy link
Author

tmxklzp commented Dec 1, 2022

@ailzhang yes I changed by "i" and it successly build! Thank you for your support. I'll check other warnings and try to make a PR to taichi

@tmxklzp tmxklzp closed this as completed Dec 2, 2022
Repository owner moved this from Untriaged to Done in Taichi Lang Dec 2, 2022
@johnnynunez
Copy link

@ailzhang @feisuzhu do you fix this permanently?
Digits, cuda arm laptops and jetson thor are coming #8629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
Status: Done
Development

No branches or pull requests

3 participants