Julien Blanchon
commited on
Commit
·
7ef6474
1
Parent(s):
9f5e222
Fix C++ ABI compatibility: compile gsplat in Docker with exact PyTorch version
Browse files- Revert to source compilation in Docker to ensure PyTorch version compatibility
- Use single GPU architecture (8.0 for A100) to minimize memory usage
- Remove debug logging (tensor type issues are fixed)
- This fixes undefined symbol errors caused by PyTorch version mismatch
- Compile with exact same PyTorch version as runtime environment
- Dockerfile +7 -6
- gradio_models.py +0 -7
- pyproject.docker.toml +1 -1
Dockerfile
CHANGED
|
@@ -43,14 +43,15 @@ ENV HOME=/home/user \
|
|
| 43 |
UV_CACHE_DIR=/home/user/.cache/uv
|
| 44 |
|
| 45 |
# Copy dependency files
|
| 46 |
-
COPY --chown=user pyproject.
|
|
|
|
| 47 |
|
| 48 |
-
#
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
|
| 53 |
-
# Install dependencies with
|
| 54 |
RUN --mount=type=cache,target=/tmp/uv-cache,sharing=locked,uid=1000,gid=1000 \
|
| 55 |
UV_CACHE_DIR=/tmp/uv-cache uv sync --no-dev
|
| 56 |
|
|
|
|
| 43 |
UV_CACHE_DIR=/home/user/.cache/uv
|
| 44 |
|
| 45 |
# Copy dependency files
|
| 46 |
+
COPY --chown=user pyproject.toml ./pyproject.toml
|
| 47 |
+
COPY --chown=user gsplat/ ./gsplat/
|
| 48 |
|
| 49 |
+
# Set minimal CUDA compilation to avoid memory issues but ensure compatibility
|
| 50 |
+
ENV TORCH_CUDA_ARCH_LIST="8.0" \
|
| 51 |
+
FORCE_CUDA=1 \
|
| 52 |
+
MAX_JOBS=1
|
| 53 |
|
| 54 |
+
# Install dependencies (will compile gsplat with exact PyTorch version for compatibility)
|
| 55 |
RUN --mount=type=cache,target=/tmp/uv-cache,sharing=locked,uid=1000,gid=1000 \
|
| 56 |
UV_CACHE_DIR=/tmp/uv-cache uv sync --no-dev
|
| 57 |
|
gradio_models.py
CHANGED
|
@@ -400,13 +400,6 @@ class GradioGaussianSplatting2D(nn.Module):
|
|
| 400 |
if not self.disable_tiles:
|
| 401 |
enable_topk_norm = not self.disable_topk_norm
|
| 402 |
|
| 403 |
-
# Debug: Print tensor types to identify the Float tensor
|
| 404 |
-
self.worklog.info(
|
| 405 |
-
f"DEBUG - Tensor types: xy={xy.dtype}, radii={radii.dtype}, conics={conics.dtype}, num_tiles_hit={num_tiles_hit.dtype}, feat={feat.dtype}"
|
| 406 |
-
)
|
| 407 |
-
self.worklog.info(
|
| 408 |
-
f"DEBUG - Params: img_h={img_h} ({type(img_h)}), img_w={img_w} ({type(img_w)}), block_h={self.block_h} ({type(self.block_h)}), block_w={self.block_w} ({type(self.block_w)})"
|
| 409 |
-
)
|
| 410 |
|
| 411 |
out_image = rasterize_gaussians_sum(
|
| 412 |
xy,
|
|
|
|
| 400 |
if not self.disable_tiles:
|
| 401 |
enable_topk_norm = not self.disable_topk_norm
|
| 402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 403 |
|
| 404 |
out_image = rasterize_gaussians_sum(
|
| 405 |
xy,
|
pyproject.docker.toml
CHANGED
|
@@ -24,7 +24,7 @@ dependencies = [
|
|
| 24 |
# We use python 3.10 and cu124
|
| 25 |
[tool.uv.sources]
|
| 26 |
fused_ssim = { git = "https://github.com/rahul-goel/fused-ssim/" }
|
| 27 |
-
gsplat = { path = "
|
| 28 |
torch = [
|
| 29 |
{ index = "pytorch-cu124", marker = "sys_platform == 'linux'" },
|
| 30 |
]
|
|
|
|
| 24 |
# We use python 3.10 and cu124
|
| 25 |
[tool.uv.sources]
|
| 26 |
fused_ssim = { git = "https://github.com/rahul-goel/fused-ssim/" }
|
| 27 |
+
gsplat = { path = "gsplat" }
|
| 28 |
torch = [
|
| 29 |
{ index = "pytorch-cu124", marker = "sys_platform == 'linux'" },
|
| 30 |
]
|