Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mps fix #2436

Merged
merged 4 commits into from
Dec 1, 2023
Merged

Mps fix #2436

merged 4 commits into from
Dec 1, 2023

Conversation

Jerry-Master
Copy link
Contributor

As expressed in #2435 there is a bug that make nerfstudio fail on apple silicon devices. I make an extra addition to fix it. However, I would like for nerfstudio to have more support on apple devices. I wanted to contribute to the docs on instructions about how to install on Mac and how to process the data to avoid errors but found that couldn't even build the docs locally. For instance, rawpy is not supported on M1 macs. And tyro installation fails. It installs, but later on it says that no module could be found. I also couldn't run tests locally since the developer branch is quite difficult to install on mac and I could not manage to do so.

When you solve those issues, I will be more than glad to contribute to the docs. For the moment, I'll just leave the instructions to make nerfstudio work here.

First, install pymeshlab like this:

pip3 install git+https://github.com/cnr-isti-vclab/PyMeshLab

Then, install functorch with pip, and then install nerfstudio with pip too. That should suffice. When running the processing, I only managed to make it work with this command:

ns-process-data images --data trial1/images/ --output-dir trial1/output/ --num-downscales 0 --no-gpu --matching-method exhaustive

You can use images or video, but be sure to use --no-gpu and the exhaustive matching type. It should suffice for short sequences. Then, to train the model, run:

PYTORCH_ENABLE_MPS_FALLBACK=1 ns-train nerfacto --data trial1/output/ --machine.device-type mps --mixed-precision False

For 100 frames the estimated running time on my device (M1 Max) is 12 hours approximately.

@tancik
Copy link
Contributor

tancik commented Sep 18, 2023

Run ns-dev-test to fix test errors.

@brentyi brentyi enabled auto-merge (squash) November 30, 2023 23:57
@brentyi brentyi merged commit 49503c2 into nerfstudio-project:main Dec 1, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants