yenchenlin / nerf-pytorch

A PyTorch implementation of NeRF (Neural Radiance Fields) that reproduces the results.
MIT License
5.49k stars 1.06k forks source link

A question about cuda device #50

Open D-Hank opened 2 years ago

D-Hank commented 2 years ago

Hi, I am using your code to run the lego example you provide. My GPU0 is used while GPU1 is free so I set device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu") at the beginning of run_nerf.py. However, this doesn't seem to work for my second GPU: 图片

D-Hank commented 2 years ago

Managed to fix this problem by adding a line: torch.cuda.set_device(gpu) where gpu = 1. I offer my code in pull request.

Cheryl7788 commented 10 months ago

same problem!!!