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 cross compile environment (build on x86, run on aarch64 + GPU) to test MG C++ BFS performance #4953

Closed
wants to merge 1 commit into from

Conversation

seunghwak
Copy link
Contributor

Just for archival purpose, will be closed immediately.

  1. Install cross compilers

gcc-aarch64-linux-gnu
g++-aarch64-linux-gnu
gfortran-aarch64-linux-gnu (maybe unnecessary)

  1. Install CUDA toolkit for cross compile.
Screenshot 2025-02-28 at 11 21 45 AM

Note that this is in-addition to the existing CUDA toolkit. Once installed, you will see new directories with sbsa-linux (e.g. /usr/local/cuda-12.8/targets/sbsa-linux).

  1. Set-up a minimal conda environment (minimal_cuda-128_arch_cross_linux-aarch64.yaml). Note that the purpose of this PR is to just run MG C++ BFS tests. No need to install any packages to run python libraries.

Then, install NCCL for aarch64 to the minimal conda environment.

CONDA_SUBDIR=linux-aarch64 conda install -c conda-forge nccl

  1. Build librapids_logger.so for aarch64.
git clone https://github.com/rapidsai/rapids-logger
cd rapids-logger
mkdir build
cd build
cmake .. -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_CUDA_HOST_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -G Ninja
ninja

Copy librapids_logger.so to the lib directory of the minimal conda environment.

  1. Build OpenMPI for cross-compile
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++
export FC=aarch64-linux-gnu-gfortran (maybe unnecessary)
./configure --host=aarch64-linux-gnu --build=x86_64-linux-gnu --prefix=/home/seunghwak/Programs/openmpi-aarch64 --disable-mpi-fortran --enable-script-wrapper-compilers
make
make install

Update MPI_ROOT in the tests/CMakeLists.txt file to use this MPI.

    set(MPI_ROOT "/home/seunghwak/Programs/openmpi-aarch64")
    set(MPI_CXX_COMPILER /home/seunghwak/Programs/openmpi-aarch64/bin/mpic++)
  1. Build cugraph on x86 for aarch64.
cmake .. -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_CUDA_HOST_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.8/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=100 -DBUILD_TESTS=ON -DUSE_RAFT_STATIC=OFF -DCUGRAPH_COMPILE_RAFT_LIB=OFF -DBUILD_CUGRAPH_MG_TESTS=ON -DBUILD_CUGRAPH_MTMG_TESTS=OFF -G Ninja
  1. Copy the libcugraph.so and MG_BFS_TEST to the target system.

Copy link

copy-pr-bot bot commented Feb 28, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

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

Successfully merging this pull request may close these issues.

1 participant