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

Fix cuda paths for non-default cuda locations #665

Open
wants to merge 2 commits into
base: branch-24.03
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmake/thirdparty/get_legion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ function(find_or_configure_legion)
message(VERBOSE "legate.core: Legion git_branch: ${git_branch}")
message(VERBOSE "legate.core: Legion exclude_from_all: ${exclude_from_all}")

set(ENV{CUDA_BIN_PATH} "${CUDAToolkit_LIBRARY_ROOT}")
rapids_cpm_find(Legion ${version} ${FIND_PKG_ARGS}
CPM_ARGS
${legion_cpm_git_args}
Expand Down Expand Up @@ -200,6 +201,10 @@ function(find_or_configure_legion)
)
endif()

if (NOT CUDA_TOOLKIT_ROOT_DIR STREQUAL CUDAToolkit_LIBRARY_ROOT)
message(FATAL_ERROR "Legion CUDA root ${CUDA_TOOLKIT_ROOT_DIR} differs from Legate's CUDA root ${CUDAToolkit_LIBRARY_ROOT}")
endif()

set(Legion_USE_CUDA ${Legion_USE_CUDA} PARENT_SCOPE)
set(Legion_USE_OpenMP ${Legion_USE_OpenMP} PARENT_SCOPE)
set(Legion_USE_Python ${Legion_USE_Python} PARENT_SCOPE)
Expand Down
20 changes: 19 additions & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import subprocess
import sys
from distutils import sysconfig
from pathlib import Path

# Flush output on newlines
sys.stdout.reconfigure(line_buffering=True)
Expand Down Expand Up @@ -344,6 +345,17 @@ def validate_path(path):
ucx_dir = validate_path(ucx_dir)
thrust_dir = validate_path(thrust_dir)

if cuda_dir is not None:
nvcc_matches = list(Path(cuda_dir).rglob("nvcc"))
if len(nvcc_matches) == 0:
sys.exit(f"No valid nvcc found in root {cuda_dir}")
elif len(nvcc_matches) > 1:
sys.exit(f"Multiple nvcc found in root {cuda_dir}: {nvcc_matches}")

cuda_compiler = nvcc_matches[0]
else:
cuda_compiler = None

if verbose:
print("legate_core_dir: ", legate_core_dir)
print("cuda_dir: ", cuda_dir)
Expand Down Expand Up @@ -454,7 +466,13 @@ def validate_path(path):
if conduit:
cmake_flags += [f"-DGASNet_CONDUIT={conduit}"]
if cuda_dir:
cmake_flags += [f"-DCUDAToolkit_ROOT={cuda_dir}"]
cmake_flags += [
f"-DCUDAToolkit_ROOT={cuda_dir}",
]
if cuda_compiler:
cmake_flags += [
f"-DCMAKE_CUDA_COMPILER={cuda_compiler}",
]
if thrust_dir:
cmake_flags += [f"-DThrust_ROOT={thrust_dir}"]
if legion_dir:
Expand Down