Skip to content

Latest commit

 

History

History
109 lines (82 loc) · 3.58 KB

File metadata and controls

109 lines (82 loc) · 3.58 KB

scripts/

Helper scripts. They are not required for normal use — pip install --no-build-isolation . is the canonical install path — but the install script bundles a few extra safety checks for a clean first-time setup.

install_on_ubuntu.sh

End-to-end installer that creates an isolated conda env containing the right cuda-toolkit, gcc 11, PyTorch, and finally builds this package against them. The host's system Python / nvcc / gcc are not touched.

Tested: Ubuntu 20.04.6 LTS, RTX 4080 Laptop (compute 8.9), NVIDIA driver 535.129.03, with the default arguments below. Other Linux distros / driver versions are not tested but should work as long as they satisfy the constraints noted in the Driver / CUDA compatibility section below.

# Default: env name "diff4dgs-test", python 3.10, CUDA 12.1, torch 2.4.0
bash scripts/install_on_ubuntu.sh

# Override anything via environment variables, e.g.:
ENV_NAME=myenv \
TORCH_VERSION=2.3.1 \
TORCH_CHANNEL=cu118 \
CUDA_VERSION=11.8 \
bash scripts/install_on_ubuntu.sh

# Skip the examples/ smoke tests:
RUN_EXAMPLES=0 bash scripts/install_on_ubuntu.sh

Prerequisites the script does not install for you (they are system-wide concerns):

  • NVIDIA driver (nvidia-smi must work).
  • Miniconda / Anaconda (conda must be on $PATH).
  • A CUDA-capable GPU.

Driver / CUDA compatibility

The script's default CUDA_VERSION=12.1 requires an NVIDIA driver that can run CUDA 12.x binaries. Check your driver with

nvidia-smi | grep -i "CUDA Version"

The "CUDA Version" reported by nvidia-smi is the maximum CUDA runtime the driver can run, not the toolkit currently installed; any CUDA runtime ≤ that number is OK. Concretely we have only tested driver 535.x (which reports CUDA 12.2) with CUDA_VERSION=12.1 + TORCH_CHANNEL=cu121 + TORCH_VERSION=2.4.0. The CUDA wheel must match: torch.version.cuda major.minor has to equal nvcc --version major.minor, or the build aborts with RuntimeError: detected CUDA version mismatches.

Non-tested but plausible overrides for older / newer drivers:

  • driver maxes out at CUDA 11.x → try CUDA_VERSION=11.8, TORCH_CHANNEL=cu118, TORCH_VERSION=2.3.1;
  • driver supports CUDA 13.x → use a CUDA-13 wheel that PyTorch actually publishes (see https://pytorch.org/cu128 / cu129 channels at the time of writing).

These overrides are not part of our verified configuration; please report back if you confirm them working.

Implementation note: --no-build-isolation

The script intentionally builds with pip install --no-build-isolation. PEP 517 build isolation would otherwise create a fresh build env and fetch the latest PyTorch from PyPI (currently 2.11 with CUDA 13), which mismatches the in-env nvcc and aborts with:

RuntimeError: The detected CUDA version (12.1) mismatches the version
that was used to compile PyTorch (13.0).

Disabling build isolation makes pip reuse the torch we just installed into the env, so the CUDA versions stay consistent. The package's pyproject.toml likewise omits torch from build-system.requires for the same reason.

Re-enter the env later

After the script finishes you can re-enter the env from any shell:

conda activate diff4dgs-test
python -c "import diff_gaussian_rasterization; print('ok')"

uninstall.sh

Removes the conda env and the local build/, dist/, *.egg-info/ directories produced by setuptools. Use this when you want to roll back to a clean slate.

bash scripts/uninstall.sh

# Or, if you used a custom env name during install:
ENV_NAME=myenv bash scripts/uninstall.sh