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

Crash when trying to create larger music #9

Open
BillZoro opened this issue Mar 6, 2024 · 0 comments
Open

Crash when trying to create larger music #9

BillZoro opened this issue Mar 6, 2024 · 0 comments

Comments

@BillZoro
Copy link

BillZoro commented Mar 6, 2024

When using Musicgen (HF) Generator, I can generate musics of up to 40 seconds, but if I put more than 50 seconds, it gives an error and comfyui crashes.

When using vram, the vram doesn't go over 80%, the ram doesn't go over 70%, everything seems fine. When using CPU only, it doesn't go over 75%. It uses the same amount of resources if I generate a 10/20/30/40 seconds songs. But of course, my desktop isn't very strong, so it may be the cause, but when I use "one-click-installers-tts-6.0" (audio-webui) I can generate music up to 4 minutes (maybe more, didn't test) using the same "musicgen-small" model.

This is the error I get when using cpu only mode:

C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [4,0,0], thread: [127,0,0] Assertion srcIndex < srcSelectDimSize failed.

This is the error I get when using VRam:

C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [3,0,0], thread: [90,0,0] Assertion srcIndex < srcSelectDimSizefailed. C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [3,0,0], thread: [91,0,0] AssertionsrcIndex < srcSelectDimSizefailed. C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [3,0,0], thread: [92,0,0] AssertionsrcIndex < srcSelectDimSizefailed. C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [3,0,0], thread: [93,0,0] AssertionsrcIndex < srcSelectDimSizefailed. C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [3,0,0], thread: [94,0,0] AssertionsrcIndex < srcSelectDimSizefailed. C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:1239: block: [3,0,0], thread: [95,0,0] AssertionsrcIndex < srcSelectDimSize` failed.

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\random.py", line 165, in fork_rng
yield
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\custom_nodes\ComfyUI-audio\musicgen_hf_nodes.py", line 124, in generate
samples = m.generate(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 2430, in generate
outputs = self.sample(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\generation\utils.py", line 2642, in sample
outputs = self(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 1916, in forward
decoder_outputs = self.decoder(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 1029, in forward
outputs = self.model(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 938, in forward
decoder_outputs = self.decoder(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 848, in forward
layer_outputs = decoder_layer(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 400, in forward
hidden_states, self_attn_weights, present_key_value = self.self_attn(
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\transformers\models\musicgen\modeling_musicgen.py", line 250, in forward
value_states = self._shape(self.v_proj(hidden_states), -1, bsz)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\nn\modules\linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: CUDA error: unknown error
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\custom_nodes\ComfyUI-audio\musicgen_hf_nodes.py", line 95, in generate
with (
File "contextlib.py", line 153, in exit
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\random.py", line 169, in fork_rng
device_mod.set_rng_state(device_rng_state, device)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\cuda\random.py", line 75, in set_rng_state
lazy_call(cb)
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\cuda_init
.py", line 229, in _lazy_call
callable()
File "D:\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI2\venv\lib\site-packages\torch\cuda\random.py", line 73, in cb
default_generator.set_state(new_state_copy)
RuntimeError: CUDA error: unknown error
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.`

It's the same error.

This is the way I've setup the nodes, it works fine when creating smaller music.

image

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

No branches or pull requests

1 participant