nod-ai / SHARK-Studio

SHARK Studio -- Web UI for SHARK+IREE High Performance Machine Learning Distribution
Apache License 2.0
1.42k stars 170 forks source link

cannot mmap an empty file #1839

Open sesenseise opened 1 year ago

sesenseise commented 1 year ago

Hi, I'm new I tried following the install guide got this installed nodai_shark_studio_20230713_819.exe the special driver for my vega64 23.9.2 amd adrenalin , before I used to get an out of memory error now I get this when I restarted everything from scratch the only thing i added was trying the flag low vram but it still doesnt work without it, I'm still getting registry lookup failed to get layer manifest files error and the folder is 1.7gb instead of about 5 before. at the end it keeps saying cannot mmap to an empty file. after lots of trial and error I got a1111 working but since I started with shark I wanted to finish :) and stop the itch of making it work, I'm assuming there is some benefit somewhere too?

shark_tank local cache is located at C:\Users\usu.local/shark_tank/ . You may change this by setting the --local_tank_cache= flag gradio temporary image cache located at C:\shark\shark_tmp/gradio. You may change this by setting the GRADIO_TEMP_DIR environment variable. No temporary images files to clear. vulkan devices are available. shark_tank local cache is located at C:\Users\usu.local/shark_tank/ . You may change this by setting the --local_tank_cache= flag metal devices are not available. cuda devices are not available. local-sync devices are available. shark_tank local cache is located at C:\Users\usu.local/shark_tank/ . You may change this by setting the --local_tank_cache= flag local-task devices are available. shark_tank local cache is located at C:\Users\usu.local/shark_tank/ . You may change this by setting the --local_tank_cache= flag diffusers\models\cross_attention.py:30: FutureWarning: Importing from cross_attention is deprecated. Please import from diffusers.models.attention_processor instead. ['Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz => local-task://0', 'Radeon RX Vega => vulkan://0'] shark_tank local cache is located at C:\Users\usu.local/shark_tank/ . You may change this by setting the --local_tank_cache= flag Running on local URL: http://0.0.0.0:8080 Found device Radeon RX Vega. Using target triple rdna2-unknown-windows.

To create a public link, set share=True in launch(). Using tuned models for stabilityai/stable-diffusion-2-1-base(fp16) on device vulkan://00000000-0300-0000-0000-000000000000. loading existing vmfb from: C:\shark\euler_scale_model_input_1_512_512_vulkan_fp16.vmfb WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\euler_scale_model_input_1_512_512_vulkan_fp16.vmfb as a mmapped file loading existing vmfb from: C:\shark\euler_step_1_512_512_vulkan_fp16.vmfb WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\euler_step_1_512_512_vulkan_fp16.vmfb as a mmapped file use_tuned? sharkify: True _1_64_512_512_fp16_tuned_stable-diffusion-2-1-base Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\clip_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base_vulkan.vmfb as a mmapped file WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base_vulkan.vmfb as a mmapped file cannot mmap an empty file Retrying with a different base model configuration WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base_vulkan.vmfb as a mmapped file cannot mmap an empty file Retrying with a different base model configuration WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base_vulkan.vmfb as a mmapped file cannot mmap an empty file Retrying with a different base model configuration WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base_vulkan.vmfb as a mmapped file cannot mmap an empty file Retrying with a different base model configuration WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files. Loading flatbuffer at C:\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base_vulkan.vmfb as a mmapped file cannot mmap an empty file Retrying with a different base model configuration Traceback (most recent call last): File "gradio\routes.py", line 439, in run_predict File "gradio\blocks.py", line 1384, in process_api File "gradio\blocks.py", line 1103, in call_function File "gradio\utils.py", line 343, in async_iteration File "gradio\utils.py", line 336, in anext File "anyio\to_thread.py", line 33, in run_sync File "anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread File "anyio_backends_asyncio.py", line 807, in run File "gradio\utils.py", line 319, in run_sync_iterator_async File "gradio\utils.py", line 688, in gen_wrapper File "ui\txt2img_ui.py", line 186, in txt2img_inf File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 134, in generate_images File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 235, in produce_img_latents File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 114, in load_unet File "apps\stable_diffusion\src\models\model_wrappers.py", line 826, in unet File "apps\stable_diffusion\src\models\model_wrappers.py", line 821, in unet File "apps\stable_diffusion\src\models\model_wrappers.py", line 63, in check_compilation SystemExit: Could not compile Unet. Please create an issue with the detailed log at https://github.com/nod-ai/SHARK/issues

njsharpe commented 1 year ago

Hello! It sounds like SHARK is having an issue writing to the files it creates in your installation folder. It looks like you are using a folder directly in your C:\ drive, which is an administrator protected directory. Please move your SHARK exe to a public directory like anywhere under %USERPROFILE%, or launch the exe with administrator permissions.

How to launch an exe with administrator permissions on Windows 1. Right-click the exe 2. Click "properties" 3. Go to the "Compatibility" tab 4. Make sure "Run this program as an administrator" is checked 5. Click "Apply", then "OK"

EDIT: Formatting

NeedsMoar commented 1 year ago

@njsharpe When did that become a thing? Or is it just that I've never used Windows 10 Home... I never changed these from a fresh install C:>icacls . . BUILTIN\Administrators:(OI)(CI)(F) NT AUTHORITY\SYSTEM:(OI)(CI)(F) BUILTIN\Users:(OI)(CI)(RX) NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(M) NT AUTHORITY\Authenticated Users:(AD) Mandatory Label\High Mandatory Level:(OI)(NP)(IO)(NW)

The default directories like C:\Windows and the program files directories remain read / execute only for users though.

NeedsMoar commented 1 year ago

In any case I'd suggest never running python programs as admin, much better if you have admin access would be to take ownership of C:\shark or give Users (or only your account) write permissions. Come to think of it I'm not sure how the llvm process would be able to create empty files as a user account on a directory they didn't have (M) permissions for since the weird permission combination (WD) with no inheritance or only (CI) preventing the file from inheriting the user write access on the directory but still allowing creation isn't added to the ACLs of a directory automatically by anything. Not sure I've ever seen it used actually, it doesn't make much sense unless some program only wants the user to be able to create / delete an empty lock file for something else there.