Open liulsg opened 1 week ago
报 Allocation 很可能是显存不够
报错日志咋说的?(记得用一对三反撇 ```
把日志内容包起来)
Exception Message: Allocation on device
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 317, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 192, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "G:\AI\ComfyUI_3D-pack\ComfyUI\execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1846, in convert_gs_ply
imgs, alphas = converter.fit_nerf(training_nerf_iterations, training_nerf_resolution)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\LGM\nerf_marching_cubes_converter.py", line 180, in fit_nerf
image_gt, alpha_gt = self.render_gs(pose)
^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\LGM\nerf_marching_cubes_converter.py", line 82, in render_gs
out = self.gs_renderer.render(self.gaussians.unsqueeze(0), cam_view.unsqueeze(0), cam_view_proj.unsqueeze(0), cam_pos.unsqueeze(0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\LGM\core\gs.py", line 75, in render
rendered_image, radii, rendered_depth, rendered_alpha = rasterizer(
^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diff_gaussian_rasterization\__init__.py", line 213, in forward
return rasterize_gaussians(
^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diff_gaussian_rasterization\__init__.py", line 32, in rasterize_gaussians
return _RasterizeGaussians.apply(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\torch\autograd\function.py", line 574, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diff_gaussian_rasterization\__init__.py", line 92, in forward
num_rendered, color, depth, alpha, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
## System Information
- **ComfyUI Version:** v0.2.2
- **Arguments:** ComfyUI\main.py --windows-standalone-build
- **OS:** nt
- **Python Version:** 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
- **Embedded Python:** true
- **PyTorch Version:** 2.4.0+cu121
## Devices
- **Name:** cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
- **Type:** cuda
- **VRAM Total:** 23621861376
- **VRAM Free:** 18755109594
- **Torch VRAM Total:** 3523215360
- **Torch VRAM Free:** 27038426
## Logs
2024-10-12 01:42:01,320 - root - INFO - Total VRAM 22528 MB, total RAM 32662 MB
2024-10-12 01:42:01,320 - root - INFO - pytorch version: 2.4.0+cu121
2024-10-12 01:42:02,610 - root - INFO - xformers version: 0.0.27.post2
2024-10-12 01:42:02,610 - root - INFO - Set vram state to: NORMAL_VRAM
2024-10-12 01:42:02,610 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
2024-10-12 01:42:02,822 - root - INFO - Using xformers cross attention
2024-10-12 01:42:03,992 - root - INFO - [Prompt Server] web root: G:\AI\ComfyUI_3D-pack\ComfyUI\web
2024-10-12 01:42:04,998 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\diffusers\models\transformers\transformer_2d.py:34: FutureWarning: Transformer2DModelOutput
is deprecated and will be removed in version 1.0.0. Importing Transformer2DModelOutput
from diffusers.models.transformer_2d
is deprecated and this will be removed in a future version. Please use from diffusers.models.modeling_outputs import Transformer2DModelOutput
, instead.
deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)
2024-10-12 01:42:06,318 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\nn__init__.py:31: FutureWarning: torch.cuda.amp.custom_fwd(args...)
is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda')
instead.
@torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
2024-10-12 01:42:06,318 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\python_embeded\Lib\site-packages\kiui\nn__init__.py:37: FutureWarning: torch.cuda.amp.custom_bwd(args...)
is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda')
instead.
@torch.cuda.amp.custom_bwd
2024-10-12 01:42:06,363 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\TriplaneGaussian\utils\ops.py:38: FutureWarning: torch.cuda.amp.custom_fwd(args...)
is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda')
instead.
@custom_fwd(cast_inputs=torch.float32)
2024-10-12 01:42:06,363 - py.warnings - WARNING - G:\AI\ComfyUI_3D-pack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\TriplaneGaussian\utils\ops.py:44: FutureWarning: torch.cuda.amp.custom_bwd(args...)
is deprecated. Please use torch.amp.custom_bwd(args..., device_type='cuda')
instead.
@custom_bwd
## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
{"last_node_id":24,"last_link_id":38,"nodes":[{"id":5,"type":"InvertMask","pos":{"0":170,"1":540},"size":{"0":210,"1":26},"flags":{},"order":4,"mode":0,"inputs":[{"name":"mask","type":"MASK","link":3,"label":"遮罩"}],"outputs":[{"name":"MASK","type":"MASK","links":[25,32],"slot_index":0,"shape":3,"label":"遮罩"}],"properties":{"Node name for S&R":"InvertMask"}},{"id":22,"type":"[Comfy3D] Wonder3D MVDiffusion Model","pos":{"0":440,"1":460},"size":{"0":430.8000183105469,"1":170},"flags":{},"order":6,"mode":0,"inputs":[{"name":"mvdiffusion_pipe","type":"DIFFUSERS_PIPE","link":29,"label":"MVDiffusion节点束"},{"name":"reference_image","type":"IMAGE","link":33,"label":"参考图像"},{"name":"reference_mask","type":"MASK","link":32,"label":"参考遮罩"}],"outputs":[{"name":"multiview_images","type":"IMAGE","links":[34],"slot_index":0,"shape":3,"label":"多视图"},{"name":"multiview_normals","type":"IMAGE","links":[],"slot_index":1,"shape":3,"label":"法向多视图"},{"name":"orbit_camposes","type":"ORBIT_CAMPOSES","links":null,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] Wonder3D MVDiffusion Model"},"widgets_values":[0,"fixed",1,30]},{"id":23,"type":"GetImagesFromBatchIndexed","pos":{"0":918,"1":461},"size":{"0":243.60000610351562,"1":76},"flags":{},"order":7,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":34,"label":"图像"}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[35,36],"slot_index":0,"shape":3,"label":"图像"}],"properties":{"Node name for S&R":"GetImagesFromBatchIndexed"},"widgets_values":["0, 2, 3, 4"]},{"id":1,"type":"[Comfy3D] Load Large Multiview Gaussian Model","pos":{"0":917,"1":598},"size":{"0":315,"1":82},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"lgm_model","type":"LGM_MODEL","links":[22],"slot_index":0,"shape":3,"label":"LGM模型"}],"properties":{"Node name for S&R":"[Comfy3D] Load Large Multiview Gaussian Model"},"widgets_values":["model_fp16.safetensors","big"]},{"id":2,"type":"[Comfy3D] Load Diffusers Pipeline","pos":{"0":-138.35284423828125,"1":-248.5692138671875},"size":{"0":375.3948669433594,"1":154},"flags":{},"order":1,"mode":4,"inputs":[],"outputs":[{"name":"pipe","type":"DIFFUSERS_PIPE","links":[23],"slot_index":0,"shape":3,"label":"节点束"}],"properties":{"Node name for S&R":"[Comfy3D] Load Diffusers Pipeline"},"widgets_values":["MVDreamPipeline","ashawkey/imagedream-ipmv-diffusers","",true,""]},{"id":18,"type":"[Comfy3D] MVDream Model","pos":{"0":451.64715576171875,"1":-248.5692138671875},"size":{"0":405.5999755859375,"1":286},"flags":{},"order":5,"mode":4,"inputs":[{"name":"mvdream_pipe","type":"DIFFUSERS_PIPE","link":23,"label":"MVDream节点束"},{"name":"reference_image","type":"IMAGE","link":24,"label":"参考图像"},{"name":"reference_mask","type":"MASK","link":25,"label":"参考遮罩"}],"outputs":[{"name":"multiview_images","type":"IMAGE","links":[],"slot_index":0,"shape":3,"label":"多视图"},{"name":"orbit_camposes","type":"ORBIT_CAMPOSES","links":null,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] MVDream Model"},"widgets_values":["","ugly, blurry, pixelated obscure, unnatural colors, poor lighting, dull, unclear, cropped, lowres, low quality, artifacts, duplicate",0,"fixed",4.99,30,0]},{"id":4,"type":"LoadImage","pos":{"0":-190,"1":480},"size":{"0":315,"1":314},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[24,33],"slot_index":0,"shape":3,"label":"图像"},{"name":"MASK","type":"MASK","links":[3],"slot_index":1,"shape":3,"label":"遮罩"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["KungFuCat.png","image"]},{"id":19,"type":"PreviewImage","pos":{"0":1278,"1":138},"size":{"0":210,"1":246},"flags":{},"order":9,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":36,"label":"图像"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"}},{"id":14,"type":"[Comfy3D] Save 3D Mesh","pos":{"0":1996.1025390625,"1":214.90586853027344},"size":{"0":259.5017395019531,"1":58},"flags":{},"order":13,"mode":0,"inputs":[{"name":"mesh","type":"MESH","link":37,"label":"网格"}],"outputs":[{"name":"save_path","type":"STRING","links":[16],"slot_index":0,"shape":3,"label":"保存路径"}],"properties":{"Node name for S&R":"[Comfy3D] Save 3D Mesh"},"widgets_values":["LGMTest/KungFuCat.obj"]},{"id":15,"type":"[Comfy3D] Preview 3DMesh","pos":{"0":2289,"1":215},"size":[600,500],"flags":{},"order":15,"mode":0,"inputs":[{"name":"mesh_file_path","type":"STRING","link":16,"widget":{"name":"mesh_file_path"},"label":"网格文件路径"}],"outputs":[],"properties":{"Node name for S&R":"[Comfy3D] Preview 3DMesh"},"widgets_values":["",null]},{"id":10,"type":"[Comfy3D] Preview 3DGS","pos":{"0":2203,"1":776},"size":[600,500],"flags":{},"order":14,"mode":0,"inputs":[{"name":"gs_file_path","type":"STRING","link":11,"widget":{"name":"gs_file_path"},"label":"gs文件路径"}],"outputs":[],"properties":{"Node name for S&R":"[Comfy3D] Preview 3DGS"},"widgets_values":["",null]},{"id":12,"type":"[Comfy3D] Switch 3DGS Axis","pos":{"0":1572,"1":776},"size":{"0":210,"1":106},"flags":{},"order":10,"mode":0,"inputs":[{"name":"gs_ply","type":"GS_PLY","link":19,"label":"gs_ply"}],"outputs":[{"name":"switched_gs_ply","type":"GS_PLY","links":[13],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] Switch 3DGS Axis"},"widgets_values":["+x","-y","-z"]},{"id":9,"type":"[Comfy3D] Save 3DGS","pos":{"0":1813,"1":777},"size":{"0":315,"1":58},"flags":{},"order":12,"mode":0,"inputs":[{"name":"gs_ply","type":"GS_PLY","link":13,"label":"gs_ply"}],"outputs":[{"name":"save_path","type":"STRING","links":[11],"slot_index":0,"shape":3,"label":"保存路径"}],"properties":{"Node name for S&R":"[Comfy3D] Save 3DGS"},"widgets_values":["LGMTest/KungFuCat.ply"]},{"id":17,"type":"[Comfy3D] Large Multiview Gaussian Model","pos":{"0":1270,"1":461},"size":{"0":252,"1":46},"flags":{},"order":8,"mode":0,"inputs":[{"name":"multiview_images","type":"IMAGE","link":35,"label":"多视图"},{"name":"lgm_model","type":"LGM_MODEL","link":22,"label":"LGM模型"}],"outputs":[{"name":"gs_ply","type":"GS_PLY","links":[19,38],"slot_index":0,"shape":3,"label":"gs_ply"}],"properties":{"Node name for S&R":"[Comfy3D] Large Multiview Gaussian Model"}},{"id":24,"type":"[Comfy3D] Convert 3DGS to Mesh with NeRF and Marching Cubes","pos":{"0":1566,"1":216},"size":{"0":411.6000061035156,"1":386},"flags":{},"order":11,"mode":0,"inputs":[{"name":"gs_ply","type":"GS_PLY","link":38,"label":"gs_ply"}],"outputs":[{"name":"mesh","type":"MESH","links":[37],"slot_index":0,"shape":3,"label":"网格"},{"name":"imgs","type":"IMAGE","links":null,"shape":3},{"name":"alphas","type":"MASK","links":null,"shape":3}],"properties":{"Node name for S&R":"[Comfy3D] Convert 3DGS to Mesh with NeRF and Marching Cubes"},"widgets_values":["big",1024,128,256,128,10,2048,512,512,512,512,1024,false]},{"id":20,"type":"[Comfy3D] Load Diffusers Pipeline","pos":{"0":-264,"1":278},"size":{"0":392.1646728515625,"1":154},"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"pipe","type":"DIFFUSERS_PIPE","links":[29],"slot_index":0,"shape":3,"label":"节点束"}],"properties":{"Node name for S&R":"[Comfy3D] Load Diffusers Pipeline"},"widgets_values":["Wonder3DMVDiffusionPipeline","flamehaze1115/wonder3d-v1.0","",false,""]}],"links":[[3,4,1,5,0,"MASK"],[11,9,0,10,0,"STRING"],[13,12,0,9,0,"GS_PLY"],[16,14,0,15,0,"STRING"],[19,17,0,12,0,"GS_PLY"],[22,1,0,17,1,"LGM_MODEL"],[23,2,0,18,0,"DIFFUSERS_PIPE"],[24,4,0,18,1,"IMAGE"],[25,5,0,18,2,"MASK"],[29,20,0,22,0,"DIFFUSERS_PIPE"],[32,5,0,22,2,"MASK"],[33,4,0,22,1,"IMAGE"],[34,22,0,23,0,"IMAGE"],[35,23,0,17,0,"IMAGE"],[36,23,0,19,0,"IMAGE"],[37,24,0,14,0,"MESH"],[38,17,0,24,0,"GS_PLY"]],"groups":[{"title":"MVDream: 4 multi-views","bounding":[-172,-366,1139,436],"color":"#3f789e","font_size":24,"flags":{}}],"config":{},"extra":{"ds":{"scale":0.6830134553650712,"offset":[166.03159570994592,124.89708290105193]}},"version":0.4}
## Additional Context
(Please add any additional context or steps to reproduce the error here)
我从comfyui-manage安装的和下载的您的安装包,都是这个问题。 在之前所有的自带工作流都可以运行。
是 diff_gaussian_rasterization
报的错,看起来 #14 很像,那个问题的解决方法是添加 TORCH_CUDA_ARCH_LIST
环境变量,指定自己显卡对应的架构版本。我在 run_nvidia_gpu.bat
已经添加了相关命令。
你先看看 TORCH_CUDA_ARCH_LIST
有没有正常启用。
如果该项正常的话就比较棘手了,diff_gaussian_rasterization 本身是位大佬读博时顺便搞的项目,其上游项目也一年多没更新了,最麻烦的是 CUDA C++ 报错信息少得可怜,如果有其他线索/日志信息,可以试试找找原因,没有的话只能从环境配置上尝试了。
我看有人说用您修改的较低版本torch2.2.0可行,我下载试了下,运行到转换obj网格竟然 需要几百T的显存(也有可能是内存) 我已经在环境变量添加了TORCH_CUDA_ARCH_LIST=12.1(我安装的cuda是12.1 ,我最后说明下:之前运行完全没问题)
这个arch是gpu架构(sm)版本,比如40系ada就是8.9,而非cuda版本 参考: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
------------------ 原始邮件 ------------------ 发件人: liulsg @.> 发送时间: 2024年10月12日 13:17 收件人: YanWenKun/ComfyUI-Windows-Portable @.> 抄送: YAN Wenkun @.>, Comment @.> 主题: Re: [YanWenKun/ComfyUI-Windows-Portable] 运行到转换obj节点就报错 (Issue #21)
我看有人说用您修改的较低版本torch2.2.0可行,我下载试了下,运行到转换obj网格竟然 需要几百T的显存(也有可能是内存) 我已经在环境变量添加了TORCH_CUDA_ARCH_LIST=12.1(我安装的cuda是12.1 ,我最后说明下:之前运行完全没问题)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
倒是还有个点,CUDA Toolkit 12.1 可能有 bug,装最新的 12.6 即可,兼容这些基于 12.1 编译的程序
------------------ 原始邮件 ------------------ 发件人: liulsg @.> 发送时间: 2024年10月12日 13:17 收件人: YanWenKun/ComfyUI-Windows-Portable @.> 抄送: YAN Wenkun @.>, Comment @.> 主题: Re: [YanWenKun/ComfyUI-Windows-Portable] 运行到转换obj节点就报错 (Issue #21)
我看有人说用您修改的较低版本torch2.2.0可行,我下载试了下,运行到转换obj网格竟然 需要几百T的显存(也有可能是内存) 我已经在环境变量添加了TORCH_CUDA_ARCH_LIST=12.1(我安装的cuda是12.1 ,我最后说明下:之前运行完全没问题)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
我的显卡是2080ti,好像最高支持cuda12.5
@YanWenKun 经过多个torch版本以及cuda版本的反复安装,我确定问题出在diff-gaussian-rasterization上,好像建立这个轮子的时候一直编译失败,即使重新配置了环境也不行。
编译失败是指它运行时编译 JIT 代码失败,还是尝试 build wheel 失败? 如果是前者的话,尝试本地编译 diff-gaussian-rasterization 也许可行 (代码简略,注意配置 TORCH_CUDA_ARCH_LIST=7.5)
pip wheel -w tmp_wheels git+https://github.com/ashawkey/diff-gaussian-rasterization.git
已经解决。cuda11.8 torch2.3.0 py311 cuda121 torch py312测试都没有问题了。 解决办法: 1.重装vs2022(17.9.0版本 看评论更高版本可能有问题) 2.通过anaconda 重装torch 安装comfyui 3通过comfyui-manage安装3D PACK 4.通过cuda卸载diff-gaussian-rasterization然后git diff-gaussian-rasterization 并安装 5.剩下的缺什么模块通过cuda安装 6.环境变量添加najia vs路径 等
3d-pack安装diff-gaussian-rasterization 好像编译的会出问题,但是通过git源代码再安装就可以。
Nice,看来 3D-Pack 作者编译的 wheel 也有些疑难兼容问题,我考虑加一个重新编译wheel的脚本供用户执行。或者单独做一个3D-Pack only包,把它那一大堆运行时下载的模型给打包进去
Message ID: @.***>
不知道您说的是依赖库还是需要的模型,那个模型共计70G! 至于您提到的制作单独的编译脚本,真的是一个好的想法。