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

[Build] ARM Taichi #8629

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

[Build] ARM Taichi #8629

wants to merge 13 commits into from

Conversation

johnnynunez
Copy link

@johnnynunez johnnynunez commented Feb 1, 2025

Summary
This PR addresses a to build for aarch64 linux.

TaichiWarning: Field index not int32, casting into int32 implicitly
Changes Made
all relationated with packages and update to miniforge. Also owner of vulkan sdk arm.
Rationale
jetson, raspberry pi etc

Testing
Verified that the warning no longer appears when running code that triggers snode_deactivate.

@johnnynunez
Copy link
Author

cc @feisuzhu

This was referenced Feb 2, 2025
@johnnynunez johnnynunez changed the title ARM Taichi [build] ARM Taichi Feb 2, 2025
@johnnynunez johnnynunez changed the title [build] ARM Taichi [Build] ARM Taichi Feb 2, 2025
@johnnynunez
Copy link
Author

Finally is building with CUDA ARM

#!/usr/bin/env bash
set -ex

# Clone the repository if it doesn't exist
git clone --branch=v${TAICHI_VERSION} --depth=1 --recursive https://github.com/johnnynunez/taichi /opt/taichi  || \
git clone --depth=1 --recursive https://github.com/johnnynunez/taichi  /opt/taichi

# Navigate to the Taichi repository directory
cd /opt/taichi
# Apply the inline assembly fix for ARM64 CUDA
sed -i 's/"l"(value)/"r"(value)/g' taichi/runtime/llvm/runtime_module/runtime.cpp
# Optionally, add 'w' modifiers:
sed -i 's/match\.any\.sync\.b64  %0/match\.any\.sync\.b64  %w0/g; s/, %1/, %w1/g; s/, %2/, %w2/g' taichi/runtime/llvm/runtime_module/runtime.cpp


# Download the LLVM installer script and make it executable
wget -q https://apt.llvm.org/llvm.sh
chmod +x llvm.sh

# Create a temporary APT configuration file to force overwrites of conflicting files.
# This tells dpkg to use the "--force-overwrite" option for all apt-get install actions.
echo 'Dpkg::Options {"--force-overwrite";};' > /etc/apt/apt.conf.d/99_force_overwrite

# Run the LLVM installer to install LLVM 15 (with all components)
./llvm.sh 15 all

# (Optional) Remove the temporary APT configuration file if you wish
rm /etc/apt/apt.conf.d/99_force_overwrite

# Create a symbolic link for llvm-config to point to the LLVM 15 version
ln -sf /usr/bin/llvm-config-* /usr/bin/llvm-config

# Set environment variables for the build
export MAX_JOBS=$(nproc)
export TAICHI_CMAKE_ARGS="-DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_CUDA:BOOL=ON"
export CC=/usr/lib/llvm-15/bin/clang
export CXX=/usr/lib/llvm-15/bin/clang++

# Build Taichi
./build.py

# List the generated wheel file(s)
ls dist/*.whl

# Install the built wheel
pip3 install --no-cache-dir --verbose /opt/taichi/dist/*.whl

# Change directory to /opt/taichi (if not already there) and install numpy
cd /opt/taichi
pip3 install 'numpy<2'

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

Successfully merging this pull request may close these issues.

1 participant