AssertionError: libcuda.so cannot found!

#12
by umangagarwal - opened

Looking at the output from the space, I tried to reproduce the inference code in google collab notebook.

I have used:
T4 GPU
python version: 3.10.12
CUDA version: 11.8.89

Below is my inference code:

import torch
from diffusers import StableVideoDiffusionPipeline

pipe = StableVideoDiffusionPipeline.from_pretrained(
    "stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16"
)

pipe.to("cuda")
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
pipe.vae = torch.compile(pipe.vae, mode="reduce-overhead", fullgraph=True)

max_64_bit_int = 2**63 - 1

from PIL import Image
image = Image.open('/content/Disaster_Girl.jpg').convert("RGB")
image

generator = torch.manual_seed(47)
decoding_t= 3
motion_bucket_id= 127

frames = pipe(image, decode_chunk_size=decoding_t, generator=generator, motion_bucket_id=motion_bucket_id, noise_aug_strength=0.1).frames[0]

It throws an error saying
```

BackendCompilerFailed Traceback (most recent call last)
in <cell line: 5>()
3 motion_bucket_id= 127
4
----> 5 frames = pipe(image, decode_chunk_size=decoding_t, generator=generator, motion_bucket_id=motion_bucket_id, noise_aug_strength=0.1).frames[0]

54 frames
/usr/lib/python3.10/concurrent/futures/_base.py in __get_result(self)
401 if self._exception:
402 try:
--> 403 raise self._exception
404 finally:
405 # Break a reference cycle with the exception in self._exception

BackendCompilerFailed: backend='inductor' raised:
AssertionError: libcuda.so cannot found!


Use these to handle this error.
!export LC_ALL="en_US.UTF-8"
!export LD_LIBRARY_PATH="/usr/lib64-nvidia"
!export LIBRARY_PATH="/usr/local/cuda/lib64/stubs"
!ldconfig /usr/lib64-nvidia

Sign up or log in to comment