AInseven / ComfyUI-fastblend

fastblend for comfyui, and other nodes that I write for generate video. rebatch image, my openpose
161 stars 17 forks source link

CuPy failed to load libnvrtc.so.12 #5

Closed alexbofa closed 6 months ago

alexbofa commented 6 months ago

Hello, I use the paperspace.com node Smooth Video and gives such an error: There is no such error on the local computer, what could be the problem?

Error occurred when executing SmoothVideo:

CuPy failed to load libnvrtc.so.12: OSError: libnvrtc.so.12: cannot open shared object file: No such file or directory

File "/notebooks/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/notebooks/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/notebooks/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/notebooks/ComfyUI/custom_nodes/AInseven/smoothVideo.py", line 110, in execute
frames = smooth_video(
File "/notebooks/ComfyUI/custom_nodes/AInseven/FastBlend/api.py", line 75, in smooth_video
frames=FastModeRunner().run(frames_guide, frames_style, batch_size=batch_size, window_size=window_size,
File "/notebooks/ComfyUI/custom_nodes/AInseven/FastBlend/runners/fast.py", line 125, in run
table_l = table_manager.build_remapping_table(frames_guide, frames_style, patch_match_engine, batch_size, desc="Fast Mode Step 1/4")
File "/notebooks/ComfyUI/custom_nodes/AInseven/FastBlend/runners/fast.py", line 44, in build_remapping_table
_, target_style = patch_match_engine.estimate_nnf(source_guide, target_guide, source_style)
File "/notebooks/ComfyUI/custom_nodes/AInseven/FastBlend/patch_match.py", line 291, in estimate_nnf
nnf = self.initialize_nnf(source_guide.shape[0]) if level==0 else self.update_nnf(nnf, level)
File "/notebooks/ComfyUI/custom_nodes/AInseven/FastBlend/patch_match.py", line 254, in initialize_nnf
cp.repeat(cp.arange(height), width).reshape(height, width),
File "/usr/local/lib/python3.10/dist-packages/cupy/_creation/ranges.py", line 60, in arange
_arange_ufunc(typ(start), typ(step), ret, dtype=dtype)
File "cupy/_core/_kernel.pyx", line 1375, in cupy._core._kernel.ufunc.__call__
File "cupy/_core/_kernel.pyx", line 1402, in cupy._core._kernel.ufunc._get_ufunc_kernel
File "cupy/_core/_kernel.pyx", line 1082, in cupy._core._kernel._get_ufunc_kernel
File "cupy/_core/_kernel.pyx", line 94, in cupy._core._kernel._get_simple_elementwise_kernel
File "cupy/_core/_kernel.pyx", line 82, in cupy._core._kernel._get_simple_elementwise_kernel_from_code
File "cupy/_core/core.pyx", line 2254, in cupy._core.core.compile_with_cache
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 484, in _compile_module_with_cache
return _compile_with_cache_cuda(
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 499, in _compile_with_cache_cuda
arch = _get_arch()
File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 148, in _get_arch
nvrtc_max_compute_capability = _get_max_compute_capability()
File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 126, in _get_max_compute_capability
major, minor = _get_nvrtc_version()
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 115, in _get_nvrtc_version
_nvrtc_version = nvrtc.getVersion()
File "cupy_backends/cuda/libs/nvrtc.pyx", line 56, in cupy_backends.cuda.libs.nvrtc.getVersion
File "cupy_backends/cuda/libs/nvrtc.pyx", line 57, in cupy_backends.cuda.libs.nvrtc.getVersion
File "cupy_backends/cuda/libs/_cnvrtc.pxi", line 72, in cupy_backends.cuda.libs.nvrtc.initialize
File "cupy_backends/cuda/libs/_cnvrtc.pxi", line 76, in cupy_backends.cuda.libs.nvrtc._initialize
File "cupy_backends/cuda/libs/_cnvrtc.pxi", line 143, in cupy_backends.cuda.libs.nvrtc._get_softlink
File "cupy_backends/cuda/_softlink.pyx", line 32, in cupy_backends.cuda._softlink.SoftLink.__init__
AInseven commented 6 months ago

My computer doesn't have libnvrtc.so.12 either. Do you use this on Linux? try this https://developer.nvidia.com/cuda-downloads Its about the installation of Cupy.

alexbofa commented 6 months ago

Unfortunately, yes paperspace.com it runs on Linux.. unfortunately, it didn't help. It seems to me that he cannot find the path with this file, but this is not accurate.

AInseven commented 6 months ago

Maybe you can search about the installation of CuPy on Linux. Windows solve the path problems by Environment Variables. I'm not familiar with Linux.

AInseven commented 6 months ago

After launch ComfyUI, you can see 'torch version---------------------- 2.1.0+cu121' in the console. 'cu121' means cuda12.1,if your version is lower than this, like cuda11, then that maybe another problem, cause the code I write is to install cupy-cuda12.

alexbofa commented 6 months ago

On the home computer Torch version: 2.2.0+cu121 and then everything is OK

There was a torch on paperspace first torch version---------------------- 1.12.1+cu116 Now torch version---------------------- 2.2.0+cu121 Python 3.10.10

The error is the same anyway

The feeling that he should take this path /usr/local/lib/python3.10/dist-packages/cupy_backends/cuda/libs/nvrtc.pyx, but for some reason he takes it cupy_backends/cuda/libs/nvrtc.pyx I tried to move the folder, but everything is the same. I don't have any ideas yet...

Error occurred when executing SmoothVideo:

CuPy failed to load libnvrtc.so.12: OSError: libnvrtc.so.12: cannot open shared object file: No such file or directory

File "/notebooks/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/notebooks/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/notebooks/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/notebooks/ComfyUI/custom_nodes/ComfyUI-fastblend/smoothVideo.py", line 110, in execute
frames = smooth_video(
File "/notebooks/ComfyUI/custom_nodes/ComfyUI-fastblend/FastBlend/api.py", line 75, in smooth_video
frames=FastModeRunner().run(frames_guide, frames_style, batch_size=batch_size, window_size=window_size,
File "/notebooks/ComfyUI/custom_nodes/ComfyUI-fastblend/FastBlend/runners/fast.py", line 125, in run
table_l = table_manager.build_remapping_table(frames_guide, frames_style, patch_match_engine, batch_size, desc="Fast Mode Step 1/4")
File "/notebooks/ComfyUI/custom_nodes/ComfyUI-fastblend/FastBlend/runners/fast.py", line 44, in build_remapping_table
_, target_style = patch_match_engine.estimate_nnf(source_guide, target_guide, source_style)
File "/notebooks/ComfyUI/custom_nodes/ComfyUI-fastblend/FastBlend/patch_match.py", line 291, in estimate_nnf
nnf = self.initialize_nnf(source_guide.shape[0]) if level==0 else self.update_nnf(nnf, level)
File "/notebooks/ComfyUI/custom_nodes/ComfyUI-fastblend/FastBlend/patch_match.py", line 254, in initialize_nnf
cp.repeat(cp.arange(height), width).reshape(height, width),
File "/usr/local/lib/python3.10/dist-packages/cupy/_creation/ranges.py", line 60, in arange
_arange_ufunc(typ(start), typ(step), ret, dtype=dtype)
File "cupy/_core/_kernel.pyx", line 1375, in cupy._core._kernel.ufunc.__call__
File "cupy/_core/_kernel.pyx", line 1402, in cupy._core._kernel.ufunc._get_ufunc_kernel
File "cupy/_core/_kernel.pyx", line 1082, in cupy._core._kernel._get_ufunc_kernel
File "cupy/_core/_kernel.pyx", line 94, in cupy._core._kernel._get_simple_elementwise_kernel
File "cupy/_core/_kernel.pyx", line 82, in cupy._core._kernel._get_simple_elementwise_kernel_from_code
File "cupy/_core/core.pyx", line 2254, in cupy._core.core.compile_with_cache
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 484, in _compile_module_with_cache
return _compile_with_cache_cuda(
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 499, in _compile_with_cache_cuda
arch = _get_arch()
File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 148, in _get_arch
nvrtc_max_compute_capability = _get_max_compute_capability()
File "cupy/_util.pyx", line 64, in cupy._util.memoize.decorator.ret
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 126, in _get_max_compute_capability
major, minor = _get_nvrtc_version()
File "/usr/local/lib/python3.10/dist-packages/cupy/cuda/compiler.py", line 115, in _get_nvrtc_version
_nvrtc_version = nvrtc.getVersion()
File "cupy_backends/cuda/libs/nvrtc.pyx", line 56, in cupy_backends.cuda.libs.nvrtc.getVersion
File "cupy_backends/cuda/libs/nvrtc.pyx", line 57, in cupy_backends.cuda.libs.nvrtc.getVersion
File "cupy_backends/cuda/libs/_cnvrtc.pxi", line 72, in cupy_backends.cuda.libs.nvrtc.initialize
File "cupy_backends/cuda/libs/_cnvrtc.pxi", line 76, in cupy_backends.cuda.libs.nvrtc._initialize
File "cupy_backends/cuda/libs/_cnvrtc.pxi", line 143, in cupy_backends.cuda.libs.nvrtc._get_softlink
File "cupy_backends/cuda/_softlink.pyx", line 32, in cupy_backends.cuda._softlink.SoftLink.__init__
alexbofa commented 6 months ago

Maybe you can search about the installation of CuPy on Linux. Windows solve the path problems by Environment Variables. I'm not familiar with Linux.

Thanks for the idea, it turns out that the CUDA TOOLKIT is really to blame

torch version---------------------- 2.2.0+cu121

https://developer.nvidia.com/cuda-downloads Linux -> x86_64 -> Ubuntu -> 20.04 -> deb (network)

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb sudo dpkg -i cuda-keyring_1.1-1_all.deb sudo apt-get update sudo apt-get -y install cuda-toolkit-12-3

This solved the problem, thanks

AInseven commented 2 months ago

Did you write a cupy-cu12x version check in the code? I changed cupy-cu12x to cupy-cu11x in requirements.txt, but cupy-cu12x is still installed after starting ComfyUI

yes, you can check init.py

AInseven commented 2 months ago

Did you write a cupy-cu12x version check in the code? I changed cupy-cu12x to cupy-cu11x in requirements.txt, but cupy-cu12x is still installed after starting ComfyUI

yes, you can check init.py

thank you, I got it, so,I want to know if your code can run properly with cupy-cu11x?

yean,it can run with cu11x.