Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,107 @@ jobs:
cd build/gtests
ctest -C Release --output-on-failure --verbose

nanovdb-editor-build-and-test-windows-arm:
name: Build and Test (Windows ARM64)
runs-on: windows-11-arm
defaults:
run:
shell: pwsh
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build NanoVDB Editor (GLFW disabled)
run: |
./build.bat -rfv

- name: Build NanoVDB Editor (GLFW enabled)
run: |
./build.bat -rv

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: nanovdb-editor-build-windows-arm64
path: |
build/
retention-days: 2

- name: Install Mesa3D lavapipe
run: |
# Download Mesa lavapipe for Windows ARM64 (ARM64 binaries)
Write-Host "Downloading Mesa lavapipe for ARM64..."
$MesaUrl = "https://github.com/mmozeiko/build-mesa/releases/download/24.3.1/mesa-lavapipe-arm64-24.3.1.zip"
$MesaArchive = "$env:TEMP\mesa-lavapipe-arm64.zip"
$MesaDir = "$env:TEMP\mesa-lavapipe-arm64"

if (Test-Path $MesaDir) { Remove-Item -Recurse -Force $MesaDir }
New-Item -ItemType Directory -Path $MesaDir -Force | Out-Null

Invoke-WebRequest -Uri $MesaUrl -OutFile $MesaArchive

# Extract
Write-Host "Extracting Mesa..."
Expand-Archive -Path $MesaArchive -DestinationPath $MesaDir -Force

# Locate lavapipe DLL
$VulkanLvpDll = Get-ChildItem -Path $MesaDir -Recurse -File -Filter "vulkan_lvp.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
if (-not $VulkanLvpDll) {
Write-Host "ERROR: vulkan_lvp.dll not found in ARM64 lavapipe package!"
Get-ChildItem -Path $MesaDir -Recurse -File -Filter "vulkan*.dll" -ErrorAction SilentlyContinue |
Select-Object -First 50 FullName | Format-Table -AutoSize
exit 1
}
$MesaBinPath = Split-Path -Parent $VulkanLvpDll.FullName
Write-Host "Using lavapipe DLL: $($VulkanLvpDll.FullName)"
Write-Host "Using Mesa bin path: $MesaBinPath"

# Locate ICD JSON (prefer same directory)
$VulkanICDJson = Get-ChildItem -Path $MesaBinPath -File -Filter "lvp_icd*.json" -ErrorAction SilentlyContinue | Select-Object -First 1
if (-not $VulkanICDJson) {
$VulkanICDJson = Get-ChildItem -Path $MesaDir -Recurse -File -Filter "lvp_icd*.json" -ErrorAction SilentlyContinue | Select-Object -First 1
}
if (-not $VulkanICDJson) {
Write-Host "ERROR: lvp_icd*.json not found in ARM64 lavapipe package!"
Get-ChildItem -Path $MesaDir -Recurse -File -Filter "*.json" -ErrorAction SilentlyContinue |
Select-Object -First 50 FullName | Format-Table -AutoSize
exit 1
}
$VulkanICDPath = $VulkanICDJson.FullName
Write-Host "Using lavapipe ICD JSON: $VulkanICDPath"

# Prefer env var (no admin required)
"VK_ICD_FILENAMES=$VulkanICDPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"VK_DRIVER_FILES=$VulkanICDPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

# Best-effort registry registration (ignored if not permitted)
try {
$RegistryPath = "HKLM:\SOFTWARE\Khronos\Vulkan\Drivers"
if (-not (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
New-ItemProperty -Path $RegistryPath -Name $VulkanICDPath -Value 0 -PropertyType DWord -Force | Out-Null
Write-Host "Registry entry created: $VulkanICDPath"
} catch {
Write-Host "WARNING: Could not write Vulkan ICD registry entry: $($_.Exception.Message)"
}

# Add Mesa to PATH
echo "$MesaBinPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

# Optional sanity check
if (Get-Command vulkaninfo -ErrorAction SilentlyContinue) {
Write-Host "Running vulkaninfo --summary..."
vulkaninfo --summary || $true
} else {
Write-Host "vulkaninfo not found; skipping sanity check"
}

Write-Host "Lavapipe installed successfully for ARM64"

- name: Run GTests
run: |
cd build/gtests
ctest -C Release --output-on-failure --verbose

nanovdb-editor-build-and-test-linux-arm:
name: Build and Test (Linux ARM64)
runs-on: ubuntu-24.04-arm
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/build-wheels-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build Wheels (PR)

on:
pull_request:
branches:
- main
paths-ignore:
- 'CODEOWNERS'
- '**.md'
- 'dev_utils/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Build wheels and sdist
uses: ./.github/workflows/build-wheels.yml
with:
is_dev: false
44 changes: 33 additions & 11 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
validate_version:
name: Validate tag version matches VERSION.txt
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
outputs:
version_valid: ${{ steps.validate.outputs.version-valid }}
version_valid: ${{ steps.validate.outputs.version-valid || 'true' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Validate version
id: validate
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: ./.github/actions/validate-version
with:
allow-dev-suffix: ${{ inputs.is_dev }}
Expand All @@ -34,27 +34,50 @@ jobs:
name: Build (${{ matrix.os }}${{ matrix.arch && format(' {0}', matrix.arch) || '' }})
runs-on: ${{ matrix.os }}
needs: [validate_version]
if: ${{ !failure() && (github.event_name == 'workflow_dispatch' || needs.validate_version.outputs.version_valid == 'true') }}
if: ${{ !failure() && (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || needs.validate_version.outputs.version_valid == 'true') }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: x86_64
cibw_build: "cp311-manylinux_x86_64"
cibw_environment: >
CMAKE_ARGS="-DNANOVDB_EDITOR_PYPI_BUILD=ON -DNANOVDB_EDITOR_BUILD_TESTS=OFF -DNANOVDB_EDITOR_BUILD_SLANG_FROM_SOURCE=ON -DFETCHCONTENT_QUIET=OFF"
CPM_SOURCE_CACHE=/tmp/cpm-cache
- os: ubuntu-24.04-arm
arch: ARM64
cibw_build: "cp311-manylinux_aarch64"
cibw_environment: >
CMAKE_ARGS="-DNANOVDB_EDITOR_PYPI_BUILD=ON -DNANOVDB_EDITOR_BUILD_TESTS=OFF -DFETCHCONTENT_QUIET=OFF"
CPM_SOURCE_CACHE=/tmp/cpm-cache
- os: windows-latest
arch: ""
cibw_build: "cp311-win_amd64"
cibw_environment: >
CMAKE_ARGS="-DNANOVDB_EDITOR_PYPI_BUILD=ON -DNANOVDB_EDITOR_BUILD_TESTS=OFF -DFETCHCONTENT_QUIET=OFF"
CPM_SOURCE_CACHE=/tmp/cpm-cache
- os: windows-11-arm
arch: ARM64
cibw_build: "cp311-win_arm64"
cibw_environment: >
CMAKE_ARGS="-DNANOVDB_EDITOR_PYPI_BUILD=ON -DNANOVDB_EDITOR_BUILD_TESTS=OFF -DFETCHCONTENT_QUIET=OFF"
CPM_SOURCE_CACHE=/tmp/cpm-cache

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python (ARM64)
if: matrix.os == 'windows-11-arm'
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: arm64

- name: Set up Python
uses: actions/setup-python@v4
if: matrix.os != 'windows-11-arm'
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -69,10 +92,11 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_34_x86_64:latest
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_34_aarch64:latest
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS: ${{ matrix.arch == 'ARM64' && 'aarch64' || 'auto' }}
CIBW_ARCHS: ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || 'auto' }}
CIBW_ARCHS_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'ARM64' || 'auto' }}

# Linux dependencies
CIBW_BEFORE_ALL_LINUX: |
Expand All @@ -95,7 +119,7 @@ jobs:
if [[ "{wheel}" == *"aarch64"* ]]; then
auditwheel repair -w {dest_dir} {wheel} --lib-sdir .libs --plat manylinux_2_34_aarch64
else
auditwheel repair -w {dest_dir} {wheel} --lib-sdir .libs
auditwheel repair -w {dest_dir} {wheel} --lib-sdir .libs --plat manylinux_2_34_x86_64
fi

# Install test dependencies before testing
Expand All @@ -106,9 +130,7 @@ jobs:

# Mark this as a PyPI build, disable gtests for published wheels
# Add retry and timeout settings for CMake downloads
CIBW_ENVIRONMENT: >
CMAKE_ARGS="-DNANOVDB_EDITOR_PYPI_BUILD=ON -DNANOVDB_EDITOR_BUILD_TESTS=OFF -DFETCHCONTENT_QUIET=OFF"
CPM_SOURCE_CACHE=/tmp/cpm-cache
CIBW_ENVIRONMENT: ${{ matrix.cibw_environment }}
with:
package-dir: pymodule

Expand All @@ -121,7 +143,7 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
needs: [validate_version]
if: ${{ !failure() && (github.event_name == 'workflow_dispatch' || needs.validate_version.outputs.version_valid == 'true') }}
if: ${{ !failure() && (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || needs.validate_version.outputs.version_valid == 'true') }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
49 changes: 36 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ create_nanovdb_library(pnanovdbcompiler
SLANG_PROFILE=${NANOVDB_EDITOR_SLANG_PROFILE}
)

if(NANOVDB_EDITOR_BUILD_SLANG_FROM_SOURCE)
add_dependencies(pnanovdbcompiler slang_src_build)
endif()

if(NANOVDB_EDITOR_SLANG_DEBUG_OUTPUT)
target_compile_definitions(pnanovdbcompiler PRIVATE USE_SLANG_DEBUG_OUTPUT)
endif()
Expand Down Expand Up @@ -372,28 +376,47 @@ if(SKBUILD)
DESTINATION nanovdb_editor/lib
COMPONENT python_libs
)
if(SLANG_LLVM_EXISTS)
install(FILES
"${Slang_SOURCE_DIR}/bin/slang-llvm${CMAKE_SHARED_LIBRARY_SUFFIX}"
file(GLOB SLANG_LLVM_FILES "${Slang_SOURCE_DIR}/bin/slang-llvm*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
if(SLANG_LLVM_FILES)
install(FILES ${SLANG_LLVM_FILES}
DESTINATION nanovdb_editor/lib
COMPONENT python_libs
)
endif()
else()
# Note: libslang-compiler and libslang-glslang have version suffix in filename
install(FILES
"${Slang_SOURCE_DIR}/lib/libslang${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${Slang_SOURCE_DIR}/lib/libslang-compiler${CMAKE_SHARED_LIBRARY_SUFFIX}.0.${SLANG_VERSION}"
"${Slang_SOURCE_DIR}/lib/libslang-glslang-${SLANG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}"
DESTINATION nanovdb_editor/lib
COMPONENT python_libs
)
if(SLANG_LLVM_EXISTS)
if(NANOVDB_EDITOR_BUILD_SLANG_FROM_SOURCE)
# Install all slang libraries using install(CODE) to avoid configure-time path resolution
install(CODE "
file(GLOB SLANG_LIBS \"${Slang_SOURCE_DIR}/lib/libslang*.so*\")
foreach(lib \${SLANG_LIBS})
message(STATUS \"Installing: \${lib}\")
file(INSTALL \"\${lib}\" DESTINATION \"\${CMAKE_INSTALL_PREFIX}/nanovdb_editor/lib\")
endforeach()

# Install miniz dependency (required by Slang for ZIP/compression)
# miniz is built as a separate CPM dependency
file(GLOB MINIZ_LIBS \"${miniz_BINARY_DIR}/libminiz.so*\")
foreach(lib \${MINIZ_LIBS})
message(STATUS \"Installing miniz: \${lib}\")
file(INSTALL \"\${lib}\" DESTINATION \"\${CMAKE_INSTALL_PREFIX}/nanovdb_editor/lib\")
endforeach()
" COMPONENT python_libs)
else()
# Note: libslang-compiler and libslang-glslang have version suffix in filename
install(FILES
"${Slang_SOURCE_DIR}/lib/libslang-llvm${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${Slang_SOURCE_DIR}/lib/libslang${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${Slang_SOURCE_DIR}/lib/libslang-compiler${CMAKE_SHARED_LIBRARY_SUFFIX}.0.${SLANG_VERSION}"
"${Slang_SOURCE_DIR}/lib/libslang-glslang-${SLANG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}"
DESTINATION nanovdb_editor/lib
COMPONENT python_libs
)
file(GLOB SLANG_LLVM_FILES "${Slang_SOURCE_DIR}/lib/libslang-llvm*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
if(SLANG_LLVM_FILES)
install(FILES ${SLANG_LLVM_FILES}
DESTINATION nanovdb_editor/lib
COMPONENT python_libs
)
endif()
endif()
endif()
endif()
Expand Down
1 change: 1 addition & 0 deletions cmake/build_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ option(NANOVDB_EDITOR_ENABLE_LTO "Enable Link Time Optimization" ON)
option(NANOVDB_EDITOR_DIST_PACKAGE "Create distribution package" OFF)
option(NANOVDB_EDITOR_FORCE_REBUILD_DEPS "Force rebuild all dependencies (clears dependencies cache)" OFF)
option(NANOVDB_EDITOR_USE_GLFW "Use GLFW, not needed for streaming only, when OFF, Vulkan loadeer is built to ensure streaming compatibility" ON)
option(NANOVDB_EDITOR_BUILD_SLANG_FROM_SOURCE "Build Slang from source instead of downloading prebuilt binaries (Linux x86 only; intended for wheel builds)" OFF)

# H264 support is disabled on Windows due to openh264 requiring Unix build tools (make, tr, etc.)
if(WIN32)
Expand Down
Loading
Loading