Setting up NVIDIA’s instant-ngp on Google Colab
Case Studies
4
min read
September 7, 2024
NVIDIA’s instant-ngp Readme explains how to run its code on standard Windows & Ubuntu machines pretty well. But running it on Google Colab isn’t as well documented. There have been attempts to document it by some helpful people but many of these articles have become outdated as the repository and its underlying dependencies have evolved.
It took me a lot of reading and trial-and-error to be able to figure this out. Here is how I did it.
Please note that all the following instructions were run on an A100 GPU enabled Google Colab. Additionally, you will notice that I add %cd <some path>
at a lot of places, even when it is not needed. This is to avoid any reader confusion about where the commands need to be run.
Setup Colmap
Before we begin with building the instant-ngp code, we will need to manually setup an important dependency that is needed when running certain instant-ngp scripts(eg. scripts/colmap2nerf.py
). This dependency is the colmap
library. Now, there is a way to use apt-get
to install this library easily, but doing it this way will lead to errors. This is because the GUI_ENABLED
option is ON by default when we use install using apt-get. I tried to look for system flags that I can use to disable the graphical UI, but couldn’t find any. Instead, building it locally turned out to be the only option.
Please run the following code to set up colmap
:
In order to disable the graphical UI, we need to go to CMakeLists.txt
and switch GUI_ENABLED
to OFF. Once this is done, please run the following commands.
Voila! colmap
is ready. Please run this to verify:
…
Instant-ngp
Now that the dependencies are ready, it’s time for the main event. Let’s begin setting up instant-ngp
Please check the cuda version on the Google Colab environment to make sure your path is correct. Mine is cuda-12.2
.
Now that the flags are set, let’s begin building instant-ngp.
That’s it! NVIDIA’s instant-ngp is ready to use. I hope this article helps people save time, avoid the pain of going though tedious code and searching forums.
Please reach out to us at info@betacrew.io for help building cutting edge GenAI applications