Skip to main content

In this tutorial, we'll walk you through the process of installing Era3D, a mesh generating app, on Windows 11. This guide assumes you have some basic knowledge of software installation and using a command prompt.

Required software

Before we start, make sure you have the following software installed:

  • Nvidia driver
  • Git
  • Miniconda
  • Visual Studio 2019
    • Run the Visual Studio Installer and add the workload "Desktop Development with C++"
    • If you are not able to get the 2019 version of Visual Studio, you can install Build Tools 2019 and set up environment variables to point to the 2019 build tools folders 
      • Visual studio build tools 2019 - option 1, option 2, option 3
        • After installing the build tools, run the Visual Studio Installer, click Modify next to the Visual Studio Build Tools 2019 and make sure "Desktop Development with C++" is installed
  • Cuda toolkit 11.8

We need a driver for our GPU installed - I have an Nvidia card so I'll be installing that one. Then we need the Cuda toolkit to use the Nvidia GPU's power in generative apps. After that I'll install git to clone the app's repository, and grab Miniconda or another conda installer to create a separate python environment for running each app. We'll need Visual Studio to compile tiny cuda nn. Make sure you have Visual Studio 2019 installed before installing the Cuda toolkit, so the installer can set up environment variables automatically. If you did it in reverse order, run the Cuda toolkit installer again.

 

Setting up the environment

  • Enable long paths
  • Add build tools to the path environment variable
    • You can use the search function to find the file cl.exe in the Microsoft Visual Studio folder, then add its folder to path
  • Start up Miniconda and create a conda environment with python 3.9
> conda create --name era -y python=3.9

 

Installation

 

Installing Dependencies

Activate your conda environment, and start preparing it by installing pytorch 2.1.1 for cuda 11.8. I'm doing this while running the miniconda prompt as an administrator to avoid write permission issues.

> conda activate era
> pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 xformers --force-reinstall --index-url https://download.pytorch.org/whl/cu118

Set environment variables by running vcvars64.bat

> cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
> vcvars64.bat

Check that ninja is available

> where ninja

The output should be the path to a ninja executable. Now your conda environment should be ready to install tinycuda.

> pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
anaconda command prompt, installing tinycudann on windows
Installing Tiny Cuda NN on Windows

Next, let's grab nvdiffrast.

> pip install git+https://github.com/NVlabs/nvdiffrast  

 

Cloning the repository and downloading models

Now I'll switch back to using miniconda as a regular user, and download the Era3D repo.

> git clone https://github.com/wandaweb/Era3D
> cd Era3D
> git checkout windows 

Download models.

Era3D> git lfs clone https://huggingface.co/pengHTYX/MacLab-Era3D-512-6view
Era3D> mkdir sam_pt

Download the file sam_vit_h_4b8939.pth to the sam_pt folder.

Install requirements.

Era3D> conda activate era
Era3D> pip install -r requirements.txt

Run the WebUI.

Era3D> python app.py

 

Troubleshooting

 

Cannont find ninja.exe

If you encounter an error that says:       

Fatal error in launcher: Unable to create process using '"C:\Users\{USERNAME}\miniconda3\envs\era\python.exe"  "C:\Users\{USERNAME}\miniconda3\envs\era\Scripts\ninja.exe"': The system cannot find the file specified.       
 

try deleting the file Scripts/ninja.exe and run the app again.

 

> del C:\Users\{USERNAME}\miniconda3\envs\era\Scripts\ninja.exe

 

Incompatible version of urllib3 

Thanks to Joel Durham for this one!

When I installed the requirements via pip it grabbed the wrong version of urllib3 (2.2.2) which was incompatible. It told me to grab urllib 1.27 which pip install wasn't able to find. I finally got 1.25.4 installed, and it worked!, but there's a final red harring as the installer will tell you that 1.25.4 is incompadible with gradio 4.31.5. But it turns out you can ignore that warning.

 

Using Era3D

  • Visit the link http://127.0.0.1:7860 to interact with the WebUI. 
  • Upload your image, or select one of the samples, and click "Generate Normals and Colors". 
  • The results will be in a subfolder of the folder called mv_res. Copy the relative path to the results from that folder and paste it to the dataset.scene parameter when running launch.py. For example, dataset.scene=cropsize-420-cfg3.0/scene@20240616-165532.
  • Navigate to the instant-nsr folder. 
Era3D> cd instant-nsr-pl
  • Generate the model with the following command
Era3D\instant-nsr-pl> python launch.py --config configs/neuralangelo-ortho-wmask.yaml --gpu 0 --train dataset.root_dir=../mv_res/ dataset.scene=cropsize-420-cfg3.0/scene@20240616-165532 --exp_dir ../output

That's it! With these steps, you should be able to successfully install and use Era3D on your Windows machine.