diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63e0c86..451f085 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,155 +1,168 @@ name: CI +env: + DEBIAN_FRONTEND: noninteractive + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" + on: push: - branches: - - master - - main - - public + branches: [main, master, public] pull_request: - branches: - - master - - main - - public - -jobs: + branches: [main, master, public] - build_linux: - name: Build on Linux Systems - - runs-on: ${{ matrix.os }} +concurrency: + group: ${{ github.workflow }}:${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +jobs: + build-linux: + name: linux (CUDA ${{ matrix.cuda_version }} Ubuntu ${{ matrix.ubuntu_version }} OSPRay ${{ matrix.ospray_mode }}) + runs-on: ubuntu-${{ matrix.ubuntu_version }} strategy: + fail-fast: false matrix: include: - - os: ubuntu-20.04 - arch: 86 - cuda: "11.3" - optix: "7.3.0" - ospray: "2.5.0" - - os: ubuntu-20.04 - arch: 75 - cuda: "11.3" - optix: "7.3.0" - ospray: "2.5.0" - + - cuda_version: "11.8.0" + ubuntu_version: "22.04" + arch: "86" + ospray_mode: fetchcontent + - cuda_version: "11.8.0" + ubuntu_version: "22.04" + arch: "86" + ospray_mode: external + - cuda_version: "12.8.1" + ubuntu_version: "24.04" + arch: "86" + ospray_mode: fetchcontent + - cuda_version: "12.8.1" + ubuntu_version: "24.04" + arch: "86" + ospray_mode: external env: - build_dir: "build" - config: "Release" - GDT_CUDA_ARCHITECTURES: ${{ matrix.arch }} + BUILD_DIR: build + CONFIG: Release steps: - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install cmake gcc g++ libtbb-dev libglfw3-dev xorg-dev - - # - name: Add gitlab.com into known_hosts - # run: mkdir -p ~/.ssh && ssh-keyscan -H gitlab.com > ~/.ssh/known_hosts - # shell: bash + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: true + + - uses: actions/checkout@v4 + with: + submodules: recursive - - uses: actions/checkout@v2 + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + gcc \ + g++ \ + libtbb-dev \ + libglfw3-dev \ + xorg-dev \ + wget + + - name: Install CUDA toolkit + uses: Jimver/cuda-toolkit@v0.2.34 + id: cuda-toolkit with: - # ssh-key: ${{ secrets.SUBMODULE_CONTENT_PULL_KEY }} - submodules: 'recursive' - # ssh-known-hosts: '' + cuda: ${{ matrix.cuda_version }} + method: network - - name: Install OptiX + - name: Install external OSPRay archive + if: matrix.ospray_mode == 'external' shell: bash - working-directory: github-actions - env: - optix: ${{ matrix.optix }} - run: bash ./optix-cmake-github-actions/install_optix.sh + run: | + OSPRAY_URL="https://github.com/wilsonCernWq/ospray/releases/download/sparse_sampling_v2.11.0/ospray-2.11.0.x86_64.linux_sparse_sampling.tar.gz" + OSPRAY_ROOT="$RUNNER_TEMP/ospray-2.11.0.x86_64.linux_sparse_sampling" - - name: Install OSPRay - shell: bash - working-directory: github-actions - env: - ospray: ${{ matrix.ospray }} - run: bash ./ospray-cmake-github-actions/install_ospray_ubuntu.sh + wget -O "$RUNNER_TEMP/ospray.tar.gz" "$OSPRAY_URL" + tar -xzf "$RUNNER_TEMP/ospray.tar.gz" -C "$RUNNER_TEMP" - - name: Install CUDA + echo "OSPRAY_DIR=$OSPRAY_ROOT/lib/cmake/ospray-2.11.0" >> "$GITHUB_ENV" + + - name: Configure shell: bash - working-directory: github-actions - run: bash ./cuda-cmake-github-actions/scripts/actions/install_cuda_ubuntu.sh - env: - cuda: ${{ matrix.cuda }} - - - name: CMake - env: - OptiX_INSTALL_DIR: ${{ env.OptiX_INSTALL_DIR }} - run: cmake . -B ${{ env.build_dir }} - -DCMAKE_BUILD_TYPE=${{ env.config }} - -DOVR_BUILD_DEVICE_OPTIX7=ON - -DOVR_BUILD_DEVICE_OSPRAY=ON - -Dospray_DIR=${{ env.OSPRAY_CMAKE_DIR }} - -DGDT_CUDA_ARCHITECTURES=${{ matrix.arch }} + run: | + CMAKE_ARGS=( + -DCMAKE_BUILD_TYPE="${CONFIG}" + -DOVR_BUILD_DEVICE_OPTIX7=ON + -DOVR_BUILD_DEVICE_OSPRAY=ON + -DCMAKE_CUDA_ARCHITECTURES="${{ matrix.arch }}" + ) + + if [[ "${{ matrix.ospray_mode }}" == "external" ]]; then + CMAKE_ARGS+=("-Dospray_DIR=${OSPRAY_DIR}") + fi + + cmake -S . -B "${BUILD_DIR}" "${CMAKE_ARGS[@]}" - name: Build - working-directory: ${{ env.build_dir }} - run: cmake --build . --target all --verbose -j `nproc` + run: cmake --build "${BUILD_DIR}" --target all --verbose -j"$(nproc)" - build_windows: - name: Build on Windows - runs-on: ${{ matrix.os }} + build-windows: + name: windows (CUDA ${{ matrix.cuda_version }}) + runs-on: windows-latest strategy: + fail-fast: false matrix: include: - - os: windows-2019 - visual_studio: "Visual Studio 16 2019" - cuda: "11.5.1" - optix: "7.3.0" - ospray: "2.5.0" - arch: 86 - - os: windows-2019 - visual_studio: "Visual Studio 16 2019" - cuda: "11.5.1" - optix: "7.3.0" - ospray: "2.5.0" - arch: 75 - + - cuda_version: "12.8.1" + arch: "86" env: - build_dir: "build" - config: "Release" - GDT_CUDA_ARCHITECTURES: ${{ matrix.arch }} + BUILD_DIR: build + CONFIG: Release steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive - - name: Install OptiX - shell: powershell - working-directory: github-actions - run: .\optix-cmake-github-actions\install_optix.ps1 - env: - optix: ${{ matrix.optix }} - - - name: Install OSPRay - shell: powershell - working-directory: github-actions - run: .\ospray-cmake-github-actions\install_ospray_windows.ps1 - env: - ospray: ${{ matrix.ospray }} - - - name: Install CUDA - shell: powershell - working-directory: github-actions - run: .\cuda-cmake-github-actions\scripts\actions\install_cuda_windows.ps1 - env: - cuda: ${{ matrix.cuda }} - visual_studio: ${{ matrix.visual_studio }} - - - name: CMake - env: - OptiX_INSTALL_DIR: ${{ env.OptiX_INSTALL_DIR }} - run: cmake . -B ${{ env.build_dir }} - -G "${{ matrix.visual_studio }}" -A x64 - -DCMAKE_BUILD_TYPE=${{ env.config }} - -DOVR_BUILD_DEVICE_OPTIX7=ON - -DOVR_BUILD_DEVICE_OSPRAY=ON - -Dospray_DIR=${{ env.OSPRAY_CMAKE_DIR }} - -DTBB_DIR=${{ env.TBB_CMAKE_DIR }} - -DGDT_CUDA_ARCHITECTURES=${{ matrix.arch }} + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + - name: Install oneTBB + shell: pwsh + run: | + $tbbVersion = "2021.9.0" + $tbbArchive = Join-Path $env:RUNNER_TEMP "oneapi-tbb-win.zip" + $tbbRoot = Join-Path $env:RUNNER_TEMP "oneapi-tbb-$tbbVersion" + + Invoke-WebRequest -Uri "https://github.com/oneapi-src/oneTBB/releases/download/v$tbbVersion/oneapi-tbb-$tbbVersion-win.zip" -OutFile $tbbArchive + Expand-Archive -Path $tbbArchive -DestinationPath $env:RUNNER_TEMP -Force + + "TBB_DIR=$tbbRoot/lib/cmake/tbb" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Install CUDA toolkit + uses: Jimver/cuda-toolkit@v0.2.34 + id: cuda-toolkit + with: + cuda: ${{ matrix.cuda_version }} + method: network + + - name: Configure + shell: pwsh + run: | + $cmakeArgs = @( + "-S", ".", + "-B", $env:BUILD_DIR, + "-DCMAKE_BUILD_TYPE=$env:CONFIG", + "-DOVR_BUILD_DEVICE_OPTIX7=ON", + "-DOVR_BUILD_DEVICE_OSPRAY=ON", + "-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.arch }}", + "-DTBB_DIR=$env:TBB_DIR" + ) + cmake @cmakeArgs - name: Build - working-directory: ${{ env.build_dir }} - run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose + shell: pwsh + run: cmake --build $env:BUILD_DIR --config $env:CONFIG --target ALL_BUILD --verbose diff --git a/.gitignore b/.gitignore index a1d60a2..697c49e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ projects/ *.obj *.mpi *.raw + +CLAUDE.md + +__pycache__/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index c9eb5ae..d07172e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,3 @@ [submodule "github-actions"] path = github-actions url = https://github.com/wilsonCernWq/github-workflow-collections.git -[submodule "extern/imgui/implot"] - path = extern/imgui/implot - url = https://github.com/epezent/implot.git -[submodule "extern/imgui/imgui"] - path = extern/imgui/imgui - url = https://github.com/ocornut/imgui.git -[submodule "extern/pybind11"] - path = extern/pybind11 - url = https://github.com/pybind/pybind11.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f4d169..fe58a8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,164 +27,93 @@ if (POLICY CMP0135) cmake_policy(SET CMP0135 NEW) endif (POLICY CMP0135) - cmake_minimum_required(VERSION 3.18) -project(OpenVisRenderer LANGUAGES C CXX CUDA) - +project(OpenVisRenderer LANGUAGES C CXX) -option(OVR_BUILD_OPENGL "Build with OpenGL Apps" ON) -option(OVR_BUILD_CUDA "Build with CUDA" ON) +include(GNUInstallDirs) -option(OVR_BUILD_DEVICE_OPTIX7 "Build OptiX7 Device" ON) -option(OVR_BUILD_DEVICE_OSPRAY "Build OSPRay Device" OFF) -option(OVR_BUILD_SCENE_USD "Build USDA Scene Reader" OFF) - -option(OVR_BUILD_PYTHON_BINDINGS "Build Python Bindings" OFF) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/extern") -############################################################################### -# Python setup -############################################################################### -if(OVR_BUILD_PYTHON_BINDINGS) - # Find where `python` is by executing command `which python` - execute_process( - COMMAND "which" "python" OUTPUT_VARIABLE PYTHON_EXECUTABLE - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if("${PYTHON_EXECUTABLE}" STREQUAL "") - message(FATAL_ERROR "Python not found") - else() - message(STATUS "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") - endif() - # # Check if CXX11 ABI should be enabled. Must match Python. - # execute_process( - # COMMAND "${PYTHON_EXECUTABLE}" -c - # "import torch; print(torch._C._GLIBCXX_USE_CXX11_ABI)" - # OUTPUT_VARIABLE PYTHON_GLIBCXX_USE_CXX11_ABI - # OUTPUT_STRIP_TRAILING_WHITESPACE - # ) - # if(PYTHON_GLIBCXX_USE_CXX11_ABI STREQUAL "True") - # add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) - # else() - # add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) - # endif() +# `OVR_INSTALL_INCLUDEDIR` is the include root encoded into installed/exported +# OVR interface targets. Standalone OVR defaults to GNUInstallDirs' include +# directory, while parent projects embedding OVR may override it before calling +# `add_subdirectory(base)` if they install OVR headers into a package-specific +# subtree such as `include/`. +if(NOT DEFINED OVR_INSTALL_INCLUDEDIR) + set(OVR_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") endif() -# ------------------------------------------------------------------ -# toggles -# ------------------------------------------------------------------ - +option(OVR_BUILD_DEVICE_OPTIX7 "Build OptiX7 Device" ON) +option(OVR_BUILD_DEVICE_OSPRAY "Build OSPRay Device" ON) if(OVR_BUILD_DEVICE_OPTIX7) set(OVR_BUILD_OPTIX7 TRUE) endif() - if(OVR_BUILD_DEVICE_OSPRAY) set(OVR_BUILD_OSPRAY TRUE) endif() -# force to pull subdirectories, credit to Nate :) -find_package(Git) -set(WORKDIR ${CMAKE_CURRENT_SOURCE_DIR}) -if(GIT_FOUND AND IS_DIRECTORY "${WORKDIR}/.git") - option(GIT_SUBMODULE "Check submodules during build" ON) - if(GIT_SUBMODULE) - message(STATUS "Submodule update") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY ${WORKDIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) - if(NOT GIT_SUBMOD_RESULT EQUAL 0) - message(FATAL_ERROR "'git submodule update --init --recursive' failed with \ - ${GIT_SUBMOD_RESULT}, please checkout submodules") - endif() - endif() -endif() - -# ------------------------------------------------------------------ -# configure -# ------------------------------------------------------------------ - -# set library output path -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +############################################################################### +# Setup Repositories +############################################################################### +include(configure_build_type) +include(configure_cxx) -if(APPLE) # MacOS is not supported ... - set(CMAKE_MACOSX_RPATH ON) +option(OVR_BUILD_CUDA "Build with CUDA" ON) +if(OVR_BUILD_CUDA) + include(configure_cuda) endif() -if(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP24") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") -else() - # if(BUILD_SHARED_LIBS) - # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - # set(CMAKE_POSITION_INDEPENDENT_CODE ON) - # endif() +if(OVR_BUILD_OPTIX7) + include(configure_optix) endif() -# if(NOT WIN32) -# # visual studio doesn't like these (not need them): -# set(CMAKE_CXX_FLAGS "--std=c++17") -# set(CUDA_PROPAGATE_HOST_FLAGS ON) -# endif() -# if(UNIX) -# set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# endif() -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CUDA_STANDARD 17) -set(CMAKE_CUDA_STANDARD_REQUIRED ON) -set(CMAKE_CUDA_EXTENSIONS OFF) -set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC) +# Core Math Library +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/gdt) -if (MSVC) - list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-bigobj") -else() - list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-mf16c") - list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-Wno-float-conversion") - list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-fno-strict-aliasing") - # if(BUILD_SHARED_LIBS) - # list(APPEND CUDA_NVCC_FLAGS "-fPIC") - # endif() +# Other Libraries +include(configure_oneapi) +include(dep_opengl) +include(dep_usd) +find_package(Threads REQUIRED) +# find_package(OpenMP REQUIRED) + +############################################################################### +# Python setup +############################################################################### +option(OVR_BUILD_PYTHON_BINDINGS "Build Python Bindings" OFF) +if(OVR_BUILD_PYTHON_BINDINGS) + include(configure_python) endif() -list(APPEND CUDA_NVCC_FLAGS "--extended-lambda") -list(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr") -list(APPEND CUDA_NVCC_FLAGS "-U__CUDA_NO_HALF_OPERATORS__") -list(APPEND CUDA_NVCC_FLAGS "-U__CUDA_NO_HALF_CONVERSIONS__") -list(APPEND CUDA_NVCC_FLAGS "-U__CUDA_NO_HALF2_OPERATORS__") -if(OVR_BUILD_CUDA) - # adapted from https://stackoverflow.com/a/69353718 - find_package(CUDA REQUIRED) - # enable_language(CUDA) +############################################################################### +# Application build +############################################################################### +option(OVR_BUILD_APPS "Build OVR application executables" ON) - if(DEFINED GDT_CUDA_ARCHITECTURES) - message(STATUS "Obtained target architecture from environment variable GDT_CUDA_ARCHITECTURES=${GDT_CUDA_ARCHITECTURES}") - set(CMAKE_CUDA_ARCHITECTURES ${GDT_CUDA_ARCHITECTURES}) - endif() +############################################################################### +# OpenGL Shader Encoder +############################################################################### +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/extern/bin2c EXCLUDE_FROM_ALL) +include(${CMAKE_CURRENT_LIST_DIR}/extern/bin2c/target_add_embeded_shaders.cmake) - if(NOT CMAKE_CUDA_ARCHITECTURES) - include(FindCUDA/select_compute_arch) - CUDA_DETECT_INSTALLED_GPUS(INSTALLED_GPU_CCS_1) - string(STRIP "${INSTALLED_GPU_CCS_1}" INSTALLED_GPU_CCS_2) - string(REPLACE " " ";" INSTALLED_GPU_CCS_3 "${INSTALLED_GPU_CCS_2}") - string(REPLACE "." "" CUDA_ARCH_LIST "${INSTALLED_GPU_CCS_3}") - set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH_LIST}) - message(STATUS "Automatically detected GPU architectures: ${CMAKE_CUDA_ARCHITECTURES}") - endif() - - # we can only enable CUDA if CMAKE_CUDA_ARCHITECTURES is set - if (CMAKE_CUDA_ARCHITECTURES) - enable_language(CUDA) - else() - message(FATAL_ERROR "Cannot utomatically detected GPU architecture") - endif() +############################################################################### +# Transfer Function Module +############################################################################### +set(TFNMODULE_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/extern/tfn/colormaps) +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/extern/tfn/colormaps) +add_library(tfnmodule STATIC ${embedded_colormap}) +target_include_directories(tfnmodule PUBLIC + $ +) +if (UNIX) + set_target_properties(tfnmodule PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() -include(extern/configure.cmake) - add_subdirectory(ovr) -add_subdirectory(apps) +if(OVR_BUILD_APPS) + add_subdirectory(apps) +endif() add_subdirectory(projects) -add_subdirectory(python) +if(OVR_BUILD_PYTHON_BINDINGS) + add_subdirectory(python) +endif() diff --git a/README.md b/README.md index 2acb0cc..fa62a5b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/wilsonCernWq/open-volume-renderer/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/wilsonCernWq/open-volume-renderer/actions/workflows/main.yml) -![Expected Rendering Result](./data/example.png) +![Expected Rendering Result](./data/example.jpg) ## TODO List @@ -84,6 +84,35 @@ Detailed steps below: cmake --build . ``` +## Installing and Embedding + +OVR uses a generic CMake variable, `OVR_INSTALL_INCLUDEDIR`, to describe the +include root that should be encoded into installed/exported OVR interface +targets. + +- When OVR is configured standalone, `base/CMakeLists.txt` includes + `GNUInstallDirs` and defaults `OVR_INSTALL_INCLUDEDIR` to + `${CMAKE_INSTALL_INCLUDEDIR}` (normally `include`). +- When OVR is embedded as a subdirectory of a parent project, the parent may + override `OVR_INSTALL_INCLUDEDIR` before `add_subdirectory(base)` if OVR's + public headers should live under a package-specific subtree such as + `include/instantvnr`. +- This variable only controls the installed/exported include interface. OVR's + build interface intentionally stays rooted in the OVR source tree so the base + repository does not depend on parent-specific path conventions. + +Example parent-project override: + +```cmake +include(GNUInstallDirs) +set(OVR_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/instantvnr") +add_subdirectory(base) +``` + +Use plain `${CMAKE_INSTALL_INCLUDEDIR}` when you want OVR headers installed +directly under the global include root, and override `OVR_INSTALL_INCLUDEDIR` +only when the parent package intentionally nests them under its own prefix. + ## Running - On Linux: diff --git a/extern/gdt/cmake/FindOptiX.cmake b/cmake/FindOptiX.cmake similarity index 87% rename from extern/gdt/cmake/FindOptiX.cmake rename to cmake/FindOptiX.cmake index 6909d4d..1eff8da 100644 --- a/extern/gdt/cmake/FindOptiX.cmake +++ b/cmake/FindOptiX.cmake @@ -25,8 +25,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) # Locate the OptiX distribution. Search relative to the SDK first, then look in the system. +# Note: OptiX_INSTALL_DIR and OptiX_ROOT_DIR are expected to be set before this file is +# included (e.g. by configure_optix.cmake via FetchContent of optix-dev, or by the user). # Our initial guess will be within the SDK. if(NOT DEFINED OptiX_INSTALL_DIR) @@ -96,3 +100,10 @@ if (NOT TARGET OptiX::optix7) target_include_directories(OptiX::optix7 INTERFACE ${OptiX_INCLUDE}) target_compile_definitions(OptiX::optix7 INTERFACE ENABLE_OPTIX) endif() + +# owl's CMakeLists.txt links against OptiX::OptiX; provide it as an alias +if (NOT TARGET OptiX::OptiX) + add_library(OptiX::OptiX INTERFACE IMPORTED) + target_include_directories(OptiX::OptiX INTERFACE ${OptiX_INCLUDE}) + target_compile_definitions(OptiX::OptiX INTERFACE ENABLE_OPTIX) +endif() diff --git a/extern/gdt/cmake/configure_build_type.cmake b/cmake/configure_build_type.cmake similarity index 52% rename from extern/gdt/cmake/configure_build_type.cmake rename to cmake/configure_build_type.cmake index 31ac57b..8bbdd9a 100644 --- a/extern/gdt/cmake/configure_build_type.cmake +++ b/cmake/configure_build_type.cmake @@ -13,11 +13,64 @@ # See the License for the specific language governing permissions and # # limitations under the License. # # ======================================================================== # +# ======================================================================== # +# Copyright 2020 - 2026 Qi Wu # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # + +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) # This helper script sets up default build targets for Release/Debug, etc, # something which each project I worked on seems to need, eventually, so # having it in one place arguably makes sense. +############################################################################### +# Configure +############################################################################### + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + +# set library output path +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +if(APPLE) # MacOS is not supported ... + set(CMAKE_MACOSX_RPATH ON) +endif() +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP24") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") +else() + # if(BUILD_SHARED_LIBS) + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + # set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # endif() +endif() +# if(NOT WIN32) +# # visual studio doesn't like these (not need them): +# set(CMAKE_CXX_FLAGS "--std=c++17") +# set(CUDA_PROPAGATE_HOST_FLAGS ON) +# endif() +# if(UNIX) +# set(CMAKE_POSITION_INDEPENDENT_CODE ON) +# endif() + if(NOT SET_UP_CONFIGURATIONS_DONE) set(SET_UP_CONFIGURATIONS_DONE 1) diff --git a/cmake/configure_cuda.cmake b/cmake/configure_cuda.cmake new file mode 100644 index 0000000..a9140ca --- /dev/null +++ b/cmake/configure_cuda.cmake @@ -0,0 +1,70 @@ +# ======================================================================== # +# Copyright 2018 Ingo Wald # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # +# ======================================================================== # +# Copyright 2019 - 2026 Qi Wu # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + +find_package(CUDAToolkit REQUIRED) +message(STATUS "CUDAToolkit_INCLUDE_DIRS=${CUDAToolkit_INCLUDE_DIRS}") + +if(NOT CMAKE_CUDA_ARCHITECTURES) + # CMake 3.24+ resolves "native" to the installed GPU(s) at configure time and + # stores the numeric result in CMAKE_CUDA_ARCHITECTURES_NATIVE. + set(CMAKE_CUDA_ARCHITECTURES native) + message(STATUS "CMAKE_CUDA_ARCHITECTURES not set — defaulting to native") +endif() + +if(WIN32) + add_definitions(-DNOMINMAX) +endif() +add_definitions(-D__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__=1) + +set(CMAKE_CUDA_STANDARD 17) +set(CMAKE_CUDA_STANDARD_REQUIRED ON) +set(CMAKE_CUDA_EXTENSIONS OFF) + +# CUDA compiler setup +set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC) +if (MSVC) + list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-bigobj") +else() + list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-mf16c") + list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-Wno-float-conversion") + list(APPEND CUDA_NVCC_FLAGS "-Xcompiler=-fno-strict-aliasing") +endif() +list(APPEND CUDA_NVCC_FLAGS "--extended-lambda") +list(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr") +list(APPEND CUDA_NVCC_FLAGS "-U__CUDA_NO_HALF_OPERATORS__") +list(APPEND CUDA_NVCC_FLAGS "-U__CUDA_NO_HALF_CONVERSIONS__") +list(APPEND CUDA_NVCC_FLAGS "-U__CUDA_NO_HALF2_OPERATORS__") + +enable_language(CUDA) # no-op if already enabled by parent diff --git a/cmake/configure_cxx.cmake b/cmake/configure_cxx.cmake new file mode 100644 index 0000000..26f49eb --- /dev/null +++ b/cmake/configure_cxx.cmake @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) + +if(APPLE) # MacOS is not supported ... + set(CMAKE_MACOSX_RPATH ON) +endif() +if(MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP24") +endif() + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/extern/gdt/cmake/configure_ispc.cmake b/cmake/configure_ispc.cmake similarity index 88% rename from extern/gdt/cmake/configure_ispc.cmake rename to cmake/configure_ispc.cmake index a63a9be..f9e434f 100644 --- a/extern/gdt/cmake/configure_ispc.cmake +++ b/cmake/configure_ispc.cmake @@ -1,5 +1,23 @@ ## Copyright 2019-2021 Intel Corporation ## SPDX-License-Identifier: Apache-2.0 +# ======================================================================== # +# Copyright 2020 - 2026 Qi Wu # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # + +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) option(ISPC_FAST_MATH "enable ISPC fast-math optimizations" OFF) diff --git a/cmake/configure_oneapi.cmake b/cmake/configure_oneapi.cmake new file mode 100644 index 0000000..159455b --- /dev/null +++ b/cmake/configure_oneapi.cmake @@ -0,0 +1,57 @@ +# ======================================================================== # +# Copyright 2020 - 2026 Qi Wu # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # + +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/extern") + +find_package(TBB REQUIRED) + +if(OVR_BUILD_OSPRAY) + find_package(ospray 2.0) + if(NOT TARGET ospray::ospray) + include(FetchContent) + if(WIN32) + set(_ospray_url "https://github.com/wilsonCernWq/ospray/releases/download/sparse_sampling_v2.11.0/ospray-2.11.0.x86_64.windows_sparse_sampling.zip") + else() + set(_ospray_url "https://github.com/wilsonCernWq/ospray/releases/download/sparse_sampling_v2.11.0/ospray-2.11.0.x86_64.linux_sparse_sampling.tar.gz") + endif() + FetchContent_Declare(ospray_binary + URL "${_ospray_url}" + SOURCE_DIR "${CMAKE_BINARY_DIR}/ospray_binary" + ) + FetchContent_GetProperties(ospray_binary) + if(NOT ospray_binary_POPULATED) + FetchContent_Populate(ospray_binary) + endif() + set(ospray_DIR "${ospray_binary_SOURCE_DIR}/lib/cmake/ospray-2.11.0" CACHE PATH "" FORCE) + find_package(ospray 2.0 REQUIRED) + endif() + if(NOT TARGET ospray::ospray) + message(FATAL_ERROR "ospray not found") + endif() +endif() + +if(OVR_BUILD_OPENVKL) + find_package(openvkl) + if(NOT TARGET openvkl::openvkl) + include(dep_openvkl) + endif() + if(NOT TARGET openvkl::openvkl) + message(FATAL_ERROR "openvkl not found") + endif() +endif() diff --git a/cmake/configure_optix.cmake b/cmake/configure_optix.cmake new file mode 100644 index 0000000..521f2bc --- /dev/null +++ b/cmake/configure_optix.cmake @@ -0,0 +1,114 @@ +# ======================================================================== # +# Copyright 2018 Ingo Wald # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + +include(configure_cuda) + +# Fetch OptiX headers if no local installation is pointed to +if(NOT DEFINED OptiX_INSTALL_DIR AND NOT DEFINED ENV{OptiX_INSTALL_DIR}) + include(FetchContent) + FetchContent_Declare(optix_headers + GIT_REPOSITORY https://github.com/NVIDIA/optix-dev.git + GIT_TAG v7.4.0 + GIT_SHALLOW ON + ) + FetchContent_MakeAvailable(optix_headers) + # Our cmake/FindOptiX.cmake uses OptiX_INSTALL_DIR; owl's FindOptiX uses OptiX_ROOT_DIR. + set(OptiX_INSTALL_DIR "${optix_headers_SOURCE_DIR}" CACHE PATH "" FORCE) + set(OptiX_ROOT_DIR "${optix_headers_SOURCE_DIR}" CACHE PATH "" FORCE) +endif() + +find_package(OptiX REQUIRED) + +find_program(BIN2C bin2c HINTS "${CUDAToolkit_BIN_DIR}" DOC "Path to the cuda-sdk bin2c executable.") + +# Compile a CUDA file to PTX and embed it as a C char array. +# Replaces the legacy cuda_compile_ptx (FindCUDA, removed in CMake 3.28). +# +# Usage: +# cuda_compile_and_embed( +# [LINK ...] # targets whose INTERFACE_INCLUDE_DIRECTORIES are forwarded +# [OPTIONS ...] # extra nvcc flags +# [DEPENDS ...] # extra file dependencies +# ) +# After the call, holds the path to the generated .c file. +macro(cuda_compile_and_embed output_var cuda_file) + + set(options) + set(oneArgs) + set(mulArgs OPTIONS LINK DEPENDS) + cmake_parse_arguments(in "${options}" "${oneArgs}" "${mulArgs}" ${ARGN}) + + # ── build include list ──────────────────────────────────────────────────── + set(_cae_opts ${in_OPTIONS} -Xcudafe="--diag_suppress=20044") + list(APPEND _cae_opts "-I${OptiX_INCLUDE}") + if(CUDAToolkit_INCLUDE_DIRS) + list(APPEND _cae_opts "-I${CUDAToolkit_INCLUDE_DIRS}") + endif() + foreach(_cae_tar ${in_LINK}) + get_target_property(_cae_inc ${_cae_tar} INTERFACE_INCLUDE_DIRECTORIES) + if(_cae_inc) + foreach(_cae_path ${_cae_inc}) + list(APPEND _cae_opts "-I${_cae_path}") + endforeach() + endif() + endforeach() + + # ── pick PTX architecture: first concrete compute capability ───────────── + # CMAKE_CUDA_ARCHITECTURES may be a keyword (native/all/all-major); CMake + # 3.24+ resolves it to actual numeric values in CMAKE_CUDA_ARCHITECTURES_NATIVE. + if(CMAKE_CUDA_ARCHITECTURES MATCHES "^(native|all|all-major)$") + set(_cae_archs "${CMAKE_CUDA_ARCHITECTURES_NATIVE}") + else() + set(_cae_archs "${CMAKE_CUDA_ARCHITECTURES}") + endif() + list(GET _cae_archs 0 _cae_arch) + string(REPLACE "+PTX" "" _cae_arch "${_cae_arch}") + string(REPLACE "-virtual" "" _cae_arch "${_cae_arch}") + string(REPLACE "-real" "" _cae_arch "${_cae_arch}") + + # ── output paths ────────────────────────────────────────────────────────── + get_filename_component(_cae_base "${cuda_file}" NAME_WE) + set(_cae_ptx "${CMAKE_CURRENT_BINARY_DIR}/${_cae_base}.ptx") + set(_cae_embedded "${CMAKE_CURRENT_BINARY_DIR}/${_cae_base}_embedded.c") + + # ── step 1: compile to PTX ──────────────────────────────────────────────── + add_custom_command( + OUTPUT "${_cae_ptx}" + COMMAND ${CMAKE_CUDA_COMPILER} + -ptx -std=c++17 + -arch=compute_${_cae_arch} + ${_cae_opts} -DENABLE_OPTIX + "${cuda_file}" + -o "${_cae_ptx}" + DEPENDS "${cuda_file}" ${in_DEPENDS} + COMMENT "Compiling PTX: ${cuda_file}" + ) + + # ── step 2: embed PTX as C char array ──────────────────────────────────── + add_custom_command( + OUTPUT "${_cae_embedded}" + COMMAND ${BIN2C} -c --padd 0 --type char --name ${output_var} + "${_cae_ptx}" > "${_cae_embedded}" + DEPENDS "${_cae_ptx}" ${in_DEPENDS} + COMMENT "Embedding PTX: ${_cae_base}" + ) + + set(${output_var} "${_cae_embedded}") +endmacro() diff --git a/cmake/configure_python.cmake b/cmake/configure_python.cmake new file mode 100644 index 0000000..f6a1c20 --- /dev/null +++ b/cmake/configure_python.cmake @@ -0,0 +1,101 @@ +cmake_minimum_required(VERSION 3.10) +include_guard(GLOBAL) + +# Reuse PYTHON_EXECUTABLE set by parent project; only detect if not yet set. +if(NOT PYTHON_EXECUTABLE) +execute_process( + COMMAND "which" "python" OUTPUT_VARIABLE PYTHON_EXECUTABLE + OUTPUT_STRIP_TRAILING_WHITESPACE +) +endif() +if("${PYTHON_EXECUTABLE}" STREQUAL "") +message(FATAL_ERROR "Python not found — pass -DPYTHON_EXECUTABLE= or activate a venv") +else() +message(STATUS "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") +endif() + +# _GLIBCXX_USE_CXX11_ABI policy +# ------------------------------------------------------------------------- +# libstdc++ has two incompatible ABIs for std::string / std::list (the +# "dual ABI" introduced in GCC 5). We only need to pin a specific value +# when `ovrpy` will be co-loaded with a prebuilt `libtorch.so` that uses +# a different ABI than our compiler's default. +# +# Resolution order (first match wins): +# 1. Explicit -DOVR_PYTHON_CXX11_ABI=<0|1> +# 2. torch probe (only if importable) +# 3. Compiler default (detected & reported; no macro added) +# ------------------------------------------------------------------------- +include(CheckCXXSourceCompiles) + +function(_ovr_detect_compiler_cxx11_abi OUT_VAR) + # Probe whether libstdc++ defines _GLIBCXX_USE_CXX11_ABI at all, then + # whether its default value is 1 or 0. Returns "" when the macro + # isn't defined (e.g. libc++ on macOS). + check_cxx_source_compiles(" +#include +#ifndef _GLIBCXX_USE_CXX11_ABI +# error not libstdc++ dual ABI +#endif +int main(){} +" _OVR_HAS_GLIBCXX_DUAL_ABI) + if(NOT _OVR_HAS_GLIBCXX_DUAL_ABI) + set(${OUT_VAR} "" PARENT_SCOPE) + return() + endif() + check_cxx_source_compiles(" +#include +#if _GLIBCXX_USE_CXX11_ABI != 1 +# error not the new ABI +#endif +int main(){} +" _OVR_GLIBCXX_DEFAULT_IS_1) + if(_OVR_GLIBCXX_DEFAULT_IS_1) + set(${OUT_VAR} 1 PARENT_SCOPE) + else() + set(${OUT_VAR} 0 PARENT_SCOPE) + endif() +endfunction() + +if(DEFINED OVR_PYTHON_CXX11_ABI) + message(STATUS "Pinning _GLIBCXX_USE_CXX11_ABI=${OVR_PYTHON_CXX11_ABI} (explicit)") + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OVR_PYTHON_CXX11_ABI}) +else() + execute_process( + COMMAND "${PYTHON_EXECUTABLE}" -c + "import torch; print(torch._C._GLIBCXX_USE_CXX11_ABI)" + OUTPUT_VARIABLE PYTHON_GLIBCXX_USE_CXX11_ABI + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + if(PYTHON_GLIBCXX_USE_CXX11_ABI STREQUAL "True") + message(STATUS "Pinning _GLIBCXX_USE_CXX11_ABI=1 (matching detected PyTorch)") + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) + elseif(PYTHON_GLIBCXX_USE_CXX11_ABI STREQUAL "False") + message(STATUS "Pinning _GLIBCXX_USE_CXX11_ABI=0 (matching detected PyTorch)") + add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) + else() + _ovr_detect_compiler_cxx11_abi(_abi) + if(_abi STREQUAL "") + message(STATUS + "_GLIBCXX_USE_CXX11_ABI not exposed by this stdlib (likely libc++); " + "leaving untouched. Override with -DOVR_PYTHON_CXX11_ABI=<0|1> if needed.") + else() + message(STATUS + "Compiler default _GLIBCXX_USE_CXX11_ABI=${_abi} (no torch detected; " + "leaving at compiler default). Override with -DOVR_PYTHON_CXX11_ABI=<0|1> " + "if you will co-load ovrpy with a PyTorch built using a different ABI.") + endif() + endif() +endif() + +# ------------------------------------------------------------------ +# import pybind11 +# ------------------------------------------------------------------ +include(FetchContent) +FetchContent_Declare(pybind11 + GIT_REPOSITORY https://github.com/pybind/pybind11.git + GIT_TAG v2.13.6 + GIT_SHALLOW ON +) +FetchContent_MakeAvailable(pybind11) diff --git a/data/configs/scene_beechnut_1.json b/data/configs/scene_beechnut_1.json deleted file mode 100644 index 960c017..0000000 --- a/data/configs/scene_beechnut_1.json +++ /dev/null @@ -1,452 +0,0 @@ -{ - "dataSource": [ - { - "dimensions": { - "x": 1024, - "y": 1024, - "z": 1546 - }, - "endian": "LITTLE_ENDIAN", - "fileName": [ - "/media/data/qadwu/volume/openscivis/beechnut_1024x1024x1546_uint16.raw", - "/home/deralik/GitHub/Instant-vnr-clean/data/data/beechnut_1024x1024x1546_uint16.raw" - ], - "fileUpperLeft": false, - "format": "REGULAR_GRID_RAW_BINARY", - "id": 1, - "name": "beechnut.data", - "offset": 0, - "type": "UNSIGNED_SHORT" - } - ], - "snapshot": [], - "view": { - "backgroundColor": { - "a": 1, - "b": 0, - "g": 0, - "r": 0 - }, - "camera": { - "center": { - "x": 511.5, - "y": 511.5, - "z": 772.5 - }, - "eye": { - "x": 511.5, - "y": 511.5, - "z": 1800 - }, - "fovy": 45, - "projectionMode": "PERSPECTIVE", - "up": { - "x": 0, - "y": 1, - "z": 0 - }, - "zFar": 1800, - "zNear": 1 - }, - "globalAmbient": { - "a": 0, - "b": 0, - "g": 0, - "r": 0 - }, - "globalLighting": true, - "lightSource": { - "ambient": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "diffuse": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "position": { - "w": 0, - "x": 0, - "y": 0, - "z": 1 - }, - "specular": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "type": "DIRECTIONAL_LIGHT" - }, - "lighting": true, - "lightingSide": "FRONT_SIDE", - "method": "REGULAR_GRID_VOLUME_RAY_CASTING", - "tfPreIntegration": false, - "volume": { - "boundingBox": { - "maximum": { - "x": 1023, - "y": 1023, - "z": 1545 - }, - "minimum": { - "x": 0, - "y": 0, - "z": 0 - } - }, - "boundingBoxColor": { - "a": 1, - "b": 0.50000762939453125, - "g": 0.50000762939453125, - "r": 0.50000762939453125 - }, - "boundingBoxVisible": true, - "clippingBox": { - "maximum": { - "x": 1023, - "y": 1023, - "z": 1545 - }, - "minimum": { - "x": 0, - "y": 0, - "z": 0 - } - }, - "dataId": 1, - "interpolationType": "LINEAR_INTERPOLATION", - "material": { - "ambient": 0.5, - "diffuse": 0.5, - "shininess": 16, - "specular": 0 - }, - "opacityUnitDistance": 0.000001, - "sampleDistance": 0.25, - "scalarMappingRange": { - "maximum": 1, - "minimum": 0.1 - }, - "slice": { - "x": { - "position": 511.5, - "visible": false - }, - "y": { - "position": 511.5, - "visible": false - }, - "z": { - "position": 772.5, - "visible": false - } - }, - "textureBox": { - "maximum": { - "x": 1023.5, - "y": 1023.5, - "z": 1545.5 - }, - "minimum": { - "x": -0.5, - "y": -0.5, - "z": -0.5 - } - }, - "transferFunction": { - "alphaArray": { - "data": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", - "encoding": "BASE64" - }, - "colorControls": [ - { - "color": { - "b": 0.0, - "g": 0.0, - "r": 1.0 - }, - "position": 0.0 - }, - { - "color": { - "b": 0.0, - "g": 1.0, - "r": 0.0 - }, - "position": 0.03400000184774399 - }, - { - "color": { - "b": 1.0, - "g": 0.0, - "r": 0.0 - }, - "position": 0.0689999982714653 - }, - { - "color": { - "b": 1.0, - "g": 1.0, - "r": 0.0 - }, - "position": 0.1206689965724945 - }, - { - "color": { - "b": 1.0, - "g": 0.0, - "r": 1.0 - }, - "position": 0.13469005048274994 - }, - { - "color": { - "b": 0.0, - "g": 1.0, - "r": 1.0 - }, - "position": 0.14450361788272858 - }, - { - "color": { - "b": 0.0, - "g": 0.5299999713897705, - "r": 1.0 - }, - "position": 0.15222153067588806 - }, - { - "color": { - "b": 0.5299999713897705, - "g": 0.0, - "r": 1.0 - }, - "position": 0.16877394914627075 - }, - { - "color": { - "b": 0.6600000262260437, - "g": 0.6600000262260437, - "r": 0.6600000262260437 - }, - "position": 0.18625648319721222 - }, - { - "color": { - "b": 0.27000001072883606, - "g": 0.27000001072883606, - "r": 1.0 - }, - "position": 0.2317110002040863 - }, - { - "color": { - "b": 0.38999998569488525, - "g": 1.0, - "r": 0.38999998569488525 - }, - "position": 0.3449999988079071 - }, - { - "color": { - "b": 1.0, - "g": 0.38999998569488525, - "r": 0.38999998569488525 - }, - "position": 0.3790000081062317 - }, - { - "color": { - "b": 0.6499999761581421, - "g": 0.6499999761581421, - "r": 0.1599999964237213 - }, - "position": 0.414000004529953 - }, - { - "color": { - "b": 1.0, - "g": 0.38999998569488525, - "r": 1.0 - }, - "position": 0.4480000138282776 - }, - { - "color": { - "b": 0.38999998569488525, - "g": 1.0, - "r": 1.0 - }, - "position": 0.4830000102519989 - }, - { - "color": { - "b": 0.38999998569488525, - "g": 0.6700000166893005, - "r": 1.0 - }, - "position": 0.5170000195503235 - }, - { - "color": { - "b": 1.0, - "g": 0.3100000023841858, - "r": 0.6700000166893005 - }, - "position": 0.5519999861717224 - }, - { - "color": { - "b": 0.0, - "g": 0.0, - "r": 0.5899999737739563 - }, - "position": 0.5860000252723694 - }, - { - "color": { - "b": 0.0, - "g": 0.5899999737739563, - "r": 0.0 - }, - "position": 0.6209999918937683 - }, - { - "color": { - "b": 0.5899999737739563, - "g": 0.0, - "r": 0.0 - }, - "position": 0.6549999713897705 - }, - { - "color": { - "b": 0.4300000071525574, - "g": 0.4300000071525574, - "r": 0.0 - }, - "position": 0.6899999976158142 - }, - { - "color": { - "b": 0.5899999737739563, - "g": 0.0, - "r": 0.5899999737739563 - }, - "position": 0.7239999771118164 - }, - { - "color": { - "b": 0.0, - "g": 0.5899999737739563, - "r": 0.5899999737739563 - }, - "position": 0.7590000033378601 - }, - { - "color": { - "b": 0.0, - "g": 0.33000001311302185, - "r": 0.5899999737739563 - }, - "position": 0.7929999828338623 - }, - { - "color": { - "b": 0.3100000023841858, - "g": 0.0, - "r": 0.6299999952316284 - }, - "position": 0.828000009059906 - }, - { - "color": { - "b": 0.10999999940395355, - "g": 0.4099999964237213, - "r": 1.0 - }, - "position": 0.8619999885559082 - }, - { - "color": { - "b": 0.3199999928474426, - "g": 0.6700000166893005, - "r": 0.0 - }, - "position": 0.8970000147819519 - }, - { - "color": { - "b": 0.49000000953674316, - "g": 1.0, - "r": 0.27000001072883606 - }, - "position": 0.9309999942779541 - }, - { - "color": { - "b": 1.0, - "g": 0.5099999904632568, - "r": 0.0 - }, - "position": 0.9660000205039978 - }, - { - "color": { - "b": 1.0, - "g": 0.0, - "r": 0.5099999904632568 - }, - "position": 1.0 - } - ], - "opacityControl": [ - { - "position": { - "x": 0.0, - "y": 0.0 - } - }, - { - "position": { - "x": 0.09498836100101471, - "y": 0.0 - } - }, - { - "position": { - "x": 0.11, - "y": 0.0 - } - }, - { - "position": { - "x": 0.18298359215259552, - "y": 0.83636372983455658 - } - }, - { - "position": { - "x": 0.3438226878643036, - "y": 0.0 - } - }, - { - "position": { - "x": 1.0, - "y": 0.0 - } - } - ], - "resolution": 1024 - }, - "transferFunctionType": "TRANSFER_FUNCTION", - "visible": true - } - } -} diff --git a/data/configs/scene_mechhand.json b/data/configs/scene_mechhand.json index 0abfa5e..26f0584 100644 --- a/data/configs/scene_mechhand.json +++ b/data/configs/scene_mechhand.json @@ -13,7 +13,8 @@ "/home/davbauer/Downloads/MechHand_f_640x220x229.raw", "H:/mechhand/MechHand_f_640x220x229.raw", "F:/mechhand/MechHand_f_640x220x229.raw", - "/home/deralik/Github/open-volume-renderer/data/data/MechHand_f_640x220x229_float32/MechHand_f_640x220x229_float32.raw" + "/home/deralik/Github/open-volume-renderer/data/data/MechHand_f_640x220x229_float32/MechHand_f_640x220x229_float32.raw", + "/media/slow/qiwu/Datasets/mechhand/MechHand_f_640x220x229.raw" ], "fileUpperLeft" : false, "format" : "REGULAR_GRID_RAW_BINARY", diff --git a/data/configs/vorts_shadow.json b/data/configs/vorts_shadow.json deleted file mode 100644 index 78228c0..0000000 --- a/data/configs/vorts_shadow.json +++ /dev/null @@ -1,273 +0,0 @@ -{ - "dataSource" : [ - { - "dimensions" : { - "x" : 128, - "y" : 128, - "z" : 128 - }, - "endian" : "LITTLE_ENDIAN", - "fileName" : [ - "data/data/vorts1.data", - "/home/davidbau/repos/open-volume-renderer/data/volume/vorts1.data", - "/media/data/qadwu/volume/vortices/vorts1.data", - "/datasets/vortices/vorts1.data" - ], - "fileUpperLeft" : false, - "format" : "REGULAR_GRID_RAW_BINARY", - "id" : 1, - "name" : "vorts1.data", - "offset" : 0, - "type" : "FLOAT" - } - ], - "snapshot" : [ - ], - "view" : { - "backgroundColor" : { - "a" : 1, - "b" : 0, - "g" : 0, - "r" : 0 - }, - "camera" : { - "center" : { - "x" : 63.5, - "y" : 63.5, - "z" : 63.5 - }, - "eye" : { - "x" : 63.5, - "y" : 63.5, - "z" : 400 - }, - "fovy" : 45, - "projectionMode" : "PERSPECTIVE", - "up" : { - "x" : 0, - "y" : 1, - "z" : 0 - }, - "zFar" : 1270, - "zNear" : 1.27 - }, - "globalAmbient" : { - "a" : 0, - "b" : 0, - "g" : 0, - "r" : 0 - }, - "globalLighting" : false, - "lightSource" : { - "ambient" : { - "a" : 1, - "b" : 1, - "g" : 1, - "r" : 1 - }, - "diffuse" : { - "a" : 1, - "b" : 1, - "g" : 1, - "r" : 1 - }, - "position" : { - "w" : 0, - "x" : 0, - "y" : 0, - "z" : 1 - }, - "specular" : { - "a" : 1, - "b" : 1, - "g" : 1, - "r" : 1 - }, - "type" : "DIRECTIONAL_LIGHT" - }, - "lighting" : true, - "lightingSide" : "FRONT_SIDE", - "method" : "REGULAR_GRID_VOLUME_RAY_CASTING", - "tfPreIntegration" : false, - "volume" : { - "boundingBox" : { - "maximum" : { - "x" : 127, - "y" : 127, - "z" : 127 - }, - "minimum" : { - "x" : 0, - "y" : 0, - "z" : 0 - } - }, - "boundingBoxColor" : { - "a" : 1, - "b" : 0.50000762939453125, - "g" : 0.50000762939453125, - "r" : 0.50000762939453125 - }, - "boundingBoxVisible" : true, - "clippingBox" : { - "maximum" : { - "x" : 127, - "y" : 127, - "z" : 127 - }, - "minimum" : { - "x" : 0, - "y" : 0, - "z" : 0 - } - }, - "dataId" : 1, - "interpolationType" : "LINEAR_INTERPOLATION", - "material" : { - "ambient" : 0.20000000298023224, - "diffuse" : 0.80000001192092896, - "shininess" : 16, - "specular" : 0 - }, - "opacityUnitDistance" : 1, - "sampleDistance" : 0.25, - "scalarMappingRange" : { - "maximum" : 12.139389038085938, - "minimum" : 0.0070086014457046986 - }, - "slice" : { - "x" : { - "position" : 63.5, - "visible" : false - }, - "y" : { - "position" : 63.5, - "visible" : false - }, - "z" : { - "position" : 63.5, - "visible" : false - } - }, - "textureBox" : { - "maximum" : { - "x" : 127.5, - "y" : 127.5, - "z" : 127.5 - }, - "min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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", - "encoding": "BASE64" - }, - "colorControls": [ - { - "color": { - "b": 1.0, - "g": 0.0, - "r": 0.0 - }, - "position": 0.0 - }, - { - "color": { - "b": 1.0, - "g": 0.8467718362808228, - "r": 0.3480392098426819 - }, - "position": 0.2336956113576889 - }, - { - "color": { - "b": 0.0, - "g": 1.0, - "r": 1.0 - }, - "position": 0.5157609581947327 - }, - { - "color": { - "b": 0.0, - "g": 0.15625, - "r": 1.0 - }, - "position": 0.758152186870575 - }, - { - "color": { - "b": 0.0, - "g": 0.0, - "r": 1.0 - }, - "position": 1.0 - } - ], - "opacityControl": [ - { - "position": { - "x": 0.0, - "y": 0.0 - } - }, - { - "position": { - "x": 0.19021731615066528, - "y": 0.0 - } - }, - { - "position": { - "x": 0.2336955964565277, - "y": 0.9947088956832886 - } - }, - { - "position": { - "x": 0.2798912823200226, - "y": 0.0 - } - }, - { - "position": { - "x": 0.4673912227153778, - "y": 0.0 - } - }, - { - "position": { - "x": 0.4945652186870575, - "y": 1.0 - } - }, - { - "position": { - "x": 0.5326088070869446, - "y": 0.0 - } - }, - { - "position": { - "x": 0.6739126443862915, - "y": 0.0 - } - }, - { - "position": { - "x": 1.0, - "y": 1.0 - } - } - ], - "resolution": 1024 - }, - "transferFunctionType" : "TRANSFER_FUNCTION", - "visible" : true - } - } -} \ No newline at end of file diff --git a/data/example.jpg b/data/example.jpg new file mode 100644 index 0000000..55ab3ec Binary files /dev/null and b/data/example.jpg differ diff --git a/data/example.png b/data/example.png deleted file mode 100644 index b9caffd..0000000 Binary files a/data/example.png and /dev/null differ diff --git a/data/scene_setting.usda b/data/scene_setting.usda index 2987f34..10806aa 100644 --- a/data/scene_setting.usda +++ b/data/scene_setting.usda @@ -7,19 +7,7 @@ def "scene" { bool simple_path_tracing = True } def "volume" { - # string data_path = "C:/Users/wilso/Documents/Projects/research/open-volume-renderer/data/configs/scene_mechhand.json" - - # string data_path = "baseline/generated_heatrelease_1atm_camera_adjusted.json" - # string data_path = "baseline/generated_heatrelease_10atm_camera_adjusted.json" - # string data_path = "baseline/generated_temp_1atm_camera_adjusted.json" - # string data_path = "baseline/generated_temp_10atm_camera_adjusted.json" - - # string data_path = "baseline/scene_chameleon.json" - # string data_path = "baseline/scene_mechhand.json" - - # string data_path = "baseline/render_pigheart.json" - string data_path = "baseline/render_richtmyer_meshkov.json" - + string data_path = "data/data/vort1.json" } def "camera" { # from = eye @@ -56,4 +44,4 @@ def "scene" { } } } -} \ No newline at end of file +} diff --git a/extern/apply_imgui_patch.cmake b/extern/apply_imgui_patch.cmake new file mode 100644 index 0000000..22e49fe --- /dev/null +++ b/extern/apply_imgui_patch.cmake @@ -0,0 +1,58 @@ +if(NOT DEFINED GIT_EXECUTABLE OR GIT_EXECUTABLE STREQUAL "") + message(FATAL_ERROR "GIT_EXECUTABLE is required") +endif() + +if(NOT DEFINED IMGUI_PATCH OR IMGUI_PATCH STREQUAL "") + message(FATAL_ERROR "IMGUI_PATCH is required") +endif() + +if(NOT DEFINED IMGUI_SOURCE_DIR OR IMGUI_SOURCE_DIR STREQUAL "") + message(FATAL_ERROR "IMGUI_SOURCE_DIR is required") +endif() + +execute_process( + COMMAND "${GIT_EXECUTABLE}" apply --check "${IMGUI_PATCH}" + WORKING_DIRECTORY "${IMGUI_SOURCE_DIR}" + RESULT_VARIABLE _patch_check_result + OUTPUT_QUIET + ERROR_QUIET +) + +if(_patch_check_result EQUAL 0) + message(STATUS "Applying ImGui patch: ${IMGUI_PATCH}") + execute_process( + COMMAND "${GIT_EXECUTABLE}" apply "${IMGUI_PATCH}" + WORKING_DIRECTORY "${IMGUI_SOURCE_DIR}" + RESULT_VARIABLE _patch_apply_result + OUTPUT_VARIABLE _patch_apply_out + ERROR_VARIABLE _patch_apply_err + ) + if(NOT _patch_apply_result EQUAL 0) + message(FATAL_ERROR + "Failed to apply ImGui patch.\n" + "stdout:\n${_patch_apply_out}\n" + "stderr:\n${_patch_apply_err}" + ) + endif() + return() +endif() + +# If the forward check fails, accept the "already applied" case. +execute_process( + COMMAND "${GIT_EXECUTABLE}" apply --reverse --check "${IMGUI_PATCH}" + WORKING_DIRECTORY "${IMGUI_SOURCE_DIR}" + RESULT_VARIABLE _patch_reverse_check_result + OUTPUT_QUIET + ERROR_QUIET +) + +if(_patch_reverse_check_result EQUAL 0) + message(STATUS "ImGui patch already applied, skipping") + return() +endif() + +message(FATAL_ERROR + "ImGui patch is neither applicable nor already applied.\n" + "Patch: ${IMGUI_PATCH}\n" + "Source: ${IMGUI_SOURCE_DIR}" +) diff --git a/extern/configure.cmake b/extern/configure.cmake index a4f605d..950346e 100644 --- a/extern/configure.cmake +++ b/extern/configure.cmake @@ -18,116 +18,107 @@ # first, include gdt project to do some general configuration stuff # (build modes, glut, optix, etc) # ------------------------------------------------------------------ -include_directories(${CMAKE_CURRENT_LIST_DIR}) -set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +# include_directories(${CMAKE_CURRENT_LIST_DIR}) +# set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/bin2c EXCLUDE_FROM_ALL) -include(${CMAKE_CURRENT_LIST_DIR}/bin2c/target_add_embeded_shaders.cmake) +# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/bin2c EXCLUDE_FROM_ALL) +# include(${CMAKE_CURRENT_LIST_DIR}/bin2c/target_add_embeded_shaders.cmake) # ------------------------------------------------------------------ # load external system libraries # ------------------------------------------------------------------ -find_package(Threads REQUIRED) +# find_package(Threads REQUIRED) # find_package(OpenMP REQUIRED) -# ------------------------------------------------------------------ -# import gdt submodule -# ------------------------------------------------------------------ -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/gdt/cmake") -include(configure_build_type) -include_directories(${CMAKE_CURRENT_LIST_DIR}/gdt) -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/gdt EXCLUDE_FROM_ALL) - -# ------------------------------------------------------------------ -# find OpenGL -# ------------------------------------------------------------------ -if(OVR_BUILD_OPENGL) - - set(OpenGL_GL_PREFERENCE GLVND) - find_package(OpenGL REQUIRED) - if(TARGET OpenGL::OpenGL) - list(APPEND GFX_LIBRARIES OpenGL::OpenGL) - else() - list(APPEND GFX_LIBRARIES OpenGL::GL) - endif() - if(TARGET OpenGL::GLU) - list(APPEND GFX_LIBRARIES OpenGL::GLU) - endif() - if(TARGET OpenGL::GLX) - list(APPEND GFX_LIBRARIES OpenGL::GLX) - endif() - - # build glfw - include(extern/dep_glfw.cmake) - list(APPEND GFX_LIBRARIES glfw) - - # build glad - include(extern/dep_glad.cmake) - list(APPEND GFX_LIBRARIES glad) - - # import imgui - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/imgui EXCLUDE_FROM_ALL) - list(APPEND GFX_LIBRARIES imgui) - - # for building render apps - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/glfwapp EXCLUDE_FROM_ALL) - list(APPEND GFX_LIBRARIES glfwApp) - -endif() - -# ------------------------------------------------------------------ -# import colormap -# ------------------------------------------------------------------ -set(TFNMODULE_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/tfn/colormaps) -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tfn/colormaps) -add_library(tfnmodule STATIC ${embedded_colormap}) -target_include_directories(tfnmodule PUBLIC - $ -) -if (UNIX) - set_target_properties(tfnmodule PROPERTIES POSITION_INDEPENDENT_CODE ON) -endif() - -# ------------------------------------------------------------------ -# import CUDA -# ------------------------------------------------------------------ -if(OVR_BUILD_CUDA) - include(configure_cuda) - mark_as_advanced(CUDA_SDK_ROOT_DIR) -endif() - -# ------------------------------------------------------------------ -# import Optix7 -# ------------------------------------------------------------------ -if(OVR_BUILD_OPTIX7) - include(configure_optix) -endif(OVR_BUILD_OPTIX7) - -# ------------------------------------------------------------------ -# import OneAPI -# ------------------------------------------------------------------ -find_package(TBB REQUIRED) - -if(OVR_BUILD_OSPRAY) - find_package(ospray 2.0 REQUIRED) -endif(OVR_BUILD_OSPRAY) +# # ------------------------------------------------------------------ +# # import gdt submodule +# # ------------------------------------------------------------------ +# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/gdt/cmake") +# include(configure_build_type) +# include_directories(${CMAKE_CURRENT_LIST_DIR}/gdt) +# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/gdt EXCLUDE_FROM_ALL) + +# # ------------------------------------------------------------------ +# # find OpenGL +# # ------------------------------------------------------------------ +# if(OVR_BUILD_OPENGL) + +# set(OpenGL_GL_PREFERENCE GLVND) +# find_package(OpenGL REQUIRED) +# if(TARGET OpenGL::OpenGL) +# list(APPEND GFX_LIBRARIES OpenGL::OpenGL) +# else() +# list(APPEND GFX_LIBRARIES OpenGL::GL) +# endif() +# if(TARGET OpenGL::GLU) +# list(APPEND GFX_LIBRARIES OpenGL::GLU) +# endif() +# if(TARGET OpenGL::GLX) +# list(APPEND GFX_LIBRARIES OpenGL::GLX) +# endif() + +# # build glfw +# include(extern/dep_glfw.cmake) +# list(APPEND GFX_LIBRARIES glfw) + +# # build glad +# include(extern/dep_glad.cmake) +# list(APPEND GFX_LIBRARIES glad) + +# # import imgui +# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/imgui EXCLUDE_FROM_ALL) +# list(APPEND GFX_LIBRARIES imgui) + +# # for building render apps +# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/glfwapp EXCLUDE_FROM_ALL) +# list(APPEND GFX_LIBRARIES glfwApp) + +# endif() + +# # ------------------------------------------------------------------ +# # import colormap +# # ------------------------------------------------------------------ +# set(TFNMODULE_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/tfn/colormaps) +# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tfn/colormaps) +# add_library(tfnmodule STATIC ${embedded_colormap}) +# target_include_directories(tfnmodule PUBLIC +# $ +# ) +# if (UNIX) +# set_target_properties(tfnmodule PROPERTIES POSITION_INDEPENDENT_CODE ON) +# endif() + +# # ------------------------------------------------------------------ +# # import CUDA +# # ------------------------------------------------------------------ +# if(OVR_BUILD_CUDA) +# include(configure_cuda) +# mark_as_advanced(CUDA_SDK_ROOT_DIR) +# endif() + +# # ------------------------------------------------------------------ +# # import Optix7 +# # ------------------------------------------------------------------ +# if(OVR_BUILD_OPTIX7) +# include(configure_optix) +# endif(OVR_BUILD_OPTIX7) # if(OVR_BUILD_OPENVKL) # find_package(rkcommon REQUIRED) # find_package(openvkl REQUIRED) # endif(OVR_BUILD_OPENVKL) -# ------------------------------------------------------------------ -# import USD -# ------------------------------------------------------------------ -if(OVR_BUILD_SCENE_USD) - find_package(pxr REQUIRED) -endif() +# # ------------------------------------------------------------------ +# # import USD +# # ------------------------------------------------------------------ +# if(OVR_BUILD_USD) +# find_package(pxr REQUIRED) +# endif() -# ------------------------------------------------------------------ -# import pybind11 -# ------------------------------------------------------------------ -if(OVR_BUILD_PYTHON_BINDINGS) - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/pybind11) -endif() +# # ------------------------------------------------------------------ +# # import pybind11 +# # ------------------------------------------------------------------ +# if(OVR_BUILD_PYTHON_BINDINGS) +# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/pybind11) +# endif() diff --git a/extern/dep_imgui.cmake b/extern/dep_imgui.cmake new file mode 100644 index 0000000..f5920d3 --- /dev/null +++ b/extern/dep_imgui.cmake @@ -0,0 +1,86 @@ +# ======================================================================== # +# Copyright 2018-2024 Qi Wu # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# ======================================================================== # +include_guard(GLOBAL) +include(FetchContent) +find_package(Git REQUIRED) + +set(IMGUI_VERSION "v1.79") +set(IMPLOT_VERSION "v0.16") +set(IMGUI_PATCH "${CMAKE_CURRENT_LIST_DIR}/imgui.patch") +set(IMGUI_PATCH_HELPER "${CMAKE_CURRENT_LIST_DIR}/apply_imgui_patch.cmake") + +FetchContent_Declare(imgui + DOWNLOAD_DIR imgui + STAMP_DIR imgui/stamp + SOURCE_DIR imgui/src + BINARY_DIR imgui/build + GIT_REPOSITORY https://github.com/ocornut/imgui.git + GIT_TAG ${IMGUI_VERSION} + GIT_SHALLOW TRUE + PATCH_COMMAND + ${CMAKE_COMMAND} + "-DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}" + "-DIMGUI_PATCH:FILEPATH=${IMGUI_PATCH}" + "-DIMGUI_SOURCE_DIR:PATH=" + -P "${IMGUI_PATCH_HELPER}" +) +FetchContent_Declare(implot + DOWNLOAD_DIR implot + STAMP_DIR implot/stamp + SOURCE_DIR implot/src + BINARY_DIR implot/build + GIT_REPOSITORY https://github.com/epezent/implot.git + GIT_TAG ${IMPLOT_VERSION} + GIT_SHALLOW TRUE +) + +FetchContent_MakeAvailable(imgui implot) + +# imgui has no CMakeLists.txt — define the target manually. +if(WIN32) + add_library(imgui STATIC) +else() + add_library(imgui SHARED) +endif() + +target_sources(imgui PRIVATE + ${imgui_SOURCE_DIR}/imgui.cpp + ${imgui_SOURCE_DIR}/imgui_draw.cpp + ${imgui_SOURCE_DIR}/imgui_demo.cpp + ${imgui_SOURCE_DIR}/imgui_widgets.cpp + ${imgui_SOURCE_DIR}/examples/imgui_impl_glfw.cpp + ${imgui_SOURCE_DIR}/examples/imgui_impl_opengl2.cpp + ${imgui_SOURCE_DIR}/examples/imgui_impl_opengl3.cpp + ${implot_SOURCE_DIR}/implot_demo.cpp + ${implot_SOURCE_DIR}/implot_items.cpp + ${implot_SOURCE_DIR}/implot.cpp +) + +target_include_directories(imgui PUBLIC + $ + $ + $ +) + +target_compile_definitions(imgui PUBLIC IMGUI_IMPL_OPENGL_LOADER_GLAD) +target_link_libraries(imgui PRIVATE ${GFX_LIBRARIES}) + +find_package(Vulkan QUIET) +if(Vulkan_FOUND) + target_sources(imgui PRIVATE ${imgui_SOURCE_DIR}/examples/imgui_impl_vulkan.cpp) + target_link_libraries(imgui PRIVATE ${Vulkan_LIBRARY}) + target_include_directories(imgui PUBLIC $) +endif() diff --git a/extern/dep_opengl.cmake b/extern/dep_opengl.cmake new file mode 100644 index 0000000..d004cd5 --- /dev/null +++ b/extern/dep_opengl.cmake @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.24) + +option(OVR_BUILD_OPENGL "Build with OpenGL Apps" ON) + +# ------------------------------------------------------------------ +# find OpenGL +# ------------------------------------------------------------------ +if(OVR_BUILD_OPENGL) + + set(OpenGL_GL_PREFERENCE GLVND) + find_package(OpenGL REQUIRED) + if(TARGET OpenGL::OpenGL) + list(APPEND GFX_LIBRARIES OpenGL::OpenGL) + else() + list(APPEND GFX_LIBRARIES OpenGL::GL) + endif() + if(TARGET OpenGL::GLU) + list(APPEND GFX_LIBRARIES OpenGL::GLU) + endif() + if(TARGET OpenGL::GLX) + list(APPEND GFX_LIBRARIES OpenGL::GLX) + endif() + + # build glfw + include(dep_glfw) + list(APPEND GFX_LIBRARIES glfw) + + # build glad + include(dep_glad) + list(APPEND GFX_LIBRARIES glad) + + # import imgui + implot (fetched via FetchContent) + include(dep_imgui) + list(APPEND GFX_LIBRARIES imgui) + + # for building render apps + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/glfwapp EXCLUDE_FROM_ALL) + list(APPEND GFX_LIBRARIES glfwApp) + +endif() diff --git a/extern/dep_openvkl.cmake b/extern/dep_openvkl.cmake new file mode 100644 index 0000000..c2d244d --- /dev/null +++ b/extern/dep_openvkl.cmake @@ -0,0 +1,71 @@ +cmake_minimum_required(VERSION 3.24) +include(FetchContent) + +option(ENABLE_OPENVKL "Enable OpenVKL CPU sampling backend" OFF) +if(NOT ENABLE_OPENVKL) + return() +endif() + +find_package(TBB CONFIG QUIET) +if(NOT TARGET TBB::tbb) + message(FATAL_ERROR "ENABLE_OPENVKL requires TBB. Install libtbb-dev or set TBB_DIR.") +endif() + +# ── rkcommon ────────────────────────────────────────────────────────────────── +set(RKCOMMON_VERSION "1.13.0" CACHE STRING "rkcommon version") +set(RKCOMMON_TASKING_SYSTEM "TBB" CACHE STRING "" FORCE) +set(BUILD_TESTING OFF CACHE BOOL "" FORCE) +FetchContent_Declare(rkcommon + GIT_REPOSITORY https://github.com/ospray/rkcommon.git + GIT_TAG v${RKCOMMON_VERSION} + GIT_SHALLOW ON + OVERRIDE_FIND_PACKAGE +) +FetchContent_MakeAvailable(rkcommon) +if(TARGET rkcommon AND NOT TARGET rkcommon::rkcommon) + add_library(rkcommon::rkcommon ALIAS rkcommon) +endif() + +# ── embree ──────────────────────────────────────────────────────────────────── +set(EMBREE_VERSION "4.3.3" CACHE STRING "Embree version") +set(EMBREE_ISPC_SUPPORT OFF CACHE BOOL "" FORCE) +set(EMBREE_TUTORIALS OFF CACHE BOOL "" FORCE) +set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "" FORCE) +set(EMBREE_STATIC_RUNTIME OFF CACHE BOOL "" FORCE) +FetchContent_Declare(embree + GIT_REPOSITORY https://github.com/RenderKit/embree.git + GIT_TAG v${EMBREE_VERSION} + GIT_SHALLOW ON + OVERRIDE_FIND_PACKAGE +) +FetchContent_MakeAvailable(embree) + +# ── openvkl ─────────────────────────────────────────────────────────────────── +set(OPENVKL_VERSION "2.0.1" CACHE STRING "OpenVKL version") +set(OPENVKL_DEVICE_GPU OFF CACHE BOOL "" FORCE) +set(OPENVKL_DEVICE_CPU ON CACHE BOOL "" FORCE) +set(BUILD_TESTING OFF CACHE BOOL "" FORCE) +set(BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE) +set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) +set(BUILD_TOOLS OFF CACHE BOOL "" FORCE) +FetchContent_Declare(openvkl + GIT_REPOSITORY https://github.com/openvkl/openvkl.git + GIT_TAG v${OPENVKL_VERSION} + GIT_SHALLOW ON +) +FetchContent_MakeAvailable(openvkl) +if(TARGET openvkl AND NOT TARGET openvkl::openvkl) + add_library(openvkl::openvkl ALIAS openvkl) +endif() +if(TARGET openvkl_module_cpu_device AND NOT TARGET openvkl::openvkl_module_cpu_device) + add_library(openvkl::openvkl_module_cpu_device ALIAS openvkl_module_cpu_device) +endif() + +foreach(_w 4 8 16) + if(TARGET openvkl_module_cpu_device_${_w}) + target_include_directories(openvkl_module_cpu_device_${_w} + PUBLIC $) + endif() +endforeach() +unset(_w) + diff --git a/extern/dep_usd.cmake b/extern/dep_usd.cmake new file mode 100644 index 0000000..9ad2618 --- /dev/null +++ b/extern/dep_usd.cmake @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.24) +include(FetchContent) + +option(OVR_BUILD_USD "Build USDA Scene Reader" OFF) +if(OVR_BUILD_USD) + find_package(pxr REQUIRED) +endif() diff --git a/extern/gdt/cmake/configure_cuda.cmake b/extern/gdt/cmake/configure_cuda.cmake deleted file mode 100644 index 6a83055..0000000 --- a/extern/gdt/cmake/configure_cuda.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# ======================================================================== # -# Copyright 2018 Ingo Wald # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ======================================================================== # - -list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") - -find_package(CUDAToolkit REQUIRED) -message(STATUS "CUDAToolkit_INCLUDE_DIRS=${CUDAToolkit_INCLUDE_DIRS}") - -if((NOT EXISTS ${GDT_CUDA_ARCHITECTURES}) AND (DEFINED ENV{GDT_CUDA_ARCHITECTURES})) - set(GDT_CUDA_ARCHITECTURES $ENV{GDT_CUDA_ARCHITECTURES}) -endif() - -if (DEFINED GDT_CUDA_ARCHITECTURES) - - message(STATUS "Obtained target architecture from environment variable GDT_CUDA_ARCHITECTURES=${GDT_CUDA_ARCHITECTURES}") - set(CMAKE_CUDA_ARCHITECTURES ${GDT_CUDA_ARCHITECTURES}) - if (NOT PROJECT_IS_TOP_LEVEL) - set(CMAKE_CUDA_ARCHITECTURES ${GDT_CUDA_ARCHITECTURES} PARENT_SCOPE) - endif() - -else() - - # adapted from https://stackoverflow.com/a/69353718 - include(FindCUDA/select_compute_arch) - CUDA_DETECT_INSTALLED_GPUS(INSTALLED_GPU_CCS_1) - string(STRIP "${INSTALLED_GPU_CCS_1}" INSTALLED_GPU_CCS_2) - string(REPLACE " " ";" INSTALLED_GPU_CCS_3 "${INSTALLED_GPU_CCS_2}") - string(REPLACE "." "" CUDA_ARCH_LIST "${INSTALLED_GPU_CCS_3}") - if (NOT PROJECT_IS_TOP_LEVEL) - set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH_LIST} PARENT_SCOPE) - endif() - set(CMAKE_CUDA_ARCHITECTURES ${CUDA_ARCH_LIST}) - message(STATUS "Automatically detected GPU architectures: ${CUDA_ARCH_LIST}") - -endif() - -# include_directories(${CUDA_TOOLKIT_INCLUDE}) - -if(WIN32) - add_definitions(-DNOMINMAX) -endif() -add_definitions(-D__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__=1) diff --git a/extern/gdt/cmake/configure_optix.cmake b/extern/gdt/cmake/configure_optix.cmake deleted file mode 100644 index e0ebc86..0000000 --- a/extern/gdt/cmake/configure_optix.cmake +++ /dev/null @@ -1,73 +0,0 @@ -# ======================================================================== # -# Copyright 2018 Ingo Wald # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ======================================================================== # - -list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") - -include(configure_cuda) - -find_package(OptiX REQUIRED) - -find_program(BIN2C bin2c DOC "Path to the cuda-sdk bin2c executable.") - -# this macro defines cmake rules that execute the following four steps: -# 1) compile the given cuda file ${cuda_file} to an intermediary PTX file -# 2) use the 'bin2c' tool (that comes with CUDA) to -# create a second intermediary (.c-)file which defines a const string variable -# (named '${c_var_name}') whose (constant) value is the PTX output -# from the previous step. -# 3) compile the given .c file to an intermediary object file (why thus has -# that PTX string 'embedded' as a global constant. -# 4) assign the name of the intermediary .o file to the cmake variable -# 'output_var', which can then be added to cmake targets. -macro(cuda_compile_and_embed output_var cuda_file) - - set(options) - set(oneArgs) - set(mulArgs OPTIONS LINK DEPENDS) - cmake_parse_arguments(in "${options}" "${oneArgs}" "${mulArgs}" ${ARGN}) - - set(opts ${in_OPTIONS} -Xcudafe="--diag_suppress=20044") - - list(APPEND opts -I"${OptiX_INCLUDE}") - if (CUDAToolkit_INCLUDE_DIRS) - list(APPEND opts -I"${CUDAToolkit_INCLUDE_DIRS}") - endif() - - foreach(tar ${in_LINK}) - get_target_property(inc ${tar} INTERFACE_INCLUDE_DIRECTORIES) - foreach(path ${inc}) - list(APPEND opts "-I${path}") - endforeach() - endforeach() - - set(c_var_name ${output_var}) - cuda_compile_ptx(ptx_files ${cuda_file} OPTIONS ${opts} -DENABLE_OPTIX) - list(GET ptx_files 0 ptx_file) - set(embedded_file ${ptx_file}_embedded.c) - - # message("ptx: ${cuda_file} OPTIONS ${opts}") - # message("adding rule to compile and embed ${cuda_file} to \"const char ${var_name}[];\"") - - add_custom_command( - OUTPUT ${embedded_file} - COMMAND ${BIN2C} -c --padd 0 --type char --name ${c_var_name} ${ptx_file} > ${embedded_file} - DEPENDS ${ptx_file} ${in_DEPENDS} - COMMENT "compiling (and embedding ptx from) ${cuda_file}") - set(${output_var} ${embedded_file}) - -endmacro() - -# include_directories(${OptiX_INCLUDE}) diff --git a/extern/imgui/imgui.patch b/extern/imgui.patch similarity index 100% rename from extern/imgui/imgui.patch rename to extern/imgui.patch diff --git a/extern/imgui/CMakeLists.txt b/extern/imgui/CMakeLists.txt deleted file mode 100644 index 5a34eac..0000000 --- a/extern/imgui/CMakeLists.txt +++ /dev/null @@ -1,77 +0,0 @@ -# ======================================================================== # -# Copyright 2018-2021 Qi Wu # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ======================================================================== # -project(DearImGui LANGUAGES CXX) -cmake_minimum_required(VERSION 3.7.0) - -find_package(Vulkan) - -# Now it is important to make imgui a shared library -# TODO: add support for Vulkan -# TODO: see if we can build STATIC on all platforms -if (WIN32) -add_library(imgui STATIC - imgui/imgui.cpp - imgui/imgui_draw.cpp - imgui/imgui_demo.cpp - imgui/imgui_widgets.cpp - imgui/examples/imgui_impl_glfw.cpp - imgui/examples/imgui_impl_opengl2.cpp - imgui/examples/imgui_impl_opengl3.cpp - implot/implot_demo.cpp - implot/implot_items.cpp - implot/implot.cpp -) -else() -add_library(imgui SHARED - imgui/imgui.cpp - imgui/imgui_draw.cpp - imgui/imgui_demo.cpp - imgui/imgui_widgets.cpp - imgui/examples/imgui_impl_glfw.cpp - imgui/examples/imgui_impl_opengl2.cpp - imgui/examples/imgui_impl_opengl3.cpp - implot/implot_demo.cpp - implot/implot_items.cpp - implot/implot.cpp -) -endif() - -target_link_libraries(imgui PRIVATE ${GFX_LIBRARIES}) - -if(Vulkan_FOUND) - target_sources(imgui PRIVATE imgui/examples/imgui_impl_vulkan.cpp) - target_link_libraries(imgui PRIVATE ${Vulkan_LIBRARY}) - target_include_directories(imgui PUBLIC - $ - ) -endif() - -target_include_directories(imgui PUBLIC - $ - $ - $ - $ - $ -) - -target_compile_definitions(imgui -PUBLIC - IMGUI_IMPL_OPENGL_LOADER_GLAD -) - -# if (UNIX) -# set_target_properties(imgui PROPERTIES POSITION_INDEPENDENT_CODE ON) -# endif() diff --git a/extern/imgui/imgui b/extern/imgui/imgui deleted file mode 160000 index e5cb04b..0000000 --- a/extern/imgui/imgui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e5cb04b132cba94f902beb6186cb58b864777012 diff --git a/extern/imgui/implot b/extern/imgui/implot deleted file mode 160000 index 18c7243..0000000 --- a/extern/imgui/implot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 18c72431f8265e2b0b5378a3a73d8a883b2175ff diff --git a/extern/pybind11 b/extern/pybind11 deleted file mode 160000 index 8b48ff8..0000000 --- a/extern/pybind11 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8b48ff878c168b51fe5ef7b8c728815b9e1a9857 diff --git a/extern/gdt/CMakeLists.txt b/gdt/CMakeLists.txt similarity index 74% rename from extern/gdt/CMakeLists.txt rename to gdt/CMakeLists.txt index f7fa1e8..0e9187b 100644 --- a/extern/gdt/CMakeLists.txt +++ b/gdt/CMakeLists.txt @@ -14,20 +14,15 @@ # limitations under the License. # # ======================================================================== # -project(GPUDevelopmentTools) -cmake_minimum_required(VERSION 3.5) +project(GPUDevelopmentTools LANGUAGES C CXX) +cmake_minimum_required(VERSION 3.18) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) -add_library(gdt INTERFACE - cmake/configure_build_type.cmake - cmake/configure_optix.cmake - cmake/FindOptiX.cmake - gdt/gdt.h - # gdt/gdt.cpp -) +add_library(gdt INTERFACE gdt/gdt.h) -target_include_directories(gdt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -if (UNIX) - set_target_properties(gdt PROPERTIES POSITION_INDEPENDENT_CODE ON) -endif() +target_include_directories(gdt INTERFACE + $ + # Installed consumers inherit the include root selected by OVR itself. + $ +) diff --git a/extern/gdt/gdt/gdt.cpp b/gdt/gdt/gdt.cpp similarity index 100% rename from extern/gdt/gdt/gdt.cpp rename to gdt/gdt/gdt.cpp diff --git a/extern/gdt/gdt/gdt.h b/gdt/gdt/gdt.h similarity index 100% rename from extern/gdt/gdt/gdt.h rename to gdt/gdt/gdt.h diff --git a/extern/gdt/gdt/math/box.h b/gdt/gdt/math/box.h similarity index 100% rename from extern/gdt/gdt/math/box.h rename to gdt/gdt/math/box.h diff --git a/extern/gdt/gdt/math/constants.h b/gdt/gdt/math/constants.h similarity index 100% rename from extern/gdt/gdt/math/constants.h rename to gdt/gdt/math/constants.h diff --git a/extern/gdt/gdt/math/fixedpoint.h b/gdt/gdt/math/fixedpoint.h similarity index 100% rename from extern/gdt/gdt/math/fixedpoint.h rename to gdt/gdt/math/fixedpoint.h diff --git a/extern/gdt/gdt/math/mat.h b/gdt/gdt/math/mat.h similarity index 100% rename from extern/gdt/gdt/math/mat.h rename to gdt/gdt/math/mat.h diff --git a/extern/gdt/gdt/math/mat/AffineSpace.h b/gdt/gdt/math/mat/AffineSpace.h similarity index 100% rename from extern/gdt/gdt/math/mat/AffineSpace.h rename to gdt/gdt/math/mat/AffineSpace.h diff --git a/extern/gdt/gdt/math/mat/LinearSpace.h b/gdt/gdt/math/mat/LinearSpace.h similarity index 100% rename from extern/gdt/gdt/math/mat/LinearSpace.h rename to gdt/gdt/math/mat/LinearSpace.h diff --git a/extern/gdt/gdt/math/mat/Quaternion.h b/gdt/gdt/math/mat/Quaternion.h similarity index 100% rename from extern/gdt/gdt/math/mat/Quaternion.h rename to gdt/gdt/math/mat/Quaternion.h diff --git a/extern/gdt/gdt/math/vec.h b/gdt/gdt/math/vec.h similarity index 100% rename from extern/gdt/gdt/math/vec.h rename to gdt/gdt/math/vec.h diff --git a/extern/gdt/gdt/math/vec/compare.h b/gdt/gdt/math/vec/compare.h similarity index 100% rename from extern/gdt/gdt/math/vec/compare.h rename to gdt/gdt/math/vec/compare.h diff --git a/extern/gdt/gdt/math/vec/functors.h b/gdt/gdt/math/vec/functors.h similarity index 100% rename from extern/gdt/gdt/math/vec/functors.h rename to gdt/gdt/math/vec/functors.h diff --git a/extern/gdt/gdt/math/vec/rotate.h b/gdt/gdt/math/vec/rotate.h similarity index 100% rename from extern/gdt/gdt/math/vec/rotate.h rename to gdt/gdt/math/vec/rotate.h diff --git a/extern/gdt/gdt/random/random.h b/gdt/gdt/random/random.h similarity index 100% rename from extern/gdt/gdt/random/random.h rename to gdt/gdt/random/random.h diff --git a/github-actions b/github-actions index d9ba938..23008d7 160000 --- a/github-actions +++ b/github-actions @@ -1 +1 @@ -Subproject commit d9ba938900ccac5eae46a240120a75bf0b182cdc +Subproject commit 23008d7d2b90d1c7f9bcb340274d6eca56e8eb72 diff --git a/ovr/CMakeLists.txt b/ovr/CMakeLists.txt index 44b429b..4a39ddc 100644 --- a/ovr/CMakeLists.txt +++ b/ovr/CMakeLists.txt @@ -41,31 +41,40 @@ add_library(rendercommon SHARED scene.cpp scene.h ) -target_link_libraries(rendercommon PUBLIC gdt tfnmodule TBB::tbb Threads::Threads) -target_link_libraries(rendercommon PRIVATE ${CMAKE_DL_LIBS}) -target_include_directories(rendercommon -PUBLIC +target_link_libraries(rendercommon PRIVATE + $ + $ + $ + $ + $ +) +target_include_directories(rendercommon +PUBLIC + # Keep OVR's build interface rooted in this repository; installed include + # layout is coordinated separately via OVR_INSTALL_INCLUDEDIR. + $ $ + $ $ $ $ -PRIVATE + $ + $ +PRIVATE $ ) if(OVR_BUILD_CUDA) - target_sources(rendercommon PRIVATE + # Use OVR_BUILD_CUDA (set by the parent project) rather than OVR_BUILD_CUDA, + # since when embedded as a subdirectory OVR_BUILD_CUDA is set OFF to skip + # the now-removed find_package(CUDA), but CUDA itself is still available. + target_sources(rendercommon PRIVATE common/generate_mask.cu common/cuda/texture.cu ) - target_link_libraries(rendercommon PUBLIC CUDA::cudart_static) # this is useful for including CUDABuffer in C++ code - target_compile_options(rendercommon PUBLIC $<$:${CUDA_NVCC_FLAGS}>) - target_compile_definitions(rendercommon PUBLIC OVR_BUILD_CUDA_DEVICES=1) - target_include_directories(rendercommon PUBLIC - $ - $ - $ - ) + target_link_libraries(rendercommon PUBLIC $) + target_compile_options(rendercommon PRIVATE $<$:${CUDA_NVCC_FLAGS}>) + target_compile_definitions(rendercommon PUBLIC $) # TODO: this is just a temporary hack to get the code to compile # Copy cuda/cuda_utils.h to cuda_misc.h execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different @@ -92,8 +101,7 @@ target_add_embeded_shaders(rendercommon # Allow device to define its own GUI pannel if(OVR_BUILD_OPENGL) - target_link_libraries(rendercommon PUBLIC imgui) - target_compile_definitions(rendercommon PUBLIC OVR_BUILD_OPENGL=1) + target_compile_definitions(rendercommon PUBLIC $) endif() # ======================================================================== # @@ -116,11 +124,11 @@ PRIVATE target_include_directories(renderlib PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(renderlib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/..) -if(OVR_BUILD_SCENE_USD) +if(OVR_BUILD_USD) target_sources(renderlib PRIVATE serializer/serializer_usda.cpp) target_link_libraries(renderlib PRIVATE ${PXR_LIBRARIES}) target_include_directories(renderlib PRIVATE ${PXR_INCLUDE_DIRS}) - target_compile_definitions(renderlib PUBLIC OVR_BUILD_SCENE_USD=1) + target_compile_definitions(renderlib PUBLIC OVR_BUILD_USD=1) endif() # filesystem @@ -138,7 +146,11 @@ if (NOT APPLE) endif() # --------------------------------------------- -# devices +# devices (optional — may not be checked out) # --------------------------------------------- -add_subdirectory(devices/optix7) -add_subdirectory(devices/ospray) +if(OVR_BUILD_DEVICE_OPTIX7 AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/devices/optix7") + add_subdirectory(devices/optix7) +endif() +if(OVR_BUILD_DEVICE_OSPRAY AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/devices/ospray") + add_subdirectory(devices/ospray) +endif() diff --git a/ovr/devices/optix7/CMakeLists.txt b/ovr/devices/optix7/CMakeLists.txt index 26d21a5..10c8ffe 100644 --- a/ovr/devices/optix7/CMakeLists.txt +++ b/ovr/devices/optix7/CMakeLists.txt @@ -5,8 +5,9 @@ if(OVR_BUILD_DEVICE_OPTIX7) message(STATUS "Enable OptiX7") - cuda_compile_and_embed(embedded_ptx_code__raymarching shaders_raymarching.cu LINK rendercommon) - cuda_compile_and_embed(embedded_ptx_code__pathtracing shaders_pathtracing.cu LINK rendercommon) + # TODO: why cuda_compile_and_embed does not transitively link to gdt? we have to explicitly link gdt here. + cuda_compile_and_embed(embedded_ptx_code__raymarching ${CMAKE_CURRENT_LIST_DIR}/shaders_raymarching.cu LINK rendercommon gdt) + cuda_compile_and_embed(embedded_ptx_code__pathtracing ${CMAKE_CURRENT_LIST_DIR}/shaders_pathtracing.cu LINK rendercommon gdt) add_library(device_optix7 STATIC ${embedded_ptx_code__raymarching} @@ -31,7 +32,12 @@ if(OVR_BUILD_DEVICE_OPTIX7) CUDA_SEPARABLE_COMPILATION ON POSITION_INDEPENDENT_CODE ON ) - target_link_libraries (device_optix7 PRIVATE rendercommon OptiX::optix7) + target_link_libraries(device_optix7 PRIVATE + rendercommon + OptiX::optix7 + TBB::tbb + $<$,$>:imgui> + ) target_link_libraries (device_optix7 PRIVATE cuda) # LNK2019: unresolved external symbol cuCtxGetCurrent referenced in function target_compile_options (device_optix7 PRIVATE $<$:${CUDA_NVCC_FLAGS}>) target_compile_definitions(device_optix7 INTERFACE OVR_BUILD_OPTIX7=1) diff --git a/ovr/devices/ospray/CMakeLists.txt b/ovr/devices/ospray/CMakeLists.txt index 8e65cb1..93f1935 100644 --- a/ovr/devices/ospray/CMakeLists.txt +++ b/ovr/devices/ospray/CMakeLists.txt @@ -8,7 +8,12 @@ if(OVR_BUILD_DEVICE_OSPRAY) device_impl.cpp device_impl.h ) - target_link_libraries (device_ospray PRIVATE rendercommon ospray::ospray) + target_link_libraries(device_ospray PRIVATE + rendercommon + ospray::ospray + TBB::tbb + $<$,$>:imgui> + ) target_compile_definitions(device_ospray INTERFACE OVR_BUILD_OSPRAY=1) set_target_properties(device_ospray PROPERTIES diff --git a/ovr/serializer/serializer.h b/ovr/serializer/serializer.h index ed6089c..653be19 100644 --- a/ovr/serializer/serializer.h +++ b/ovr/serializer/serializer.h @@ -20,7 +20,7 @@ create_json_scene_diva(json root, std::string workdir); Scene create_json_scene_vidi(json root, std::string workdir); -#ifdef OVR_BUILD_SCENE_USD +#ifdef OVR_BUILD_USD Scene create_usda_scene(std::string filename); #endif diff --git a/ovr/serializer/serializer_json.cpp b/ovr/serializer/serializer_json.cpp index b9ea316..b012e97 100644 --- a/ovr/serializer/serializer_json.cpp +++ b/ovr/serializer/serializer_json.cpp @@ -517,7 +517,7 @@ create_scene_default(std::string filename) { const auto ext = filename.substr(filename.find_last_of(".") + 1); if (ext == "json") return ovr::scene::create_json_scene(filename); -#ifdef OVR_BUILD_SCENE_USD +#ifdef OVR_BUILD_USD if (ext == "usda") return ovr::scene::create_usda_scene(filename); #endif throw std::runtime_error("unknown scene format"); diff --git a/ovrpy_environment.yml b/ovrpy_environment.yml deleted file mode 100644 index 8ee5674..0000000 --- a/ovrpy_environment.yml +++ /dev/null @@ -1,159 +0,0 @@ -name: ovrpy -channels: - - pytorch - - nvidia - - nvidia/label/cuda-12.1.0 - - defaults -dependencies: - - _libgcc_mutex=0.1=main - - _openmp_mutex=5.1=1_gnu - - blas=1.0=mkl - - bzip2=1.0.8=h5eee18b_5 - - ca-certificates=2024.3.11=h06a4308_0 - - certifi=2024.2.2=py310h06a4308_0 - - charset-normalizer=2.0.4=pyhd3eb1b0_0 - - cuda-cccl=12.1.55=0 - - cuda-command-line-tools=12.1.0=0 - - cuda-compiler=12.1.0=0 - - cuda-cudart=12.1.55=0 - - cuda-cudart-dev=12.1.55=0 - - cuda-cudart-static=12.1.55=0 - - cuda-cuobjdump=12.1.55=0 - - cuda-cupti=12.1.105=0 - - cuda-cupti-static=12.1.62=0 - - cuda-cuxxfilt=12.1.55=0 - - cuda-documentation=12.1.55=0 - - cuda-driver-dev=12.1.55=0 - - cuda-gdb=12.1.55=0 - - cuda-libraries=12.1.0=0 - - cuda-libraries-dev=12.1.0=0 - - cuda-libraries-static=12.1.0=0 - - cuda-nsight=12.1.55=0 - - cuda-nsight-compute=12.1.0=0 - - cuda-nvcc=12.1.66=0 - - cuda-nvdisasm=12.1.55=0 - - cuda-nvml-dev=12.1.55=0 - - cuda-nvprof=12.1.55=0 - - cuda-nvprune=12.1.55=0 - - cuda-nvrtc=12.1.105=0 - - cuda-nvrtc-dev=12.1.55=0 - - cuda-nvrtc-static=12.1.55=0 - - cuda-nvtx=12.1.66=0 - - cuda-nvvp=12.1.55=0 - - cuda-opencl=12.4.99=0 - - cuda-opencl-dev=12.1.56=0 - - cuda-profiler-api=12.1.55=0 - - cuda-runtime=12.1.0=0 - - cuda-sanitizer-api=12.1.55=0 - - cuda-toolkit=12.1.0=0 - - cuda-tools=12.1.0=0 - - cuda-visual-tools=12.1.0=0 - - ffmpeg=4.3=hf484d3e_0 - - filelock=3.13.1=py310h06a4308_0 - - freetype=2.12.1=h4a9f257_0 - - gds-tools=1.6.0.25=0 - - gmp=6.2.1=h295c915_3 - - gmpy2=2.1.2=py310heeb90bb_0 - - gnutls=3.6.15=he1e5248_0 - - idna=3.4=py310h06a4308_0 - - intel-openmp=2023.1.0=hdb19cb5_46306 - - jinja2=3.1.3=py310h06a4308_0 - - jpeg=9e=h5eee18b_1 - - lame=3.100=h7b6447c_0 - - lcms2=2.12=h3be6417_0 - - ld_impl_linux-64=2.38=h1181459_1 - - lerc=3.0=h295c915_0 - - libcublas=12.1.0.26=0 - - libcublas-dev=12.1.0.26=0 - - libcublas-static=12.1.0.26=0 - - libcufft=11.0.2.4=0 - - libcufft-dev=11.0.2.4=0 - - libcufft-static=11.0.2.4=0 - - libcufile=1.9.0.20=0 - - libcufile-dev=1.6.0.25=0 - - libcufile-static=1.6.0.25=0 - - libcurand=10.3.5.119=0 - - libcurand-dev=10.3.2.56=0 - - libcurand-static=10.3.2.56=0 - - libcusolver=11.4.4.55=0 - - libcusolver-dev=11.4.4.55=0 - - libcusolver-static=11.4.4.55=0 - - libcusparse=12.0.2.55=0 - - libcusparse-dev=12.0.2.55=0 - - libcusparse-static=12.0.2.55=0 - - libdeflate=1.17=h5eee18b_1 - - libffi=3.4.4=h6a678d5_0 - - libgcc-ng=11.2.0=h1234567_1 - - libgfortran-ng=11.2.0=h00389a5_1 - - libgfortran5=11.2.0=h1234567_1 - - libgomp=11.2.0=h1234567_1 - - libiconv=1.16=h7f8727e_2 - - libidn2=2.3.4=h5eee18b_0 - - libjpeg-turbo=2.0.0=h9bf148f_0 - - libnpp=12.0.2.50=0 - - libnpp-dev=12.0.2.50=0 - - libnpp-static=12.0.2.50=0 - - libnvjitlink=12.1.105=0 - - libnvjitlink-dev=12.1.55=0 - - libnvjpeg=12.1.1.14=0 - - libnvjpeg-dev=12.1.0.39=0 - - libnvjpeg-static=12.1.0.39=0 - - libnvvm-samples=12.1.55=0 - - libpng=1.6.39=h5eee18b_0 - - libstdcxx-ng=11.2.0=h1234567_1 - - libtasn1=4.19.0=h5eee18b_0 - - libtiff=4.5.1=h6a678d5_0 - - libunistring=0.9.10=h27cfd23_0 - - libuuid=1.41.5=h5eee18b_0 - - libwebp-base=1.3.2=h5eee18b_0 - - llvm-openmp=14.0.6=h9e868ea_0 - - lz4-c=1.9.4=h6a678d5_0 - - markupsafe=2.1.3=py310h5eee18b_0 - - mkl=2023.1.0=h213fc3f_46344 - - mkl-service=2.4.0=py310h5eee18b_1 - - mkl_fft=1.3.8=py310h5eee18b_0 - - mkl_random=1.2.4=py310hdb19cb5_0 - - mpc=1.1.0=h10f8cd9_1 - - mpfr=4.0.2=hb69a4c5_1 - - mpmath=1.3.0=py310h06a4308_0 - - ncurses=6.4=h6a678d5_0 - - nettle=3.7.3=hbbd107a_1 - - networkx=3.1=py310h06a4308_0 - - nsight-compute=2023.1.0.15=0 - - numpy=1.26.4=py310h5f9d8c6_0 - - numpy-base=1.26.4=py310hb5e798b_0 - - openh264=2.1.1=h4ff587b_0 - - openjpeg=2.4.0=h3ad879b_0 - - openssl=3.0.13=h7f8727e_0 - - pillow=10.2.0=py310h5eee18b_0 - - pip=23.3.1=py310h06a4308_0 - - python=3.10.14=h955ad1f_0 - - pytorch=2.2.1=py3.10_cuda12.1_cudnn8.9.2_0 - - pytorch-cuda=12.1=ha16c6d3_5 - - pytorch-mutex=1.0=cuda - - pyyaml=6.0.1=py310h5eee18b_0 - - readline=8.2=h5eee18b_0 - - requests=2.31.0=py310h06a4308_1 - - scipy=1.12.0=py310h5f9d8c6_0 - - setuptools=68.2.2=py310h06a4308_0 - - sqlite=3.41.2=h5eee18b_0 - - sympy=1.12=py310h06a4308_0 - - tbb=2021.8.0=hdb19cb5_0 - - tk=8.6.12=h1ccaba5_0 - - torchaudio=2.2.1=py310_cu121 - - torchtriton=2.2.0=py310 - - torchvision=0.17.1=py310_cu121 - - typing_extensions=4.9.0=py310h06a4308_1 - - tzdata=2024a=h04d1e81_0 - - urllib3=2.1.0=py310h06a4308_0 - - wheel=0.41.2=py310h06a4308_0 - - xz=5.4.6=h5eee18b_0 - - yaml=0.2.5=h7b6447c_0 - - zlib=1.2.13=h5eee18b_0 - - zstd=1.5.5=hc292b87_0 - # - pip: - # - tinycudann==1.6 -prefix: /mnt/scratch/ssd/qadwu/miniconda3/envs/ovrpy - -# Additional packages -# pip install git+https://github.com/wilsonCernWq/tiny-cuda-nn/#subdirectory=bindings/torch diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100644 index 0000000..96e05a0 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash +# Configure, build, and test the OVR C++/CUDA + Python bindings. +# OpenVKL and other external deps are fetched and built automatically via +# FetchContent during the configure step - no separate deps build needed. +# +# Usage: +# ./scripts/build.sh # configure + build (no tests) +# ./scripts/build.sh --configure # configure only +# ./scripts/build.sh --build # build only (skip configure) +# ./scripts/build.sh --test # test only (skip configure/build) +# ./scripts/build.sh --all # configure + build + test +# ./scripts/build.sh --clean # wipe build dir and exit +# +# Environment overrides: +# BUILD_DIR override build directory (default: /build) +# CMAKE_ARGS extra flags passed to cmake + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# The script lives under base/scripts/ so the actual repo root is one up. +SOURCE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +BUILD_DIR="${BUILD_DIR:-$SOURCE_DIR/build}" + +# ── parse args ─────────────────────────────────────────────────────────────── +DO_CONFIGURE=true +DO_BUILD=true + +for arg in "$@"; do + case "$arg" in + --configure) DO_BUILD=false; DO_TEST=false ;; + --build) DO_CONFIGURE=false; DO_TEST=false ;; + --test) DO_CONFIGURE=false; DO_BUILD=false ;; + --clean) + echo "[clean] removing $BUILD_DIR" + rm -rf "$BUILD_DIR" + exit 0 + ;; + *) echo "Unknown argument: $arg"; exit 1 ;; + esac +done + +# ── helpers ────────────────────────────────────────────────────────────────── +ok() { echo -e "\033[32m[ok]\033[0m $*"; } +info() { echo -e "\033[34m[info]\033[0m $*"; } +warn() { echo -e "\033[33m[warn]\033[0m $*"; } +die() { echo -e "\033[31m[error]\033[0m $*" >&2; exit 1; } + +# ── find nvcc ───────────────────────────────────────────────────────────────── +find_nvcc() { + if command -v nvcc &>/dev/null; then echo "nvcc" + elif [[ -x /usr/local/cuda/bin/nvcc ]]; then echo "/usr/local/cuda/bin/nvcc" + else die "nvcc not found in PATH or /usr/local/cuda/bin — CUDA toolkit required" + fi +} + +# ── prerequisites ───────────────────────────────────────────────────────────── +check_prereqs() { + info "Checking prerequisites..." + command -v cmake &>/dev/null || die "cmake not found (need >= 3.18)" + + NVCC_BIN=$(find_nvcc) + info "nvcc: $NVCC_BIN" + + # If nvcc is not in PATH, add its directory so cmake's FindCUDA can see it + if [[ "$NVCC_BIN" != "nvcc" ]]; then + export PATH="$(dirname "$NVCC_BIN"):$PATH" + info "Added $(dirname "$NVCC_BIN") to PATH" + fi + + CMAKE_VER=$(cmake --version | head -1 | awk '{print $3}') + info "cmake $CMAKE_VER" +} + +# ── submodules ──────────────────────────────────────────────────────────────── +init_submodules() { + info "Initialising git submodules..." + cd "$SOURCE_DIR" + git submodule update --init --recursive + ok "submodules ready" +} + +# ── configure ───────────────────────────────────────────────────────────────── +configure() { + info "Configuring (build dir: $BUILD_DIR)..." + # FetchContent fetches rkcommon, embree, and openvkl automatically at configure time. + cmake \ + -S "$SOURCE_DIR" \ + -B "$BUILD_DIR" \ + -DCMAKE_BUILD_TYPE=Release \ + -DOVR_BUILD_PYTHON_BINDINGS=ON \ + ${CMAKE_ARGS:-} + ok "configure done" +} + +# ── build ───────────────────────────────────────────────────────────────────── +build() { + JOBS=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4) + info "Building with $JOBS parallel jobs..." + cmake --build "$BUILD_DIR" --parallel "$JOBS" + ok "build done" +} + +# ── main ────────────────────────────────────────────────────────────────────── +check_prereqs +init_submodules + +$DO_CONFIGURE && configure +$DO_BUILD && build diff --git a/scripts/build_regent.sh b/scripts/build_regent.sh deleted file mode 100644 index 61deea1..0000000 --- a/scripts/build_regent.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -mkdir -p build -cd build - -# CUDA without OptiX -# unset OptiX_INSTALL_DIR -# ~/Software/cmake-3.22.1-linux-x86_64/bin/cmake /home/qadwu/Work/ovr \ -# -DOVR_BUILD_DEVICE_OPTIX7=OFF \ -# -DOVR_BUILD_DEVICE_OSPRAY=ON \ -# -Dospray_DIR=/home/qadwu/Software/ospray-2.6.0.x86_64.linux/lib/cmake/ospray-2.6.0 - -# without CUDA -unset OptiX_INSTALL_DIR -~/Software/cmake-3.22.1-linux-x86_64/bin/cmake /home/qadwu/Work/ovr \ - -DOVR_BUILD_DEVICE_OPTIX7=OFF \ - -DOVR_BUILD_DEVICE_OSPRAY=ON \ - -DOVR_BUILD_DEVICE_NNCACHE=OFF \ - -Dospray_DIR=/home/qadwu/Software/ospray-2.8.0.x86_64.linux/lib/cmake/ospray-2.8.0 diff --git a/scripts/build_release.bat b/scripts/build_release.bat deleted file mode 100644 index 183aa42..0000000 --- a/scripts/build_release.bat +++ /dev/null @@ -1,8 +0,0 @@ -mkdir build-release -cd build-release -cmake .. -G "Visual Studio 16 2019" -T host=x64 -A x64 ^ - -DCMAKE_BUILD_TYPE=Release -DOVR_BUILD_DEVICE_VIDI3D=ON ^ - -DCMAKE_PREFIX_PATH=C:\Users\wilson\Work\softwares\win\libtorch\libtorch-1.10.1-cu113\libtorch ^ - -Dospray_DIR=C:\Users\wilson\Work\softwares\intel-environment\ospray-2.5.0.x86_64.windows\lib\cmake\ospray-2.5.0 ^ - -DTBB_DIR=C:\Users\wilson\Work\softwares\intel-environment\oneapi-tbb-2021.1.1-win\oneapi-tbb-2021.1.1\lib\cmake\tbb -cmake --build . --config Release diff --git a/scripts/build_release.sh b/scripts/build_release.sh deleted file mode 100644 index c58e674..0000000 --- a/scripts/build_release.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - - -mkdir -p build -cd build -~qadwu/Software/cmake-3.22.1-linux-x86_64/bin/cmake $1 -Dospray_DIR=/home/qadwu/Software/ospray-2.6.0.x86_64.linux/lib/cmake/ospray-2.6.0 -DOVR_BUILD_DEVICE_OSPRAY=ON -~qadwu/Software/cmake-3.22.1-linux-x86_64/bin/cmake --build . --config Release --parallel 32 diff --git a/scripts/build_vkl.sh b/scripts/build_vkl.sh deleted file mode 100755 index 6699867..0000000 --- a/scripts/build_vkl.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -mkdir -p build -cd build -cmake -DOVR_BUILD_OPTIX7=OFF \ --DOVR_BUILD_OSPRAY=OFF \ --DOVR_BUILD_TORCH=OFF \ --DOVR_BUILD_SCENE_USD=OFF \ --DOVR_BUILD_DEVICE_VIDI3D=ON \ --DOVR_BUILD_OPENVKL=ON \ --Drkcommon_DIR="/home/davbauer/repos/openvkl/build/install/lib/cmake/rkcommon-1.10.0/" \ --Dopenvkl_DIR="/home/davbauer/repos/openvkl/build/install/lib/cmake/openvkl-1.3.1/" \ -.. - -cmake --build . --config Debug -j 16 diff --git a/scripts/run.sh b/scripts/run.sh deleted file mode 100644 index 33e2bdd..0000000 --- a/scripts/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -export CUDA_VISIBLE_DEVICES=0 -# export DISPLAY=:2 -# export LD_LIBRARY_PATH=/home/weishen/USD/lib:/home/qadwu/Software/Intel/ospray-2.5.0.x86_64.linux/lib:/home/qadwu/Software/ospray-2.8.0.x86_64.linux/lib:${LD_LIBRARY_PATH} - -export LD_LIBRARY_PATH=\ -/home/qadwu/Software/libtorch-shared-with-deps-1.12.1-cu116/libtorch/lib:\ -/home/davbauer/software/torch_tensorrt/lib:\ -/home/davbauer/software/TensorRT-8.2.3.0/lib:\ -/home/qadwu/Work/ovr/build/Release:${LD_LIBRARY_PATH}:\ -/home/qadwu/Work/ospray/build/Debug/install/lib:/home/qadwu/Work/ospray/deps/lib:/home/qadwu/Work/ospray/deps/lib/intel64/gcc4.8:\ -/home/weishen/USD/lib: - -vglrun $@