Starting ComfyUI results in a RuntimeError: No CUDA GPUs are available
Steps to reproduce the behavior:
- I start ComfyUI-AMD.ps1, it installs normally and just before launching ComfyUI it asks me to adjust HIP_VISIBLE_DEVICES
- I guessed (correctly) it must be 1 for my RX 9070 XT
- The log shows the following messages:
Console log - only RX 9070 XT
🎮 GPU: RDNA 4 (RX 9000 series)
🔧 GFX Version: 12.0.0
🌐 Starting web interface...
[INFO] setup plugin alembic.autogenerate.schemas
[INFO] setup plugin alembic.autogenerate.tables
[INFO] setup plugin alembic.autogenerate.types
[INFO] setup plugin alembic.autogenerate.constraints
[INFO] setup plugin alembic.autogenerate.defaults
[INFO] setup plugin alembic.autogenerate.comments
[INFO] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'gemv_awq_w4a16', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8']}
[INFO] Found comfy_kitchen backend cuda: {'available': False, 'disabled': True, 'unavailable_reason': 'CUDA not available on this system', 'capabilities': []}
[INFO] Found comfy_kitchen backend triton: {'available': False, 'disabled': True, 'unavailable_reason': "ImportError: No module named 'triton'", 'capabilities': []}
[INFO] Checkpoint files will always be loaded safely.
Traceback (most recent call last):
File "D:\stable-diffusion\ComfyUI\main.py", line 219, in
import execution
File "D:\stable-diffusion\ComfyUI\execution.py", line 18, in
import comfy.model_management
File "D:\stable-diffusion\ComfyUI\comfy\model_management.py", line 362, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\model_management.py", line 211, in get_torch_device
return torch.device(torch.cuda.current_device())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\cuda_init_.py", line 1165, in current_device
lazy_init()
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\cuda_init.py", line 489, in _lazy_init
torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
Expected behavior
ComfyUI starts and executes workflows normally
Desktop
- OS: Windows 10 IoT Enterprise LTSC (up to date)
- Browser: Firefox 151.0.4, but happens before Browser comes into play
- Version: Whatever was current on 10.06.26 at
irm https://raw.githubusercontent.com/SystemVll/ComfyUI-AMD/main/ComfyUI-AMD.ps1 | iex
Additional context
It asks me about HIP_VISIBLE_DEVICES every time.
When I enter 0 for my iGPU it actually starts ComfyUI, but as expected crashes upon trying to run a workflow, with log error "wrong architecture", which sounds about correct.
When I leave it blank it's also starting and both GPUs are mentioned in the log. Then, when trying to run a workflow it crashes with error "hipErrorInvalidImage". I followed the link to the AMD site but there's no info what to do about the error, so please help! :)
Console log - both GPUs
[INFO] got prompt
[INFO] model weight dtype torch.float16, manual cast: None
[INFO] model_type EPS
[INFO] Using split attention in VAE
[INFO] Using split attention in VAE
[INFO] VAE load device: cuda:0, offload device: cpu, dtype: torch.bfloat16
[INFO] Requested to load SDXLClipModel
[INFO] loaded completely; 1560.80 MB loaded, full load: True
[INFO] CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cuda:0, dtype: torch.float16
[ERROR] !!! Exception during processing !!! CUDA error: device kernel image is invalid
Search for 'hipErrorInvalidImage' in https://rocm.docs.amd.com/projects/HIP/en/latest/index.html for more information.
Device-side assertion tracking was not enabled by user.
[ERROR] Traceback (most recent call last):
File "D:\stable-diffusion\ComfyUI\execution.py", line 536, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\execution.py", line 336, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\execution.py", line 310, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\stable-diffusion\ComfyUI\execution.py", line 298, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\nodes.py", line 79, in encode
return (clip.encode_from_tokens_scheduled(tokens), )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd.py", line 326, in encode_from_tokens_scheduled
pooled_dict = self.encode_from_tokens(tokens, return_pooled=return_pooled, return_dict=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd.py", line 395, in encode_from_tokens
o = self.cond_stage_model.encode_token_weights(tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sdxl_clip.py", line 59, in encode_token_weights
g_out, g_pooled = self.clip_g.encode_token_weights(token_weight_pairs_g)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 45, in encode_token_weights
o = self.encode(to_encode)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 306, in encode
return self(tokens)
^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 266, in forward
embeds, attention_mask, num_tokens, embeds_info = self.process_tokens(tokens, device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 213, in process_tokens
tokens_embed = self.transformer.get_input_embeddings()(tokens_embed, out_dtype=torch.float32)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\ops.py", line 761, in forward
return self.forward_comfy_cast_weights(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\ops.py", line 753, in forward_comfy_cast_weights
x = torch.nn.functional.embedding(input, weight, self.padding_idx, self.max_norm, self.norm_type, self.scale_grad_by_freq, self.sparse).to(dtype=output_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\functional.py", line 2567, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.AcceleratorError: CUDA error: device kernel image is invalid
Search for `hipErrorInvalidImage' in https://rocm.docs.amd.com/projects/HIP/en/latest/index.html for more information.
Device-side assertion tracking was not enabled by user.
Starting ComfyUI results in a RuntimeError: No CUDA GPUs are available
Steps to reproduce the behavior:
Console log - only RX 9070 XT
🎮 GPU: RDNA 4 (RX 9000 series) 🔧 GFX Version: 12.0.0 🌐 Starting web interface...
[INFO] setup plugin alembic.autogenerate.schemas
[INFO] setup plugin alembic.autogenerate.tables
[INFO] setup plugin alembic.autogenerate.types
[INFO] setup plugin alembic.autogenerate.constraints
[INFO] setup plugin alembic.autogenerate.defaults
[INFO] setup plugin alembic.autogenerate.comments
[INFO] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'apply_rope_split_half', 'apply_rope_split_half1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'gemv_awq_w4a16', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8']}
[INFO] Found comfy_kitchen backend cuda: {'available': False, 'disabled': True, 'unavailable_reason': 'CUDA not available on this system', 'capabilities': []}
[INFO] Found comfy_kitchen backend triton: {'available': False, 'disabled': True, 'unavailable_reason': "ImportError: No module named 'triton'", 'capabilities': []}
[INFO] Checkpoint files will always be loaded safely.
Traceback (most recent call last):
File "D:\stable-diffusion\ComfyUI\main.py", line 219, in
import execution
File "D:\stable-diffusion\ComfyUI\execution.py", line 18, in
import comfy.model_management
File "D:\stable-diffusion\ComfyUI\comfy\model_management.py", line 362, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\model_management.py", line 211, in get_torch_device
return torch.device(torch.cuda.current_device())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\cuda_init_.py", line 1165, in current_device
lazy_init()
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\cuda_init.py", line 489, in _lazy_init
torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
Expected behavior
ComfyUI starts and executes workflows normally
Desktop
irm https://raw.githubusercontent.com/SystemVll/ComfyUI-AMD/main/ComfyUI-AMD.ps1 | iexAdditional context
It asks me about HIP_VISIBLE_DEVICES every time.
When I enter 0 for my iGPU it actually starts ComfyUI, but as expected crashes upon trying to run a workflow, with log error "wrong architecture", which sounds about correct.
When I leave it blank it's also starting and both GPUs are mentioned in the log. Then, when trying to run a workflow it crashes with error "hipErrorInvalidImage". I followed the link to the AMD site but there's no info what to do about the error, so please help! :)
Console log - both GPUs
[INFO] got prompt
[INFO] model weight dtype torch.float16, manual cast: None
[INFO] model_type EPS
[INFO] Using split attention in VAE
[INFO] Using split attention in VAE
[INFO] VAE load device: cuda:0, offload device: cpu, dtype: torch.bfloat16
[INFO] Requested to load SDXLClipModel
[INFO] loaded completely; 1560.80 MB loaded, full load: True
[INFO] CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cuda:0, dtype: torch.float16
[ERROR] !!! Exception during processing !!! CUDA error: device kernel image is invalid
Search for 'hipErrorInvalidImage' in https://rocm.docs.amd.com/projects/HIP/en/latest/index.html for more information.
Device-side assertion tracking was not enabled by user.
[ERROR] Traceback (most recent call last):
File "D:\stable-diffusion\ComfyUI\execution.py", line 536, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\execution.py", line 336, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\execution.py", line 310, in _async_map_node_over_list
await process_inputs(input_dict, i)
File "D:\stable-diffusion\ComfyUI\execution.py", line 298, in process_inputs
result = f(**inputs)
^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\nodes.py", line 79, in encode
return (clip.encode_from_tokens_scheduled(tokens), )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd.py", line 326, in encode_from_tokens_scheduled
pooled_dict = self.encode_from_tokens(tokens, return_pooled=return_pooled, return_dict=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd.py", line 395, in encode_from_tokens
o = self.cond_stage_model.encode_token_weights(tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sdxl_clip.py", line 59, in encode_token_weights
g_out, g_pooled = self.clip_g.encode_token_weights(token_weight_pairs_g)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 45, in encode_token_weights
o = self.encode(to_encode)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 306, in encode
return self(tokens)
^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 266, in forward
embeds, attention_mask, num_tokens, embeds_info = self.process_tokens(tokens, device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\sd1_clip.py", line 213, in process_tokens
tokens_embed = self.transformer.get_input_embeddings()(tokens_embed, out_dtype=torch.float32)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\modules\module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\ops.py", line 761, in forward
return self.forward_comfy_cast_weights(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI\comfy\ops.py", line 753, in forward_comfy_cast_weights
x = torch.nn.functional.embedding(input, weight, self.padding_idx, self.max_norm, self.norm_type, self.scale_grad_by_freq, self.sparse).to(dtype=output_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\stable-diffusion\ComfyUI.venv\Lib\site-packages\torch\nn\functional.py", line 2567, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.AcceleratorError: CUDA error: device kernel image is invalid
Search for `hipErrorInvalidImage' in https://rocm.docs.amd.com/projects/HIP/en/latest/index.html for more information.
Device-side assertion tracking was not enabled by user.