From: hu-po

Nerf Studio is a tool that provides a simplified API for the end-to-end process of creating Nerfs [01:39:41], functioning as a neural network that acts as a 3D file [01:52:21]. It is permissively licensed [00:01:26]. This article details the process and common challenges encountered during the installation of Nerf Studio, primarily focusing on dependency and environment setup issues.

Initial Setup Attempts

The installation process typically begins with setting up a conda environment [00:01:58], requiring an Nvidia card with CUDA installed [00:01:50].

The recommended steps include:

  1. Creating a conda environment [00:01:58].
  2. Activating the environment [00:02:25].
  3. Upgrading pip [00:02:35].
  4. Installing Nerf Studio via pip <a class=“yt-timestamp” data=t=“00:07:13”>[00:07:13].

Dependency Conflicts

A significant challenge during installation was resolving conflicts with core dependencies, particularly PyTorch and its interaction with torch six and tiny-cuda-nn.

  • PyTorch Version Incompatibility: An initial attempt to install Nerf Studio led to a no module named torch six error [01:11:53]. This issue arose because PyTorch 2.0, which was installed by default, no longer supports torch six [01:44:00]. The suggested resolution was to explicitly install an older version of PyTorch, specifically torch==1.13.1 with cuda-11.7 [01:15:29]. However, even after downgrading, tiny-cuda-nn still presented an undefined symbol error related to Cuda caching allocator [01:59:08], indicating an incompatibility between PyTorch and the tiny-cuda-nn library [01:59:45].

tiny-cuda-nn Compilation Issues

The tiny-cuda-nn dependency, a “lighting fast C++ CUDA neural network framework” [01:19:20], proved particularly problematic.

  • Direct Installation Failures: Direct pip install commands for tiny-cuda-nn did not resolve the issue [01:18:59].
  • Building from Source: Attempts were made to clone and build tiny-cuda-nn from its GitHub repository [02:18:00].
    • CUDA Architecture: A common error was failed to detect a default Cuda architecture [02:20:07] or unknown compute capability [02:50:58]. This required explicitly setting the CMAKE_CUDA_ARCHITECTURES environment variable during the cmake command [02:55:31]. For a GeForce 1080 TI GPU, the correct architecture was 61 [02:55:01].
    • Environment Variables: Missing CUDA-related environment variables (CUDA_HOME, CUDA_PATH) also caused issues [02:26:09], which were resolved by exporting them to the session path [02:39:03].
    • GCC Version: Conflicts arose with the GCC compiler version, with both GCC 11 and GCC 10 failing to compile tiny-cuda-nn [03:39:37].

Docker Installation Attempt

Due to persistent environment issues, switching to a Docker-based installation was attempted [04:40:06], aiming to leverage containerization for dependency management [04:46:17].

  • Pulling Docker Image: The process involved pulling a pre-built Nerf Studio Docker image from Docker Hub, specifically dromny/nerfstudio:0.1.9 [04:55:55].
  • Running Docker Container: The docker run command was configured to:
    • Use all available GPUs (--gpus all) [04:47:43].
    • Mount local data and cache folders as volumes (-v /path/to/data:/data, -v /path/to/cache:/cache) [04:47:48].
    • Map port 7007 for the viewer (-p 7007:7007) [04:48:13].
    • Allocate memory (--memory 12g) [04:48:43].
  • Docker Image Incompatibilities: Despite using Docker, errors persisted, including unexpected error from Cuda device count and non-supported Hardware [00:53:22]. The core problem identified was a mismatch between the host’s CUDA version (11.6) and the Docker image’s CUDA version (11.8) [02:08:02].
  • Custom Docker Build: To address this, an attempt was made to build a custom Docker image from the Nerf Studio repository, specifying the correct CUDA architecture (61) for the GPU [02:56:49]. This lengthy process involved installing PyTorch with CUDA 11.6 [01:04:45].

Preparing Data for Nerf Studio

While tackling installation issues, a practical step was taken to prepare a dataset for future Nerf creation. This involved generating images of a cat from various angles (front, profile, back, three-quarter pose) using Midjourney AI [01:02:08]. These images were then organized into a directory structure matching Nerf Studio’s requirements, including an images folder and copying template colmap and transforms.json files [01:07:05].

Conclusion

The installation of Nerf Studio, particularly the tiny-cuda-nn dependency, proved to be highly challenging due to intricate CUDA, PyTorch, and compiler version incompatibilities [01:59:23]. The path forward involved upgrading the host machine’s CUDA toolkit to version 11.8 to match the compatible Docker image [02:09:21], which necessitated a system reboot [02:14:14].