Skip to content

update CUDA Makefile#31

Open
yuxuan-z19 wants to merge 1 commit intollnl:2.0.2-devfrom
yuxuan-z19:zyx-fix-cuda
Open

update CUDA Makefile#31
yuxuan-z19 wants to merge 1 commit intollnl:2.0.2-devfrom
yuxuan-z19:zyx-fix-cuda

Conversation

@yuxuan-z19
Copy link

Purpose

This pull request fixes the CUDA build system so that LULESH can be reliably built using modern NVCC and MPI toolchains. The previous Makefile had several issues that prevented correct compilation and linking when CUDA and MPI were used together.

Summary of Changes

  • Reworked the CUDA Makefile to correctly handle:
    • MPI include and link flags obtained from mpicxx --showme:compile and --showme:link
    • NVCC host compiler linking behavior
    • Automatic detection of all *.cu source files
  • Ensured that NVCC performs the final link step instead of mpicxx, avoiding missing CUDA runtime symbols.
  • Made the Makefile compatible with out-of-tree builds (e.g., build/ directory) by using relative paths and pattern rules.

Result

The project now builds successfully using:

cd cuda/build
make
mpirun -np 8 ./lulesh -s 90 -i 3145

Tested on 8 * NVIDIA RTX 4090 with:

  • Ubuntu 22.04 LTS
  • CUDA 12.2.91
  • OpenMPI 4.1.6

Notes

This PR does not modify application behavior or CUDA kernels, only the build system.

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