ashawkey / stable-dreamfusion

Text-to-3D & Image-to-3D & Mesh Exportation with NeRF + Diffusion.
Apache License 2.0
7.99k stars 710 forks source link

Running stable dreamfusion on multiple gpus #314

Open asher-lab opened 1 year ago

asher-lab commented 1 year ago

Hi I'm trying to make this notebook work in multi-gpu. https://colab.research.google.com/drive/1MXT3yfOFvO0ooKEfiUUvTKwUkrrlCHpF?usp=sharing

nvidia-smi

Tue Jun 13 23:51:05 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.105.01   Driver Version: 515.105.01   CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA RTX A4000    On   | 00000000:8B:00.0 Off |                  Off |
| 41%   28C    P8    10W / 140W |  11361MiB / 16376MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA RTX A4000    On   | 00000000:8C:00.0 Off |                  Off |
| 41%   29C    P8    11W / 140W |   1065MiB / 16376MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|

Wrapping the model in DataParallel show's an error: AttributeError: 'DataParallel' object has no attribute 'get_params'


    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

    model = NeRFNetwork(opt) ### <-------    the model

    model= nn.DataParallel(model)
    model.to(device)

Do we have a documentation or guide how can we run this model on multiple gpus? I'm using Kubernetes with 2 gpu nodes attached.

Thank you!

zshyang commented 11 months ago

I am also curious about this.

XuYunqiu commented 10 months ago

I am also curious about this.