warp-optix 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. warp_optix-0.2.1/.clang-format +13 -0
  2. warp_optix-0.2.1/.github/actionlint.yaml +7 -0
  3. warp_optix-0.2.1/.github/copy-pr-bot.yaml +9 -0
  4. warp_optix-0.2.1/.github/workflows/gpu-platform.yml +134 -0
  5. warp_optix-0.2.1/.github/workflows/lint.yml +33 -0
  6. warp_optix-0.2.1/.github/workflows/release.yml +113 -0
  7. warp_optix-0.2.1/.github/workflows/tests.yml +44 -0
  8. warp_optix-0.2.1/.gitignore +7 -0
  9. warp_optix-0.2.1/.pre-commit-config.yaml +28 -0
  10. warp_optix-0.2.1/.python-version +1 -0
  11. warp_optix-0.2.1/CMakeLists.txt +122 -0
  12. warp_optix-0.2.1/CONTRIBUTING.md +6 -0
  13. warp_optix-0.2.1/LICENSE.md +201 -0
  14. warp_optix-0.2.1/LICENSE.txt +26 -0
  15. warp_optix-0.2.1/OptiX_LICENSE.txt +66 -0
  16. warp_optix-0.2.1/PKG-INFO +114 -0
  17. warp_optix-0.2.1/README.md +159 -0
  18. warp_optix-0.2.1/SECURITY.md +31 -0
  19. warp_optix-0.2.1/THIRD_PARTY_NOTICES.txt +86 -0
  20. warp_optix-0.2.1/cmake/CheckOptixVersion.cmake +46 -0
  21. warp_optix-0.2.1/docs/publishing.md +114 -0
  22. warp_optix-0.2.1/docs/pyoptix-dependency.md +60 -0
  23. warp_optix-0.2.1/docs/pypi.md +68 -0
  24. warp_optix-0.2.1/examples_warp/README.md +162 -0
  25. warp_optix-0.2.1/examples_warp/example_warp_optix_basic_pathtracing.py +328 -0
  26. warp_optix-0.2.1/examples_warp/example_warp_optix_chess_scene.py +856 -0
  27. warp_optix-0.2.1/examples_warp/example_warp_optix_curves.py +141 -0
  28. warp_optix-0.2.1/examples_warp/example_warp_optix_explicit_params.py +74 -0
  29. warp_optix-0.2.1/examples_warp/example_warp_optix_kernels.py +59 -0
  30. warp_optix-0.2.1/examples_warp/example_warp_optix_mixed_geometry.py +406 -0
  31. warp_optix-0.2.1/examples_warp/example_warp_optix_motion_blur.py +145 -0
  32. warp_optix-0.2.1/examples_warp/example_warp_optix_pathtraced_arrowball.py +200 -0
  33. warp_optix-0.2.1/examples_warp/example_warp_optix_pathtraced_contact_lines.py +224 -0
  34. warp_optix-0.2.1/examples_warp/example_warp_optix_pathtraced_hairball.py +252 -0
  35. warp_optix-0.2.1/examples_warp/example_warp_optix_pathtraced_scene.py +115 -0
  36. warp_optix-0.2.1/examples_warp/example_warp_optix_tiny_raytracer.py +623 -0
  37. warp_optix-0.2.1/examples_warp/example_warp_optix_usd_pathtracing.py +399 -0
  38. warp_optix-0.2.1/examples_warp/neural_texture/README.md +186 -0
  39. warp_optix-0.2.1/examples_warp/neural_texture/benchmark_outputs.py +215 -0
  40. warp_optix-0.2.1/examples_warp/neural_texture/compress.py +121 -0
  41. warp_optix-0.2.1/examples_warp/neural_texture/conftest.py +3 -0
  42. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/__init__.py +118 -0
  43. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/device.py +226 -0
  44. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/evaluation.py +107 -0
  45. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/format.py +421 -0
  46. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/reference.py +208 -0
  47. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/runtime.py +213 -0
  48. warp_optix-0.2.1/examples_warp/neural_texture/neural_texture/training.py +719 -0
  49. warp_optix-0.2.1/examples_warp/neural_texture/tests/test_automatic.py +171 -0
  50. warp_optix-0.2.1/examples_warp/neural_texture/tests/test_device_inference.py +97 -0
  51. warp_optix-0.2.1/examples_warp/neural_texture/tests/test_format.py +152 -0
  52. warp_optix-0.2.1/examples_warp/neural_texture/tests/test_latent_quantization.py +37 -0
  53. warp_optix-0.2.1/examples_warp/neural_texture/tests/test_runtime.py +78 -0
  54. warp_optix-0.2.1/examples_warp/neural_texture/tests/test_training.py +180 -0
  55. warp_optix-0.2.1/licenses/nvpro_core-NOTICE.txt +125 -0
  56. warp_optix-0.2.1/licenses/pybind11-LICENSE.txt +29 -0
  57. warp_optix-0.2.1/licenses/vk_denoise_dlssrr-NOTICE.txt +18 -0
  58. warp_optix-0.2.1/pyproject.toml +200 -0
  59. warp_optix-0.2.1/src/extension.cpp +349 -0
  60. warp_optix-0.2.1/src/pyoptix_compat.h +131 -0
  61. warp_optix-0.2.1/uv.lock +654 -0
  62. warp_optix-0.2.1/warp_optix/README.md +722 -0
  63. warp_optix-0.2.1/warp_optix/tests/conftest.py +85 -0
  64. warp_optix-0.2.1/warp_optix/tests/test_backend_dependency.py +174 -0
  65. warp_optix-0.2.1/warp_optix/tests/test_color_utils.py +40 -0
  66. warp_optix-0.2.1/warp_optix/tests/test_coop_vec.py +151 -0
  67. warp_optix-0.2.1/warp_optix/tests/test_core.py +594 -0
  68. warp_optix-0.2.1/warp_optix/tests/test_custom_geometry.py +220 -0
  69. warp_optix-0.2.1/warp_optix/tests/test_denoising.py +245 -0
  70. warp_optix-0.2.1/warp_optix/tests/test_device_queries.py +483 -0
  71. warp_optix-0.2.1/warp_optix/tests/test_environment_map.py +19 -0
  72. warp_optix-0.2.1/warp_optix/tests/test_gl_interop.py +109 -0
  73. warp_optix-0.2.1/warp_optix/tests/test_gl_line_overlay.py +94 -0
  74. warp_optix-0.2.1/warp_optix/tests/test_gltf_asset_loaders.py +95 -0
  75. warp_optix-0.2.1/warp_optix/tests/test_hdr_loader.py +23 -0
  76. warp_optix-0.2.1/warp_optix/tests/test_launch_params.py +325 -0
  77. warp_optix-0.2.1/warp_optix/tests/test_lighting.py +398 -0
  78. warp_optix-0.2.1/warp_optix/tests/test_materials.py +79 -0
  79. warp_optix-0.2.1/warp_optix/tests/test_module_compile_metadata.py +100 -0
  80. warp_optix-0.2.1/warp_optix/tests/test_optix_sdk_version.py +41 -0
  81. warp_optix-0.2.1/warp_optix/tests/test_pathtraced_arrowball_example.py +56 -0
  82. warp_optix-0.2.1/warp_optix/tests/test_pathtraced_hairball_example.py +75 -0
  83. warp_optix-0.2.1/warp_optix/tests/test_pathtracing_curves.py +189 -0
  84. warp_optix-0.2.1/warp_optix/tests/test_pathtracing_defaults.py +22 -0
  85. warp_optix-0.2.1/warp_optix/tests/test_pathtracing_mesh.py +74 -0
  86. warp_optix-0.2.1/warp_optix/tests/test_pathtracing_render_regressions.py +117 -0
  87. warp_optix-0.2.1/warp_optix/tests/test_pathtracing_viewer_api.py +758 -0
  88. warp_optix-0.2.1/warp_optix/tests/test_payload_builtins.py +148 -0
  89. warp_optix-0.2.1/warp_optix/tests/test_procedural_chess.py +176 -0
  90. warp_optix-0.2.1/warp_optix/tests/test_public_api.py +94 -0
  91. warp_optix-0.2.1/warp_optix/tests/test_resource_ownership.py +447 -0
  92. warp_optix-0.2.1/warp_optix/tests/test_sbt_builder.py +209 -0
  93. warp_optix-0.2.1/warp_optix/tests/test_tonemap.py +139 -0
  94. warp_optix-0.2.1/warp_optix/tests/test_usd_example_helpers.py +88 -0
  95. warp_optix-0.2.1/warp_optix/tests/test_usd_materials.py +841 -0
  96. warp_optix-0.2.1/warp_optix/tests/test_usd_scene.py +313 -0
  97. warp_optix-0.2.1/warp_optix/warp_optix/__init__.py +89 -0
  98. warp_optix-0.2.1/warp_optix/warp_optix/_backend.py +126 -0
  99. warp_optix-0.2.1/warp_optix/warp_optix/_native/include/warp_optix_builtins.h +658 -0
  100. warp_optix-0.2.1/warp_optix/warp_optix/_version.py +14 -0
  101. warp_optix-0.2.1/warp_optix/warp_optix/accel.py +644 -0
  102. warp_optix-0.2.1/warp_optix/warp_optix/addon.py +45 -0
  103. warp_optix-0.2.1/warp_optix/warp_optix/builtins.py +264 -0
  104. warp_optix-0.2.1/warp_optix/warp_optix/config.py +15 -0
  105. warp_optix-0.2.1/warp_optix/warp_optix/context.py +250 -0
  106. warp_optix-0.2.1/warp_optix/warp_optix/enums.py +88 -0
  107. warp_optix-0.2.1/warp_optix/warp_optix/gl/__init__.py +9 -0
  108. warp_optix-0.2.1/warp_optix/warp_optix/gl/interop.py +251 -0
  109. warp_optix-0.2.1/warp_optix/warp_optix/gl/line_overlay.py +515 -0
  110. warp_optix-0.2.1/warp_optix/warp_optix/native.py +18 -0
  111. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/__init__.py +66 -0
  112. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/arrows.py +211 -0
  113. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/asset_loaders.py +566 -0
  114. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/camera.py +253 -0
  115. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/color_utils.py +43 -0
  116. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/defaults.py +10 -0
  117. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/denoising.py +289 -0
  118. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/environment_map.py +361 -0
  119. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/func_common.py +237 -0
  120. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/handles.py +80 -0
  121. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/hdr_loader.py +205 -0
  122. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/lighting.py +8 -0
  123. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/materials.py +501 -0
  124. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/pathtracer_api.py +1082 -0
  125. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/pathtracing_viewer.py +1261 -0
  126. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/pathtracing_warp_kernels.py +3993 -0
  127. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/scene.py +2001 -0
  128. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/sky_lut.py +26 -0
  129. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/tonemap.py +506 -0
  130. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/transform_utils.py +87 -0
  131. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/usd_loader.py +1614 -0
  132. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/usd_scene.py +216 -0
  133. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/viewer.py +1626 -0
  134. warp_optix-0.2.1/warp_optix/warp_optix/pathtracing/volume_composite.py +166 -0
  135. warp_optix-0.2.1/warp_optix/warp_optix/pipeline.py +631 -0
  136. warp_optix-0.2.1/warp_optix/warp_optix/program.py +182 -0
  137. warp_optix-0.2.1/warp_optix/warp_optix/py.typed +0 -0
  138. warp_optix-0.2.1/warp_optix/warp_optix/rays.py +106 -0
  139. warp_optix-0.2.1/warp_optix/warp_optix/sbt.py +213 -0
@@ -0,0 +1,13 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ BasedOnStyle: LLVM
5
+ IndentWidth: 4
6
+ ColumnLimit: 120
7
+ AccessModifierOffset: -4
8
+ AllowShortFunctionsOnASingleLine: Inline
9
+ AllowShortIfStatementsOnASingleLine: Never
10
+ AllowShortLoopsOnASingleLine: false
11
+ BreakBeforeBraces: Attach
12
+ PointerAlignment: Left
13
+ SortIncludes: Never
@@ -0,0 +1,7 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ self-hosted-runner:
5
+ labels:
6
+ - linux-amd64-gpu-rtxpro6000-latest-1
7
+ - windows-amd64-gpu-rtxpro6000-latest-1
@@ -0,0 +1,9 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # NVIDIA copy-pr-bot copies vetted PR commits to pull-request/<N> branches.
5
+ # This exact filename is required; configuration takes effect on main.
6
+ # https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/
7
+ enabled: true
8
+ auto_sync_ready: true
9
+ auto_sync_draft: false
@@ -0,0 +1,134 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Builds the wheel for one platform and tests it on that platform's GPU runner.
5
+ # Called once per platform so a failed build only skips its own GPU tests.
6
+
7
+ name: GPU platform
8
+
9
+ on:
10
+ workflow_call:
11
+ inputs:
12
+ platform:
13
+ description: Platform name for artifacts, e.g. linux-x86_64
14
+ required: true
15
+ type: string
16
+ build-os:
17
+ description: GitHub-hosted runner that builds the wheels
18
+ required: true
19
+ type: string
20
+ gpu-runner:
21
+ description: NVIDIA self-hosted GPU runner that tests the wheels
22
+ required: true
23
+ type: string
24
+ release:
25
+ description: Test release wheels without restoring or saving caches
26
+ default: false
27
+ type: boolean
28
+ outputs:
29
+ wheel-sha256:
30
+ description: SHA-256 of the warp-optix wheel from the GitHub-hosted build
31
+ value: ${{ jobs.build.outputs.wheel-sha256 }}
32
+
33
+ permissions:
34
+ contents: read
35
+
36
+ jobs:
37
+ # The NVIDIA GPU runner images ship without compilers, so wheels are built on
38
+ # GitHub-hosted runners and only tested on the GPU runners. Building needs a
39
+ # C++ compiler only: cuda.h comes from a pip build requirement and PyOptiX
40
+ # from its PyPI wheel. Linux wheels are built in a manylinux container.
41
+ build:
42
+ name: Build wheels
43
+ runs-on: ${{ inputs.build-os }}
44
+ timeout-minutes: 30
45
+ outputs:
46
+ wheel-sha256: ${{ steps.wheel-hash.outputs.sha256 }}
47
+ steps:
48
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
49
+ with:
50
+ persist-credentials: false
51
+ # The Python version, manylinux policy and repair step are in pyproject.toml.
52
+ - name: Build wheels
53
+ uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5
54
+ # Export the digest directly from this hosted job, independently of the
55
+ # artifact storage shared with the self-hosted test job.
56
+ - name: Record warp-optix wheel hash
57
+ id: wheel-hash
58
+ shell: bash
59
+ run: |
60
+ wheels=(wheelhouse/*.whl)
61
+ if [ "${#wheels[@]}" -ne 1 ]; then
62
+ echo "::error::Expected one wheel, found ${wheels[*]}"
63
+ exit 1
64
+ fi
65
+ echo "sha256=$(sha256sum "${wheels[0]}" | cut -d ' ' -f 1)" >> "$GITHUB_OUTPUT"
66
+ - name: Upload wheel
67
+ uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
68
+ with:
69
+ name: wheel-${{ inputs.platform }}
70
+ path: wheelhouse/*.whl
71
+ retention-days: 7
72
+ if-no-files-found: error
73
+
74
+ test:
75
+ name: Full suite on RTX PRO 6000
76
+ needs: build
77
+ runs-on: ${{ inputs.gpu-runner }}
78
+ timeout-minutes: 30
79
+ steps:
80
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
81
+ with:
82
+ persist-credentials: false
83
+ - name: Verify NVIDIA GPU
84
+ run: nvidia-smi
85
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
86
+ with:
87
+ version: "0.12.2"
88
+ python-version: "3.12"
89
+ enable-cache: ${{ !inputs.release }}
90
+ # The Windows runner image ships msvcp140.dll 14.0 from VS 2015.
91
+ # Prebuilt wheels such as usd-core need 14.40 or later.
92
+ - name: Install VC++ Redistributable
93
+ if: runner.os == 'Windows'
94
+ run: |
95
+ $installer = "$env:RUNNER_TEMP\vc_redist.x64.exe"
96
+ Invoke-WebRequest https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile $installer
97
+ $signature = Get-AuthenticodeSignature $installer
98
+ if ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notmatch 'O=Microsoft Corporation') {
99
+ throw "Unexpected installer signature: $($signature.Status) $($signature.SignerCertificate.Subject)"
100
+ }
101
+ $process = Start-Process $installer -ArgumentList '/install', '/quiet', '/norestart' -Wait -PassThru
102
+ if ($process.ExitCode -notin 0, 3010) { throw "vc_redist.x64.exe failed with exit code $($process.ExitCode)" }
103
+ - name: Download wheel
104
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
105
+ with:
106
+ name: wheel-${{ inputs.platform }}
107
+ path: dist
108
+ - name: Install locked dependencies and the built wheel
109
+ shell: bash
110
+ run: |
111
+ uv sync --locked --no-install-project --group test --all-extras
112
+ uv pip install --no-deps dist/*.whl
113
+ - name: Cache Warp kernels
114
+ if: ${{ !inputs.release }}
115
+ uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
116
+ with:
117
+ path: ${{ runner.temp }}/warp-kernel-cache
118
+ # Keep platforms and dependencies separate. Restore the latest compatible
119
+ # cache across commits; Warp hashes module contents to rebuild changed kernels.
120
+ key: warp-kernels-v1-${{ inputs.gpu-runner }}-py3.12-${{ hashFiles('uv.lock') }}-${{ github.sha }}
121
+ restore-keys: |
122
+ warp-kernels-v1-${{ inputs.gpu-runner }}-py3.12-${{ hashFiles('uv.lock') }}-
123
+ - name: Run full suite with CUDA required
124
+ env:
125
+ WARP_CACHE_PATH: ${{ runner.temp }}/warp-kernel-cache
126
+ run: uv run --no-sync pytest warp_optix/tests examples_warp/neural_texture --require-cuda --junitxml=test-results/cuda.xml
127
+ - name: Upload test results
128
+ if: always()
129
+ uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
130
+ with:
131
+ name: tests-${{ inputs.platform }}
132
+ path: test-results/
133
+ retention-days: 14
134
+ if-no-files-found: warn
@@ -0,0 +1,33 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ name: Lint
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ - develop
11
+ # NVIDIA copy-pr-bot copies vetted PR commits to these branches.
12
+ - "pull-request/[0-9]+"
13
+ workflow_dispatch:
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ concurrency:
19
+ group: lint-${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
21
+
22
+ jobs:
23
+ pre-commit:
24
+ name: Format, lint, spelling and types
25
+ runs-on: ubuntu-24.04
26
+ steps:
27
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28
+ with:
29
+ persist-credentials: false
30
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
31
+ # The hooks do not need CUDA, a GPU or the warp-optix build.
32
+ - name: Run pre-commit hooks
33
+ run: uvx pre-commit run --all-files --show-diff-on-failure --color always
@@ -0,0 +1,113 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ name: Release
5
+
6
+ on:
7
+ push:
8
+ tags:
9
+ - "v*"
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: release-${{ github.ref }}
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ linux:
20
+ name: Build and test Linux wheel
21
+ if: github.repository == 'NVIDIA/warp-optix'
22
+ uses: ./.github/workflows/gpu-platform.yml
23
+ with:
24
+ platform: linux-x86_64
25
+ build-os: ubuntu-24.04
26
+ gpu-runner: linux-amd64-gpu-rtxpro6000-latest-1
27
+ release: true
28
+
29
+ windows:
30
+ name: Build and test Windows wheel
31
+ if: github.repository == 'NVIDIA/warp-optix'
32
+ uses: ./.github/workflows/gpu-platform.yml
33
+ with:
34
+ platform: windows-x86_64
35
+ build-os: windows-2022
36
+ gpu-runner: windows-amd64-gpu-rtxpro6000-latest-1
37
+ release: true
38
+
39
+ prepare:
40
+ name: Validate release distributions
41
+ needs: [linux, windows]
42
+ runs-on: ubuntu-24.04
43
+ timeout-minutes: 10
44
+ steps:
45
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
46
+ with:
47
+ fetch-depth: 0
48
+ persist-credentials: false
49
+ - name: Require the tagged commit to be on main
50
+ run: git merge-base --is-ancestor "$GITHUB_SHA" origin/main
51
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
52
+ with:
53
+ version: "0.12.2"
54
+ python-version: "3.12"
55
+ enable-cache: false
56
+ # Build the sdist before anything is downloaded into the checkout.
57
+ - name: Build the source distribution
58
+ run: uv build --sdist --out-dir sdist
59
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
60
+ with:
61
+ name: wheel-linux-x86_64
62
+ path: wheels/linux-x86_64
63
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
64
+ with:
65
+ name: wheel-windows-x86_64
66
+ path: wheels/windows-x86_64
67
+ # Stage the distributions only if their version matches the tag and each
68
+ # wheel is exactly what its GitHub-hosted build job produced.
69
+ - name: Verify the distributions and match the release tag
70
+ env:
71
+ RELEASE_TAG: ${{ github.ref_name }}
72
+ LINUX_WHEEL_SHA256: ${{ needs.linux.outputs.wheel-sha256 }}
73
+ WINDOWS_WHEEL_SHA256: ${{ needs.windows.outputs.wheel-sha256 }}
74
+ run: |
75
+ version=$(uv version --short)
76
+ if [ "$RELEASE_TAG" != "v$version" ]; then
77
+ echo "::error::Tag must be v$version, got $RELEASE_TAG"
78
+ exit 1
79
+ fi
80
+ mkdir publish-dist
81
+ stage() {
82
+ echo "$2 $1" | sha256sum --check --strict
83
+ cp "$1" publish-dist/
84
+ }
85
+ stage wheels/linux-x86_64/warp_optix-"$version"-cp312-cp312-*manylinux_2_28_x86_64.whl "$LINUX_WHEEL_SHA256"
86
+ stage wheels/windows-x86_64/warp_optix-"$version"-cp312-cp312-win_amd64.whl "$WINDOWS_WHEEL_SHA256"
87
+ cp sdist/warp_optix-"$version".tar.gz publish-dist/
88
+ - name: Check package metadata
89
+ run: uvx twine==7.0.0 check --strict publish-dist/*
90
+ - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
91
+ with:
92
+ name: pypi-distributions
93
+ path: publish-dist/*
94
+ retention-days: 7
95
+ if-no-files-found: error
96
+
97
+ publish:
98
+ name: Publish to PyPI
99
+ needs: prepare
100
+ runs-on: ubuntu-24.04
101
+ timeout-minutes: 10
102
+ environment:
103
+ name: pypi
104
+ url: https://pypi.org/p/warp-optix
105
+ permissions:
106
+ id-token: write
107
+ steps:
108
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
109
+ with:
110
+ name: pypi-distributions
111
+ path: dist
112
+ - name: Publish with Trusted Publishing
113
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
@@ -0,0 +1,44 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ name: GPU tests
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ - develop
11
+ # NVIDIA copy-pr-bot copies vetted PR commits to these branches.
12
+ # Do not run pull_request events directly on the NVIDIA runners.
13
+ - "pull-request/[0-9]+"
14
+ schedule:
15
+ - cron: "0 6 * * *"
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ concurrency:
22
+ group: tests-${{ github.workflow }}-${{ github.ref }}
23
+ cancel-in-progress: true
24
+
25
+ jobs:
26
+ gpu:
27
+ name: ${{ matrix.os-name }}
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ include:
32
+ - os-name: Linux
33
+ platform: linux-x86_64
34
+ build-os: ubuntu-24.04
35
+ gpu-runner: linux-amd64-gpu-rtxpro6000-latest-1
36
+ - os-name: Windows
37
+ platform: windows-x86_64
38
+ build-os: windows-2022
39
+ gpu-runner: windows-amd64-gpu-rtxpro6000-latest-1
40
+ uses: ./.github/workflows/gpu-platform.yml
41
+ with:
42
+ platform: ${{ matrix.platform }}
43
+ build-os: ${{ matrix.build-os }}
44
+ gpu-runner: ${{ matrix.gpu-runner }}
@@ -0,0 +1,7 @@
1
+ __pycache__/
2
+ env/
3
+ build/
4
+ dist/
5
+ wheelhouse/
6
+ *.egg-info/
7
+ third_party/
@@ -0,0 +1,28 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Run `pip install pre-commit && pre-commit install` to check on every commit.
5
+ # CI runs the same hooks via `pre-commit run --all-files`.
6
+ repos:
7
+ - repo: https://github.com/astral-sh/ruff-pre-commit
8
+ rev: v0.17.3
9
+ hooks:
10
+ - id: ruff-check
11
+ args: [--fix]
12
+ - id: ruff-format
13
+ - repo: https://github.com/crate-ci/typos
14
+ rev: v1.51.1
15
+ hooks:
16
+ - id: typos
17
+ - repo: https://github.com/pre-commit/mirrors-clang-format
18
+ rev: v23.1.3
19
+ hooks:
20
+ - id: clang-format
21
+ types_or: [c++, c, cuda]
22
+ files: ^src/
23
+ - repo: https://github.com/RobertCraigie/pyright-python
24
+ rev: v1.1.414
25
+ hooks:
26
+ - id: pyright
27
+ # Use [tool.pyright] in pyproject.toml rather than the staged file list.
28
+ pass_filenames: false
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,122 @@
1
+ # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
2
+ # SPDX-License-Identifier: BSD-3-Clause
3
+ # Use of this source code is governed by a BSD-style
4
+ # license that can be found in LICENSE.txt.
5
+
6
+ cmake_minimum_required(VERSION 3.17...3.31)
7
+
8
+ # Use scikit-build-core provided project name and version
9
+ project(
10
+ ${SKBUILD_PROJECT_NAME}
11
+ VERSION ${SKBUILD_PROJECT_VERSION}
12
+ LANGUAGES CXX
13
+ )
14
+
15
+ #------------------------------------------------------------------------------
16
+ # Python and pybind11
17
+ #------------------------------------------------------------------------------
18
+
19
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
20
+ find_package(pybind11 CONFIG REQUIRED)
21
+
22
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
23
+
24
+ #------------------------------------------------------------------------------
25
+ # Fetch OptiX headers from NVIDIA/optix-dev repository
26
+ #------------------------------------------------------------------------------
27
+
28
+ include(FetchContent)
29
+ include(CheckOptixVersion)
30
+
31
+ # The headers are fetched as an archive of an immutable commit and verified
32
+ # against a SHA512 hash, so a moved tag or tampered download fails the build
33
+ # instead of compiling unverified code. The header digest also covers local
34
+ # copies supplied through FETCHCONTENT_SOURCE_DIR_OPTIX_HEADERS. Update all
35
+ # values together when the pyoptix pin moves to a new OptiX SDK (the commit is
36
+ # what the optix-dev tag v<version> points to). PyOptiX releases are numbered
37
+ # after the SDK they wrap, so pyoptix 9.1.x wraps OptiX 9.1.0.
38
+ set(WARP_OPTIX_OPTIX_VERSION "9.1.0")
39
+ set(_optix_headers_commit "f1f6dd803f3159992d248178f6e09421c6eb8b6d")
40
+ set(_optix_headers_sha512 "54f98235206d0156552f8004438c072e0796c16d75a2cb9abc0367ce5d00b281d2ec34173316bf8c34e81e302bc0042f1dcbe3d17ac7a0ee980a14493991d7a1")
41
+ set(_optix_headers_digest "119d657b3401b5ce5b1e81115c0f181b75d83a9a57811fa0a1ebc9edb4f68a58")
42
+
43
+ string(REGEX MATCH "^[0-9]+\\.[0-9]+" _optix_major_minor "${WARP_OPTIX_OPTIX_VERSION}")
44
+ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml" _project_metadata)
45
+ string(REGEX MATCH "\"pyoptix==([0-9]+\\.[0-9]+)\\.[0-9]+\"" _pyoptix_requirement "${_project_metadata}")
46
+ if(NOT _pyoptix_requirement OR NOT CMAKE_MATCH_1 STREQUAL _optix_major_minor)
47
+ message(FATAL_ERROR
48
+ "The pyoptix pin in pyproject.toml must wrap OptiX ${WARP_OPTIX_OPTIX_VERSION}; "
49
+ "update the pinned OptiX headers commit and hashes in CMakeLists.txt together with it")
50
+ endif()
51
+
52
+ message(STATUS "Fetching OptiX headers from NVIDIA/optix-dev@${_optix_headers_commit}...")
53
+ FetchContent_Declare(
54
+ optix_headers
55
+ URL https://github.com/NVIDIA/optix-dev/archive/${_optix_headers_commit}.tar.gz
56
+ URL_HASH SHA512=${_optix_headers_sha512}
57
+ )
58
+ FetchContent_MakeAvailable(optix_headers)
59
+ warp_optix_check_optix_version("${optix_headers_SOURCE_DIR}/include/optix.h"
60
+ "${WARP_OPTIX_OPTIX_VERSION}")
61
+ warp_optix_check_optix_headers("${optix_headers_SOURCE_DIR}/include"
62
+ "${_optix_headers_digest}")
63
+
64
+ # Create OptiX::OptiX interface target using fetched headers
65
+ add_library(OptiX::OptiX INTERFACE IMPORTED)
66
+ target_include_directories(OptiX::OptiX INTERFACE ${optix_headers_SOURCE_DIR}/include)
67
+
68
+ message(STATUS "Using OptiX headers from: ${optix_headers_SOURCE_DIR}/include")
69
+
70
+ # The OptiX function table includes cuda.h for driver API types. The extension
71
+ # resolves the one driver function it calls at runtime, so it links no CUDA
72
+ # library and needs no CUDA Toolkit: the header comes from the
73
+ # nvidia-cuda-runtime-cu12 build requirement, or from CUDA_PATH when set.
74
+ execute_process(
75
+ COMMAND "${Python_EXECUTABLE}" -c
76
+ "import nvidia.cuda_runtime, pathlib; print(pathlib.Path(nvidia.cuda_runtime.__path__[0], 'include').as_posix())"
77
+ OUTPUT_VARIABLE _cuda_runtime_wheel_include
78
+ OUTPUT_STRIP_TRAILING_WHITESPACE
79
+ ERROR_QUIET)
80
+ # Isolated build environments are temporary, so search again on every configure.
81
+ unset(WARP_OPTIX_CUDA_INCLUDE_DIR CACHE)
82
+ find_path(WARP_OPTIX_CUDA_INCLUDE_DIR cuda.h
83
+ HINTS "${_cuda_runtime_wheel_include}" "$ENV{CUDA_PATH}/include"
84
+ REQUIRED)
85
+ message(STATUS "Using cuda.h from: ${WARP_OPTIX_CUDA_INCLUDE_DIR}")
86
+
87
+ #------------------------------------------------------------------------------
88
+ # Main build
89
+ #------------------------------------------------------------------------------
90
+
91
+ python_add_library(_ext MODULE src/extension.cpp WITH_SOABI)
92
+ set_target_properties(_ext PROPERTIES
93
+ CXX_VISIBILITY_PRESET hidden
94
+ VISIBILITY_INLINES_HIDDEN ON
95
+ )
96
+
97
+ target_include_directories(_ext SYSTEM PRIVATE "${WARP_OPTIX_CUDA_INCLUDE_DIR}")
98
+ target_link_libraries(_ext PRIVATE
99
+ OptiX::OptiX
100
+ pybind11::headers
101
+ ${CMAKE_DL_LIBS}
102
+ )
103
+
104
+
105
+ target_compile_features(_ext PRIVATE cxx_std_17)
106
+
107
+ # MSVC 17.10+ constructs std::mutex constexpr, which crashes on lock when an
108
+ # msvcp140.dll older than 14.40 is loaded. Keep the wheel safe on such systems.
109
+ if(MSVC)
110
+ target_compile_definitions(_ext PRIVATE _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
111
+ endif()
112
+
113
+ # The dependency owns optix._optix. Install only our supplemental extension,
114
+ # and shader headers under warp_optix.
115
+ set(WARP_OPTIX_INSTALL_DIR "${SKBUILD_PLATLIB_DIR}/warp_optix")
116
+ install(TARGETS _ext DESTINATION ${WARP_OPTIX_INSTALL_DIR})
117
+ # Warp compiles OptiX kernels at runtime, so wheels need the unmodified SDK
118
+ # headers as well as the extension. These retain their separate SDK license.
119
+ install(DIRECTORY "${optix_headers_SOURCE_DIR}/include/"
120
+ DESTINATION ${WARP_OPTIX_INSTALL_DIR}/include)
121
+ install(FILES "${optix_headers_SOURCE_DIR}/LICENSE.txt"
122
+ DESTINATION ${WARP_OPTIX_INSTALL_DIR}/include RENAME OptiX_LICENSE.txt)
@@ -0,0 +1,6 @@
1
+ # Contributions
2
+
3
+ This project is currently not accepting contributions.
4
+
5
+ We plan to accept outside contributions in the future. Contribution guidelines
6
+ will be published here when contributions open.