Audrey M. Roy Greenfeld

Quietly building the future.

Installing StreamDiffusion on Vast.ai

2024-07-01

Installing StreamDiffusion on Vast.ai

My effort to get StreamDiffusion up and running on Vast.ai.

git clone https://github.com/cumulo-autumn/StreamDiffusion.git
python3 -m venv .venv
source .venv/bin/activate
pip3 install torch==2.1.0 torchvision==0.16.0 xformers --index-url https://download.pytorch.org/whl/cu118
pip3 install -e StreamDiffusion[tensorrt]

FYI The instructions actually say this under "For Developer":

python setup.py develop easy_install streamdiffusion[tensorrt]
python -m streamdiffusion.tools.install-tensorrt
cd StreamDiffusion/examples
python screen/main.py
Traceback (most recent call last):
  File "/root/StreamDiffusion/examples/screen/main.py", line 11, in <module>
    import mss
ModuleNotFoundError: No module named 'mss'
pip install mss
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
apt-get update
apt-get install libx11-dev
python screen/main.py
Traceback (most recent call last):                                 | 31.5M/492M [00:00<00:11, 39.5MB/s]
  File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap<00:25, 16.5MB/s]
    self.run()rch_model.bin:   1%|▍                               | 41.9M/3.44G [00:02<04:15, 13.3MB/s]
  File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 108, in run [00:02<00:33, 9.40MB/s]
    self._target(*self._args, **self._kwargs)
  File "/root/StreamDiffusion/examples/screen/../../utils/viewer.py", line 76, in receive_images
    root = tk.Tk()
  File "/opt/conda/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
apt-get install xvfb

Note: it didn't resolve the error, so not sure if necessary.

python screen/main.py 
/root/.venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Process SpawnProcess-2:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/root/StreamDiffusion/examples/screen/main.py", line 67, in monitor_setting_process
    monitor = dummy_screen(width, height)
  File "/root/StreamDiffusion/examples/screen/main.py", line 45, in dummy_screen
    root = tk.Tk()
  File "/opt/conda/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
text_encoder/model.safetensors not found
Fetching 15 files:   0%|                                                        | 0/15 [00:00<?, ?it/s]
/root/.venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:982: UserWarning: Not enough free disk space to download the file. The expected file size is: 3438.37 MB. The target location /root/.cache/huggingface/hub/models--KBlueLeaf--kohaku-v2.1/blobs only has 2780.53 MB free disk space.
  warnings.warn(
                                                                                                      Process SpawnProcess-3:l.bin:  47%|███████████████▉                  | 157M/335M [00:04<00:13, 13.0MB/s]
Traceback (most recent call last):████████▋                         | 210M/492M [00:04<00:22, 12.7MB/s]
  File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap<05:04, 10.8MB/s]
    self.run()bin:  18%|███████▊                                   | 220M/1.22G [00:05<01:19, 12.5MB/s]
  File "/opt/conda/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/root/StreamDiffusion/examples/screen/../../utils/viewer.py", line 76, in receive_images
    root = tk.Tk()
  File "/opt/conda/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
                                                                                                      process2 terminated.odel.bin:  50%|█████████████████                 | 168M/335M [00:05<00:13, 12.4MB/s]
process1 terminating...|███████████████████▋                        | 220M/492M [00:05<00:21, 12.6MB/s]
diffusion_pytorch_model.bin:   5%|█▋                               | 178M/3.44G [00:05<05:09, 10.5MB/sprocess1 still alive. force killing...███████████████████▎           | 220M/335M [00:10<00:10, 10.5MB/s]
process1 terminated.55%|████████████████████████▎                   | 273M/492M [00:10<00:20, 11.0MB/s]
/opt/conda/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown   | 294M/1.22G [00:10<01:13, 12.6MB/s]
  warnings.warn('resource_tracker: There appear to be %d '

Not enough disk space to download the file. The expected file size is 3438.37 MB. The target location /root/.cache/huggingface/hub/models--KBlueLeaf--kohaku-v2.1/blobs only has 2780.53 MB free disk space.

I destroyed the instance for now to save money.

TODO for when I continue: