This recipe is a rattler-build recipe for NeRF Studio and some extras. If you build this package, you can use it to train Gaussian Splatting on AWS Deadline Cloud.
The package you build from this recipe will include the following:
- NeRF Studio.
- The external model Splatfacto in the Wild.
- Dependencies of NeRF Studio that don't have packages on conda-forge yet. If you look in recipe.yaml, the lists of host and run dependencies document many of these in comments, including via transitive dependencies.
- The nerfstudio/gsplat package's examples, to make its
simple_trainer.py example available. A wrapper shell script makes it available as a command
gsplat_simple_trainer. - The KevinXu02/splatfacto-w package's export_script.py to
export models from Splatfacto in the Wild to the .ply format. A wrapper shell script makes it available
as a command
splatfactow_export.
The specific versions built are selected from recent git commits of the projects. The recipe implementation recipe.yaml and build.sh includes comments to explain what it does.
You can use the rattler-build publish command to build the recipe on a Linux host and publish it to a conda channel in one step. See rattler-build Installation for options on installation.
If your machine has CUDA, run the following from the conda_recipes directory:
rattler-build publish nerfstudio/recipe/recipe.yaml \
--to s3://amzn-s3-demo-bucket/Conda/Default
-c conda-forge \
--build-number=+1
If your machine has no CUDA GPU, you can override the CUDA detection and build the package anyway.
You will need a GPU to run NeRF Studio itself, but you can get the package built without one.
Run the following before the above rattler-build command:
export CONDA_OVERRIDE_CUDA="12.6"
You can build this package on a Deadline Cloud farm that is configured for package build jobs that update the S3 conda channel and has a CUDA fleet to run the build. This document focuses on building with Deadline Cloud, but you could run rattler-build yourself if you set up a suitable environment.
Deploy this CloudFormation template to get a CUDA Deadline Cloud farm in your account. Read the AWS Deadline Cloud developer documentation create a conda channel using S3 to learn more about the deployment.
Submit a job to build the package from the conda_recipes directory of the Deadline Cloud samples github as follows. If you need to customize this, see the conda recipe samples README.
$ ./submit-package-job nerfstudio
The recipe pins dependency package versions to ranges around versions that ran correctly together. These pins should keep the recipe stable over time as new versions are released, but please open an issue or a pull request if you try to build it and run into errors.
We recommend that you use the sample queue environment conda_queue_env_improved_caching.yaml to reuse conda environments between jobs. This queue environment can save considerable time and bandwidth as the dependency closure of NeRF Studio consists of many packages containing multiple gigabytes of data.
Once you have this package built and indexed in your S3 conda channel, you can use it to train your own Gaussian Splatting. Learn how to do this in the gsplat_pipeline job bundle README.
Conda-forge provides community-led recipes, infrastructure, and distributions for conda. NeRF Studio and all of its dependencies are open source libraries, and great candidates to contribute as conda package recipes to conda-forge. See the conda-forge documentation about contributing packages to learn more about the process.
The sample recipe provided here is a good starting point, but is not ready to contribute. It bundles more than ten library dependencies together with NeRF Studio and uses the ability for a recipe to turn off binary relocation so that shared object binary dependencies from PyPI will work in the runtime environment. Recipes in conda-forge feedstocks must follow stricter conventions to inter-operate with the full set of conda-forge packages. Feel free to take the code here and transform it as necessary if you're interested in making this contribution.