Skip to content

Commit 0c1a4b0

Browse files
authored
Merge branch 'main' into fw/mas_docs
Signed-off-by: Francis Williams <fwilliams@users.noreply.github.com>
2 parents 4413c32 + 648416f commit 0c1a4b0

25 files changed

+3693
-369
lines changed

Dockerfile

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
FROM condaforge/miniforge3:24.11.3-2
1+
FROM nvidia/cuda:12.8.1-cudnn-devel-ubuntu22.04
22

3-
ARG MODE=dev
4-
RUN echo "Building fVDB container in $MODE mode"
3+
# Set environment variables to prevent interactive prompts during installation.
4+
ENV DEBIAN_FRONTEND=noninteractive
55

6-
# used for cross-compilation in docker build
7-
ENV FORCE_CUDA=1
6+
RUN sed -i 's/archive.ubuntu.com/mirrors.ocf.berkeley.edu/g' /etc/apt/sources.list
87

9-
# Create and use a consistent workspace directory
10-
RUN mkdir -p /workspace
11-
WORKDIR /workspace
8+
# Install Python
9+
RUN apt-get update && \
10+
apt-get install -y python3-pip python3-dev python3-venv python-is-python3 wget git ninja-build vim libxcb1-dev libx11-dev libgl-dev pkgconf && \
11+
rm -rf /var/lib/apt/lists/* && \
12+
python -m pip install --upgrade pip
1213

13-
# Conda setup
14-
# force this CUDA version to be used to build the docker container because `docker build` does not
15-
# expose the GPU to the docker build process for it to be detected
16-
# fVDB team NOTE!!! We've tried removing this ENV line and it doesn't work, container build fails.
17-
ENV CONDA_OVERRIDE_CUDA=12.9
18-
COPY env/dev_environment.yml /tmp/
19-
RUN conda env create -f /tmp/dev_environment.yml
14+
# Install CMake
15+
RUN mkdir ~/temp && \
16+
cd ~/temp && \
17+
wget -nv https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2-linux-x86_64.sh && \
18+
mkdir /opt/cmake && \
19+
sh cmake-4.1.2-linux-x86_64.sh --prefix=/usr/local --skip-license && \
20+
cmake --version
2021

21-
RUN conda init
22-
RUN echo "conda activate fvdb" >> ~/.bashrc

README.md

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,34 @@ Lastly, our [documentation](docs) provides deeper details on the concepts as wel
2121

2222
## Installing *f*VDB
2323

24-
During the project's initial development stages, it is necessary to [run the build steps](#building-fvdb-from-source) to install ƒVDB. Eventually, ƒVDB will be provided as a pre-built, installable package from anaconda. We support building the latest ƒVDB version for the following dependent library configurations:
24+
During the project's initial development stages, it is necessary to [run the build steps](#building-fvdb-from-source) to install ƒVDB. Eventually, ƒVDB will be provided as a pre-built, installable package. We support building the latest ƒVDB version for the following library configurations:
2525

2626
| PyTorch | Python | CUDA |
2727
| -------------- | ----------- | ------------ |
28-
| 2.4.0-2.4.1 | 3.10 - 3.12 | 12.1 - 12.4 |
28+
| 2.8.0-2.9.0 | 3.10 - 3.13 | 12.8 - 13.0 |
2929

3030

3131

3232
** Notes:**
33-
* Linux is the only platform currently supported (Ubuntu >= 20.04 recommended).
33+
* Linux is the only platform currently supported (Ubuntu >= 22.04 recommended).
3434
* A CUDA-capable GPU with Ampere architecture or newer (i.e. compute capability >=8.0) is recommended to run the CUDA-accelerated operations in ƒVDB. A GPU with compute capabililty >=7.0 (Volta architecture) is the minimum requirement but some operations and data types are not supported.
3535

3636

3737
## Building *f*VDB from Source
3838

3939
### Environment Management
40-
ƒVDB is a Python library implemented as a C++ Pytorch extension. Of course you can build ƒVDB in whatever environment suits you, but we provide three paths to constructing reliable environments for building and running ƒVDB. These are separate options,
41-
choose only one. They're not intended to be used together.
40+
ƒVDB is a Python library implemented as a C++ PyTorch extension. Of course you can build ƒVDB in whatever environment suits you, but we provide three distinct paths to constructing reliable environments for building and running ƒVDB. These are separate options and are not intended to be used together.
4241

43-
1. **RECOMMENDED** [conda](#option-1-setting-up-a-conda-environment-recommended)
44-
2. Using [docker](#option-2-setting-up-a-docker-container)
45-
3. Python virtual environment. [venv](#option-3-setting-up-a-python-virtual-environment)
42+
1. **RECOMMENDED** [conda](#option-1-conda-environment-recommended)
43+
2. Using [Docker](#option-2-docker-container)
44+
3. [Python virtual environment](#option-3-python-virtual-environment)
4645

4746
`conda` tends to be more flexible since reconfiguring toolchains and modules to suit your larger project can be dynamic, but at the same time this can be a more brittle experience compared to using a virtualized `docker` container. Using `conda` is generally recommended for development and testing, while using `docker` is recommended for CI/CD and deployment.
4847

4948
---
5049

5150

52-
#### **OPTION 1** Setting up a Conda Environment (Recommended)
51+
#### **OPTION 1** Conda Environment (Recommended)
5352

5453
*f*VDB can be used with any Conda distribution installed on your system. Below is an installation guide using
5554
[miniforge](https://github.com/conda-forge/miniforge). You can skip steps 1-3 if you already have a Conda installation.
@@ -84,56 +83,43 @@ conda activate fvdb
8483

8584
---
8685

87-
#### **OPTION 2** Setting up a Docker Container
86+
#### **OPTION 2** Docker Container
8887

89-
Running a docker container is a great way to ensure that you have a consistent environment for building and running ƒVDB.
88+
Running a Docker container ensures that you have a consistent environment for building and running ƒVDB. Start by installing Docker and the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).
9089

91-
Our provided [`Dockerfile`](Dockerfile) constructs a Docker image which is ready to build ƒVDB. The docker image is configured to install miniforge and the `fvdb` conda environment with all the dependencies needed to build and run ƒVDB.
90+
Our provided [`Dockerfile`](Dockerfile) constructs a container that pre-installs the dependencies needed to build and run ƒVDB.
9291

93-
Building and starting the docker image is done by running the following command from the fvdb directory:
92+
In the fvdb-core directory, build the Docker image:
9493
```shell
95-
docker compose run --rm fvdb-dev
94+
docker build -t fvdb-devel .
9695
```
9796

98-
9997
When you are ready to build ƒVDB, run the following command within the docker container. `TORCH_CUDA_ARCH_LIST` specifies which CUDA architectures to build for.
10098
```shell
101-
conda activate fvdb;
99+
docker run -it --mount type=bind,src="$(pwd)",target=/workspace fvdb-devel bash
102100
cd /workspace;
103-
TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6+PTX" \
104-
./build.sh install verbose
105-
```
106-
107-
If you've built an artifact that you want to extract from the container, with "wheel" being the
108-
most useful... The built wheel can be extracted from the running docker image using `docker cp`, given the
109-
ID of the running image. For example:
110-
111-
```shell
112-
docker cp fvdb-fvdb-dev-run-0123456789ab:/workspace/dist/fvdb-0.2.1-cp312-cp312-linux_x86_64.whl .
101+
pip install -r env/build_requirements.txt
102+
TORCH_CUDA_ARCH_LIST="7.5;8.0;9.0;10.0;12.0+PTX" \
103+
./build.sh install -v
113104
```
114105

115-
where `0123456789ab` is the ID of the running docker container, obtained via `docker ps`.
116-
117-
Additional information about the ƒVDB docker setup, with troubleshooting for common errors, can be found
118-
here: [`ƒVDB Docker`](docs/markdown/docker_readme.md)
106+
In order to extract an artifact from the container such as the Python wheel, query the container ID using `docker ps` and copy the artifact using `docker cp`.
119107

120108
---
121109

122-
#### **OPTION 3** Setting up a Python virtual environment
110+
#### **OPTION 3** Python Virtual Environment
123111

124-
Create a python virtual environment and then proceed to install the exact version of PyTorch that corresponds to your CUDA version. Finally, install the rest of the build requirements.
112+
Using a Python virtual environment enables you to use your system provided compiler and CUDA toolkit. This can be especially useful if you are using ƒVDB in conjunction with other Python packages, especially packages that have been built from source. Start by installing GCC, the CUDA Toolkit, and cuDNN.
113+
114+
Then, create a Python virtual environment, install the requisite dependencies, and build:
125115

126116
```shell
127117
python -m venv fvdb
128118
source fvdb/bin/activate
129-
pip install -r env/build_requirements.txt --extra-index-url https://download.pytorch.org/whl/cu129
119+
pip install -r env/build_requirements.txt
120+
TORCH_CUDA_ARCH_LIST="7.5;8.0;9.0;10.0;12.0+PTX" ./build.sh install -v
130121
```
131-
132-
When you're ready to build fVDB, run the following command after activating the Python virtual environment
133-
```shell
134-
TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6+PTX" ./build.sh install
135-
```
136-
122+
Note: adjust the TORCH_CUDA_ARCH_LIST to suit your needs. If you are building just to run on a single machine, including only the present GPU architecture(s) reduces build time.
137123
---
138124

139125
### Building *f*VDB

docs/markdown/docker_readme.md

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)