Skip to content

Commit 8b8b2fb

Browse files
Lumengineclaude
andcommitted
ci: fix GPU build ptxas OOM and packaging
- Set PX_GENERATE_GPU_REDUCED_ARCHITECTURES=True in vc17win64-gpu-md preset. The full set (sm_70/75/80/86/89/90) combined with nvcc -t0 parallelism crashes ptxas with ACCESS_VIOLATION on the 16 GB GitHub Windows runner; reduced arches build one SM + PTX fallback (JIT covers any sm_70+ GPU at first run). - Derive archive name from the git tag so v5.6.0-gpu.1 produces Physx-5.6.0-gpu.1.win.x86_64.vc143.md.{config}.zip (matches the pattern Lumengine's physx.cmake expects). - Stop strictly requiring PhysXDevice64.dll: it is a prebuilt redistributable absent from PhysX 5.6 build output. Search the whole physx/bin tree and copy if found; only PhysXGpu_64.dll is required. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 24568c8 commit 8b8b2fb

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/BuildPhysX.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ jobs:
1818
config: [debug, release, profile, checked]
1919

2020
steps:
21+
- name: Resolve version
22+
id: ver
23+
shell: bash
24+
run: |
25+
ref="${GITHUB_REF_NAME:-}"
26+
if [ -z "$ref" ] || [ "$ref" = "main" ]; then
27+
ref="v0.0.0-dev"
28+
fi
29+
version="${ref#v}"
30+
echo "version=$version" >> "$GITHUB_OUTPUT"
31+
echo "Resolved version: $version"
32+
2133
- name: Checkout repository
2234
uses: actions/checkout@v4
2335
with:
@@ -54,20 +66,30 @@ jobs:
5466
if: runner.os == 'Windows'
5567
id: package-windows
5668
shell: bash
69+
env:
70+
PHYSX_VERSION: ${{ steps.ver.outputs.version }}
5771
run: |
5872
mkdir -p output/bin output/lib output/include output/documentation
59-
binArchiveName="Physx-5.6.0.win.x86_64.vc143.md.${{ matrix.config }}.zip"
73+
binArchiveName="Physx-${PHYSX_VERSION}.win.x86_64.vc143.md.${{ matrix.config }}.zip"
6074
echo "PHYSX_BINARY_ARCHIVE=$binArchiveName" >> "$GITHUB_OUTPUT"
6175
cp physx/bin/win.x86_64.vc143.md/${{ matrix.config }}/*.dll output/bin/
6276
cp physx/bin/win.x86_64.vc143.md/${{ matrix.config }}/*.lib output/lib/
6377
cp -r physx/include/* output/include/
6478
cp -r physx/documentation/* output/documentation/ 2>/dev/null || true
79+
# PhysXDevice64.dll is a prebuilt redistributable in some PhysX SDK drops.
80+
# Search the whole physx/bin tree and copy if found (do not fail if absent).
81+
found_device="$(find physx/bin -type f -name 'PhysXDevice64.dll' -print -quit 2>/dev/null || true)"
82+
if [ -n "$found_device" ]; then
83+
cp "$found_device" output/bin/
84+
fi
6585
if [ -n "${CUDA_PATH:-}" ]; then
6686
cuda_bin="$(cygpath -u "$CUDA_PATH")/bin"
6787
cp "$cuda_bin"/cudart64_*.dll output/bin/ 2>/dev/null || true
6888
fi
89+
# PhysXGpu_64.dll is the GPU build's required artifact. Hard-fail if missing.
6990
test -f output/bin/PhysXGpu_64.dll
70-
test -f output/bin/PhysXDevice64.dll
91+
echo "=== Contents of output/bin/ ==="
92+
ls -la output/bin/
7193
(cd output && 7z a "../$binArchiveName" ./bin/ ./lib/ ./include/ ./documentation/)
7294
7395
# === LINUX ===
@@ -98,9 +120,11 @@ jobs:
98120
- name: Package (Linux)
99121
if: runner.os == 'Linux'
100122
id: package-linux
123+
env:
124+
PHYSX_VERSION: ${{ steps.ver.outputs.version }}
101125
run: |
102126
mkdir -p output/lib output/include output/documentation
103-
binArchiveName="PhysX-5.6.0.linux.x86_64.clang.${{ matrix.config }}.tar.gz"
127+
binArchiveName="PhysX-${PHYSX_VERSION}.linux.x86_64.clang.${{ matrix.config }}.tar.gz"
104128
echo "PHYSX_BINARY_ARCHIVE=$binArchiveName" >> "$GITHUB_OUTPUT"
105129
cp physx/bin/linux.clang/${{ matrix.config }}/*.a output/lib/ 2>/dev/null || true
106130
cp -r physx/include/* output/include/

vc17win64-gpu-md.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<cmakeSwitch name="PX_BUILDPVDRUNTIME" value="True" comment="Generate the OmniPVD project" />
77
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS" value="True" comment="Generate the GPU projects" />
88
<cmakeSwitch name="PX_GENERATE_GPU_PROJECTS_ONLY" value="False" comment="Generate both CPU and GPU projects" />
9-
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="False" comment="Generate the full CUDA architecture set for distribution binaries" />
9+
<cmakeSwitch name="PX_GENERATE_GPU_REDUCED_ARCHITECTURES" value="True" comment="Generate a single CUDA arch + PTX fallback. Required on GitHub runners (16 GB RAM) — the full arch set OOM-crashes ptxas with -t0 parallel nvcc. PTX JIT covers any sm_70+ GPU at first run." />
1010
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="False" comment="Generate shared libraries" />
1111
<cmakeSwitch name="PX_GENERATE_GPU_STATIC_LIBRARIES" value="False" comment="Generate PhysXGpu as a DLL" />
1212
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="False" comment="Use the dynamically linked Windows CRT" />

0 commit comments

Comments
 (0)