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

Develop ANARI #1399

Open
wants to merge 52 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e9c3ecb
[diva] add filter for diva IO
wilsonCernWq Nov 28, 2022
438cf7e
fix bug?
wilsonCernWq Dec 8, 2022
38cc6c6
fix cmake setup deps
wilsonCernWq Dec 10, 2022
268c733
Revert "fix bug?"
wilsonCernWq Dec 10, 2022
b7dfe79
fix continue
wilsonCernWq Dec 10, 2022
d4a0385
cleanup
wilsonCernWq Dec 18, 2022
3252da4
Merge branch 'develop' into diva
wilsonCernWq Dec 18, 2022
f728ac9
Merge branch 'develop' of https://github.com/Alpine-DAV/ascent into diva
wilsonCernWq Jun 12, 2023
768db5b
fix
wilsonCernWq Jun 14, 2023
45c1d11
allow apecifying state/temporary_ghost_fields
wilsonCernWq Jul 4, 2023
c7aa8d3
fix multi-domain temporary ghost fields
wilsonCernWq Jul 4, 2023
fbf355e
Merge branch 'develop' of https://github.com/Alpine-DAV/ascent into diva
Jul 21, 2023
47c6910
fix CUDA cross compilation issues
Jul 21, 2023
a57a918
update build scripts
Jul 22, 2023
be36d80
update script
Jul 25, 2023
ba96f27
add scripts
wilsonCernWq Aug 3, 2023
a8ad53e
Merge commit '816dd8e' into diva
wilsonCernWq Sep 29, 2023
96b617c
a slightly tweaked build script
wilsonCernWq Oct 1, 2023
34a0474
update
wilsonCernWq Oct 4, 2023
4561d31
update build script
wilsonCernWq Nov 17, 2023
151d645
matching diva rendering & profile rendering time
Dec 27, 2023
f3afa68
sync rendering quality
Dec 27, 2023
a0fdec8
Merge branch 'diva' into upstream/develop
wilsonCernWq Feb 22, 2024
4079842
add convert dray volume to a fake anari codepath
wilsonCernWq Feb 27, 2024
e0bb904
fix small bug
wilsonCernWq Feb 27, 2024
5ecfd97
Merge branch 'develop' of https://github.com/Alpine-DAV/ascent into d…
wilsonCernWq Feb 27, 2024
627a2db
very basic anari renderer
wilsonCernWq Feb 28, 2024
fbad54b
cleanup
wilsonCernWq Mar 10, 2024
c0462b8
update for anari
wilsonCernWq Mar 10, 2024
91edbfe
updates for anari
wilsonCernWq Mar 11, 2024
1fb72fb
add surface rendering anari
wilsonCernWq Mar 13, 2024
3721225
glyphs
wilsonCernWq Mar 13, 2024
349b5fb
camera rotation
wilsonCernWq Mar 13, 2024
975cb64
change image format
wilsonCernWq Mar 14, 2024
8290d23
update
wilsonCernWq Mar 16, 2024
e5e514a
update lights
wilsonCernWq Mar 16, 2024
dcb53eb
force transparent background
wilsonCernWq Mar 18, 2024
3863917
update script
Mar 19, 2024
0914d73
cleanup
Mar 23, 2024
9f88fc5
update
Apr 3, 2024
32680d1
update
Apr 4, 2024
a15d977
merge to develop
wilsonCernWq Sep 1, 2024
5d3b6dd
update scripts
wilsonCernWq Sep 1, 2024
e04699d
Merge remote-tracking branch 'upstream/develop' into develop_anari
nicolemarsaglia Oct 14, 2024
bbacd70
build scripts
nicolemarsaglia Oct 14, 2024
38e2fd0
add script changes and setup cmake
nicolemarsaglia Oct 15, 2024
1a05db8
move some stuff, delete some stuff
nicolemarsaglia Oct 18, 2024
40fa304
revert files from forked branch
nicolemarsaglia Oct 18, 2024
0aa0e07
builds but seg faults
nicolemarsaglia Oct 25, 2024
0b2d70e
remove old runtime filters, moved to vtkh/rendering/
nicolemarsaglia Oct 28, 2024
9b270a8
getting output wiht helide device!
nicolemarsaglia Nov 5, 2024
59f6bbf
update before push to branch
nicolemarsaglia Nov 15, 2024
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
81 changes: 64 additions & 17 deletions scripts/build_ascent/build_ascent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ build_raja="${build_raja:=true}"
build_umpire="${build_umpire:=true}"
build_mfem="${build_mfem:=true}"
build_catalyst="${build_catalyst:=false}"
build_anari="${build_anari:=false}"

# ascent options
build_ascent="${build_ascent:=true}"
Expand Down Expand Up @@ -558,10 +559,49 @@ fi # build_kokkos

fi # if enable_hip


################
# anari
################
anari_version=0.10.0
anari_src_dir=$(ospath ${source_dir}/ANARI-SDK-${anari_version})
anari_build_dir=$(ospath ${build_dir}/anari-v${anari_version})
anari_install_dir=$(ospath ${install_dir}/anari-v${anari_version}/)
anari_tarball=$(ospath ${source_dir}/anari-v${anari_version}.tar.gz)

# build only if install doesn't exist
if [ ! -d ${anari_install_dir} ]; then
if ${build_anari}; then
if [ ! -d ${anari_src_dir} ]; then
echo "**** Downloading ${anari_tarball}"
curl -L https://github.com/KhronosGroup/ANARI-SDK/archive/refs/tags/v${anari_version}/anari-v${anari_version}.tar.gz -o ${anari_tarball}
tar ${tar_extra_args} -xzf ${anari_tarball} -C ${source_dir}
fi

echo "**** Configuring anari ${anari_version}"
cmake -S ${anari_src_dir} -B ${anari_build_dir} ${cmake_compiler_settings} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
-DCMAKE_BUILD_TYPE=${build_config} \
-DBUILD_VIEWER=OFF \
-DBUILD_CTS=OFF \
-Danari_BUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=${anari_install_dir} \

echo "**** Building anari ${anari_version}"
cmake --build ${anari_build_dir} --config ${build_config} -j${build_jobs}
echo "**** Installing anari ${anari_version}"
cmake --install ${anari_build_dir} --config ${build_config}

fi
else
echo "**** Skipping anari build, install found at: ${anari_install_dir}"
fi # build_anari


################
# VTK-m
################
vtkm_version=v2.1.0
vtkm_version=v2.2.0
vtkm_src_dir=$(ospath ${source_dir}/vtk-m-${vtkm_version})
vtkm_build_dir=$(ospath ${build_dir}/vtk-m-${vtkm_version})
vtkm_install_dir=$(ospath ${install_dir}/vtk-m-${vtkm_version}/)
Expand All @@ -575,11 +615,6 @@ if [ ! -d ${vtkm_src_dir} ]; then
curl -L https://gitlab.kitware.com/vtk/vtk-m/-/archive/${vtkm_version}/vtk-m-${vtkm_version}.tar.gz -o ${vtkm_tarball}
tar ${tar_extra_args} -xzf ${vtkm_tarball} -C ${source_dir}

# apply vtk-m patch
cd ${vtkm_src_dir}
patch -p1 < ${script_dir}/2023_12_06_vtkm-mr3160-rocthrust-fix.patch
patch -p1 < ${script_dir}/2024_05_03_vtkm-mr3215-ext-geom-fix.patch
patch -p1 < ${script_dir}/2024_07_02_vtkm-mr3246-raysubset_bugfix.patch
cd ${root_dir}
fi

Expand All @@ -603,6 +638,13 @@ if [[ "$enable_mpicc" == "ON" ]]; then
vtkm_extra_cmake_args="${vtkm_extra_cmake_args} -DMPI_CXX_COMPILER=${mpicxx_exe}"
fi

if ${build_anari}; then
vtkm_extra_cmake_args="${vtkm_extra_cmake_args} -DVTKm_ENABLE_ANARI=ON"
vtkm_extra_cmake_args="${vtkm_extra_cmake_args} -DANARI_DIR=$anari_install_dir}"
vtkm_extra_cmake_args="${vtkm_extra_cmake_args} -DCMAKE_PREFIX_PATH=${anari_install_dir}"
fi


echo "**** Configuring VTK-m ${vtkm_version}"
cmake -S ${vtkm_src_dir} -B ${vtkm_build_dir} ${cmake_compiler_settings} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=${enable_verbose}\
Expand Down Expand Up @@ -885,17 +927,17 @@ fi # build_catalyst
# Ascent
################
# if we are in an ascent checkout, use existing source
ascent_checkout_dir=$(ospath ${script_dir}/../../src)
ascent_checkout_dir=$(abs_path ${ascent_checkout_dir})
echo ${ascent_checkout_dir}
if [ -d ${ascent_checkout_dir} ]; then
ascent_version=checkout
ascent_src_dir=$(abs_path ${ascent_checkout_dir})
echo "**** Using existing Ascent source repo checkout: ${ascent_src_dir}"
else
ascent_version=develop
ascent_src_dir=$(ospath ${source_dir}/ascent/src)
fi
#ascent_checkout_dir=$(ospath ${script_dir}/../../src)
#ascent_checkout_dir=$(abs_path ${ascent_checkout_dir})
#echo ${ascent_checkout_dir}
#if [ -d ${ascent_checkout_dir} ]; then
# ascent_version=checkout
# ascent_src_dir=$(abs_path ${ascent_checkout_dir})
# echo "**** Using existing Ascent source repo checkout: ${ascent_src_dir}"
#else
ascent_version=develop_anari
ascent_src_dir=$(ospath ${source_dir}/ascent/src)
#fi

# otherwise use ascent develop
ascent_build_dir=$(ospath ${build_dir}/ascent-${ascent_version}/)
Expand Down Expand Up @@ -970,6 +1012,11 @@ if ${build_catalyst}; then
echo 'set(CATALYST_DIR ' ${catalyst_cmake_dir} ' CACHE PATH "")' >> ${root_dir}/ascent-config.cmake
fi

if ${build_anari}; then
echo 'set(ENABLE_ANARI ON CACHE BOOL "")' >> ${root_dir}/ascent-config.cmake
echo 'set(ANARI_DIR ' ${anari_install_dir}' CACHE PATH "")' >> ${root_dir}/ascent-config.cmake
fi

if [[ "$enable_cuda" == "ON" ]]; then
echo 'set(ENABLE_CUDA ON CACHE BOOL "")' >> ${root_dir}/ascent-config.cmake
echo 'set(CMAKE_CUDA_ARCHITECTURES ' ${CUDA_ARCH} ' CACHE PATH "")' >> ${root_dir}/ascent-config.cmake
Expand Down
21 changes: 21 additions & 0 deletions scripts/build_ascent/build_ascent_anari.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

##############################################################################
# Demonstrates how to manually build Ascent and its dependencies, including:
#
# hdf5, conduit, vtk-m, mfem, raja, anari and umpire
#
# usage example:
# env enable_mpi=ON enable_openmp=ON ./build_ascent.sh
#
#
# Assumes:
# - cmake is in your path
# - selected compilers (including nvcc) are in your path or set via env vars
# - [when enabled] MPI and Python (+numpy and mpi4py), are in your path
#
##############################################################################
set -eu -o pipefail

# 2024-10-14 ANARI support is handled by our unified script
env build_anari=true ./build_ascent.sh
10 changes: 9 additions & 1 deletion scripts/build_ascent/build_ascent_cuda_polaris.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ module load cudatoolkit-standalone
module load craype-x86-milan
module load cray-python

# export http_proxy="http://proxy-01.pub.alcf.anl.gov:3128"
# export https_proxy="http://proxy-01.pub.alcf.anl.gov:3128"
# export ftp_proxy="http://proxy-01.pub.alcf.anl.gov:3128"
# source /home/qiwu/projects/diva_superbuild/setup-env.sh

export CC=$(which cc)
export CXX=$(which CC)
export FTN=$(which ftn)

env enable_python=ON enable_mpi=ON enable_fortran=ON raja_enable_vectorization=OFF enable_tests=OFF ./build_ascent_cuda.sh
# env enable_mpi=ON enable_fortran=ON raja_enable_vectorization=OFF enable_tests=OFF ./build_ascent_cuda.sh
# env enable_mpi=ON enable_fortran=ON raja_enable_vectorization=OFF enable_tests=OFF build_ascent=false ./build_ascent_cuda.sh
# env enable_python=ON enable_mpi=ON enable_fortran=ON raja_enable_vectorization=OFF enable_tests=OFF ./build_ascent_cuda.sh
env enable_python=ON enable_mpi=ON enable_fortran=ON raja_enable_vectorization=OFF enable_tests=OFF build_ascent=false ./build_ascent_cuda.sh
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ option(DRAY_ENABLE_STATS "Enable stats" ON)
option(DRAY_USE_DOUBLE_PRECISION "Build Devil Ray with double precision" OFF)

# VTK-h Specific Options

option(VTKH_ENABLE_FILTER_CONTOUR_TREE "Build VTK-h contour tree support" ON)

# Cuda Specific Options
option(ENABLE_CUDA_DEBUG_CPU_ONLY "Enable CUDA CPU debugging" OFF)

# support ANARI rendering backend
option(ENABLE_ANARI "Build ANARI Support" OFF)

#####################################################
# Note: Third party libs like MFEM, FIDES, etc are
# enabled when you provide MFEM_DIR, etc
Expand Down
10 changes: 10 additions & 0 deletions src/cmake/Setup3rdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ if (GENTEN_DIR)
include(cmake/thirdparty/SetupGenTen.cmake)
endif()

################################
# Setup Catalyst
################################
if (CATALYST_DIR)
include(cmake/thirdparty/SetupCatalyst.cmake)
endif()

################################
# Setup ANARI
################################
if (ANARI_DIR)
include(cmake/thirdparty/SetupANARI.cmake)
endif()
35 changes: 35 additions & 0 deletions src/cmake/thirdparty/SetupANARI.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
###############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other Ascent
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Ascent.
###############################################################################

###############################################################################
# Setup ANARI
###############################################################################

if(NOT ANARI_DIR)
MESSAGE(FATAL_ERROR "ANARI support needs explicit ANARI_DIR")
endif()

MESSAGE(STATUS "Looking for ANARI using ANARI_DIR = ${ANARI_DIR}")

set(ANARI_DIR_ORIG ${ANARI_DIR})
set(ANARI_FOUND TRUE)

file(GLOB ANARI_DIR "${ANARI_DIR}/lib/cmake/anari-*")
if(NOT EXISTS ${ANARI_DIR}/anariConfig.cmake)
MESSAGE(FATAL_ERROR "Could not find ANARI CMake at (${ANARI_DIR}/lib/cmake/anari-*)")
endif()

###############################################################################
# Import ANARI CMake targets
###############################################################################
#find_package(anari REQUIRED)
find_package(anari REQUIRED
NO_DEFAULT_PATH
PATHS ${ANARI_DIR})
if(NOT TARGET vtkm::anari)
message(FATAL_ERROR "vtkm::anari not found, check your VTK-m install")
endif()

29 changes: 29 additions & 0 deletions src/config/ascent_setup_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,35 @@ if(KOKKOS_DIR)
PATHS ${KOKKOS_CMAKE_CONFIG_DIR})
endif()

###############################################################################
# Setup ANARI
###############################################################################
if(NOT ANARI_DIR)
set(ANARI_DIR ${ASCENT_ANARI_DIR})
endif()

if(EXISTS ${ANARI_DIR}/lib64/cmake/Kokkos/)
set(ANARI_CMAKE_CONFIG_DIR ${ANARI_DIR}/lib64/cmake/anari/)
endif()

if(EXISTS ${ANARI_DIR}/lib/cmake/Kokkos/)
set(ANARI_CMAKE_CONFIG_DIR ${ANARI_DIR}/lib/cmake/anari/)
endif()


if(ANARI_DIR)
if(NOT EXISTS ${ANARI_CMAKE_CONFIG_DIR}/anariConfig.cmake)
MESSAGE(FATAL_ERROR "Could not find ANARI CMake include file (${ANARI_CMAKE_CONFIG_DIR}/anariConfig.cmake)")
endif()

###############################################################################
# Import CMake targets
###############################################################################
find_dependency(anari REQUIRED
NO_DEFAULT_PATH
PATHS ${ANARI_CMAKE_CONFIG_DIR})
endif()

###############################################################################
# Setup VTK-m
###############################################################################
Expand Down
27 changes: 19 additions & 8 deletions src/libs/ascent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ set(ASCENT_DRAY_ENABLED ${ENABLE_DRAY})

set(ASCENT_VTKH_ENABLED ${ENABLE_VTKH})
set(ASCENT_VTKM_ENABLED ${VTKM_FOUND})
set(ASCENT_ANARI_ENABLED ${ANARI_FOUND})
set(ASCENT_HDF5_ENABLED ${CONDUIT_RELAY_HDF5_ENABLED})
set(ASCENT_MFEM_ENABLED ${MFEM_FOUND})

Expand Down Expand Up @@ -70,6 +71,7 @@ if(ASCENT_VTKM_ENABLED)
set(ASCENT_VTKM_KOKKOS_ENABLED ${HIP_FOUND})
endif()


# ASCENT_ZZZ_ENTIRES are derived vars.
# We mark them as advanced b/c otherwise folks may see them
# in ccmake or the cmake gui and think they should be changing them
Expand Down Expand Up @@ -101,6 +103,7 @@ mark_as_advanced(ASCENT_INSTALL_PREFIX
ASCENT_VTKM_OPENMP_ENABLED
ASCENT_VTKM_CUDA_ENABLED
ASCENT_VTKM_KOKKOS_ENABLED
ASCENT_ANARI_ENABLED
)

# gen config header
Expand Down Expand Up @@ -337,7 +340,6 @@ if(FORTRAN_FOUND)
endif()



################################
# Add python wrappers if python
# support was selected
Expand All @@ -358,6 +360,13 @@ endif()
##################################
if(CUDA_FOUND)
set_source_files_properties(${ascent_device_sources} PROPERTIES LANGUAGE CUDA)

set(CUDA_ARCH_FLAGS)
foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
list(APPEND CUDA_ARCH_FLAGS --generate-code=arch=compute_${arch},code=sm_${arch})
endforeach()
message(STATUS "CUDA_ARCH_FLAGS: ${CUDA_ARCH_FLAGS}")

endif()

if(HIP_FOUND)
Expand Down Expand Up @@ -431,6 +440,10 @@ if(GENTEN_FOUND)
list(APPEND ascent_thirdparty_libs genten)
endif()

if(ANARI_FOUND)
list(APPEND ascent_thirdparty_libs vtkm::anari)
endif()

##########################################
# Build a serial version of ascent
##########################################
Expand Down Expand Up @@ -498,7 +511,6 @@ if (ENABLE_SERIAL)

# updated for vtkm 1.9
list(APPEND imported_targets_to_link
vtkm::vtkmdiympi_nompi
vtkm::io
vtkm::rendering
vtkm::filter_clean_grid
Expand Down Expand Up @@ -555,11 +567,11 @@ if (ENABLE_SERIAL)
RESULT locations_on_disk)

separate_arguments(params NATIVE_COMMAND "${CMAKE_CUDA_FLAGS} ${locations_on_disk}")
message(STATUS "${CMAKE_CUDA_COMPILER} --device-link ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm.o")
message(STATUS "${CMAKE_CUDA_COMPILER} --device-link ${CUDA_ARCH_FLAGS} ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm.o")

add_custom_command(TARGET ascent PRE_LINK
DEPENDS ascent rover vtkh
COMMAND ${CMAKE_CUDA_COMPILER} --device-link ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm.o
COMMAND ${CMAKE_CUDA_COMPILER} --device-link ${CUDA_ARCH_FLAGS} ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm.o
COMMENT "manual device link step for Ascent"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bcal_vtkm.o DESTINATION lib)
Expand Down Expand Up @@ -679,7 +691,7 @@ if(MPI_FOUND)

# manual device link for CUDA
if(VTKM_FOUND AND CUDA_FOUND AND NOT BUILD_SHARED_LIBS)
set(internal_targets_to_link $<TARGET_FILE:rover>)
set(internal_targets_to_link $<TARGET_FILE:rover_mpi>)

if(ENABLE_VTKH)
list(APPEND internal_targets_to_link
Expand All @@ -699,7 +711,6 @@ if(MPI_FOUND)

# updated for vtkm 1.9
list(APPEND imported_targets_to_link
vtkm::vtkmdiympi_nompi
vtkm::io
vtkm::rendering
vtkm::filter_clean_grid
Expand Down Expand Up @@ -756,10 +767,10 @@ if(MPI_FOUND)
RESULT locations_on_disk)

separate_arguments(params NATIVE_COMMAND "${CMAKE_CUDA_FLAGS} ${locations_on_disk}")
message(STATUS "${CMAKE_CUDA_COMPILER} --device-link ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm_mpi.o")
message(STATUS "${CMAKE_CUDA_COMPILER} --device-link ${CUDA_ARCH_FLAGS} ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm_mpi.o")
add_custom_command(TARGET ascent_mpi PRE_LINK
DEPENDS ascent_mpi rover_mpi
COMMAND ${CMAKE_CUDA_COMPILER} --device-link ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm_mpi.o
COMMAND ${CMAKE_CUDA_COMPILER} --device-link ${CUDA_ARCH_FLAGS} ${params} -lcudadevrt -lcudart_static --output-file bcal_vtkm_mpi.o
COMMENT "manual device link step for Ascent parallel"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bcal_vtkm_mpi.o DESTINATION lib)
Expand Down
1 change: 1 addition & 0 deletions src/libs/ascent/ascent_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#cmakedefine ASCENT_RAJA_ENABLED "@RAJA_FOUND@"

#cmakedefine ASCENT_VTKM_ENABLED "@VTKM_FOUND@"
#cmakedefine ASCENT_ANARI_ENABLED "@ANARI_FOUND@"

#cmakedefine ASCENT_VTKM_OPENMP_ENABLED "@OPENMP_FOUND@"
#cmakedefine ASCENT_VTKM_CUDA_ENABLED "@CUDA_FOUND@"
Expand Down
Loading
Loading