ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root

Open immodalmul opened this issue 1 year ago • 2 comments

Geting this error while using on modal.com

immodalmul avatar Nov 03 '24 22:11 immodalmul

I get the same.

prp-e avatar Dec 02 '24 17:12 prp-e

This happens to me when having quantize: true, if you disable it works perfectly. The problem is that looks to be using ~40GB of VRAM, so you will need one of the high end GPUs, which means more money.

You would rather not use those high end GPUs?

To fix this issue, you can use a different image. By default the run_modal.py comes with modal.Image.debian_slim(python_version="3.11")

But you can modify it to modal.Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04", add_python="3.11")

Will look something like this:

modal.Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04", add_python="3.11")
    # install required system and pip packages, more about this modal approach: https://modal.com/docs/examples/dreambooth_app
    .apt_install("libgl1", "libglib2.0-0")
    .pip_install("cupy-cuda12x")
    .pip_install(
        "python-dotenv",
        ...
    }

I'm proposing this change here: https://github.com/ostris/ai-toolkit/pull/246

EmmanuelMr18 avatar Jan 31 '25 21:01 EmmanuelMr18