golemfactory / ya-runtime-ai

1 stars 1 forks source link

Filesystem paths in Automatic API Error responses #36

Open pwalski opened 8 months ago

pwalski commented 8 months ago

In case of misconfigured model Automatic API returns error response including host filesystem paths:

{
'error': 'FileNotFoundError', 
'detail': '', 'body': '',
'errors': "No checkpoints found. When searching for checkpoints, looked at:\n - file D:\\Code\\gamerhash-facade\\modules\\plugins\\automatic\\webui\\sd_xl_base_1.0_92180a67d096be309c5e6a7146d89aac4ef900e2bf48a52ea569df7d.safetensors\n - directory D:\\Code\\gamerhash-facade\\modules\\plugins\\automatic\\webui\\models\\Stable-diffusion\n - directory D:\\Code\\gamerhash-facade\\modules\\plugins\\automatic\\webui\\Code\\gamerhash-facade\\modules\\golem-data\\provider\\exe-unit\\cacheCan't run without a checkpoint. Find and place a .ckpt or .safetensors file into any of those locations."
}
pwalski commented 8 months ago

This task and recent discussion about OCI support was an excuse to check how Automatic could be started on Windows in an isolated environment.

There is a Windows fork of runc (low level lib for running OCI containers) called runhcs. https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/containerd#runhcs It supports both Hyper-V virtualization and Windows Process Containers. Hyper-V is disabled by default, so it is not an option. Process isolation allows to hide fs, network, and obviously process space. https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container#process-isolation It also allows to share devices (GPU) https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/hardware-devices-in-containers#what-devices-are-supported I know there is a nvidia-container-runtime allowing to use GPU on containers on Windows, but I think it is required for containerd runtime (so docker, k8s, etc.) to support GPU on linux containers. It seems it is possible to just run runhcs in a directory with config.json OCI container descriptor to start a container (without requirement to install and start any daemon as in case of containerd/docker). It could be worth to check if it will be possible to start this way Automatic in container with Windows baseimage and whether it will be able to access GPU.