regcs / AliceLG

A Blender add-on for the use of Blender with the Looking Glass holographic displays.
GNU General Public License v3.0
103 stars 23 forks source link

Unable to Install Dependencies on Amazon Linux #132

Open prestomation opened 6 months ago

prestomation commented 6 months ago

Describe the bug I'm trying to setup AliceLG to run on a renderfarm on AWS on AmazonLinux2023 with blender 3.6

I'm using the --alicelg-install option but it's not actually doing anything

To Reproduce Steps to reproduce the behavior:

  1. run the following script on amazon linux after installing blender 3.6
    mkdir -p scripts/addons
    curl -L 'https://github.com/regcs/AliceLG/releases/download/v2.2.2/AliceLG.zip' > AliceLG.zip
    unzip 'AliceLG.zip' -d 'scripts/addons/'
    export BLENDER_USER_SCRIPTS=scripts/
    blender -b --addons AliceLG -- --alicelg-install 

Expected behavior The addon dependency install runs successfully

Screenshots I get the following output:

2024/05/13 17:16:28-07:00 + blender -b --addons AliceLG -- --alicelg-install
2024/05/13 17:16:29-07:00 Failed to open dir (No such file or directory): /run/user/1001/gvfs/
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 - ----------------------------------------------
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 - Initializing 'Alice/LG v2.2.1' ...
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 -  [#] Add-on path: /sessions/session-8da0e946ae7f4eafb7426a3bdea715e52s8lpp6z/scripts/addons/AliceLG
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 -  [#] Missing dependencies. Please install them in the preference pane or using the 'blender -- --alicelg-install' command line call.
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 - Unregister the addon:
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 -  [#] Stopping frustum and block renderers.
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 -  [#] Removing all registered classes.
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 -  [#] Unloading the python dependencies.
2024/05/13 17:16:29-07:00 [Alice/LG] [INFO] 05/14/2024 00:16:29 -  [#] Shutting down the loggers.
2024/05/13 17:16:29-07:00 Blender 3.6.8 (hash f6ae60f3eeda built 2024-01-16 00:32:28)
2024/05/13 17:16:29-07:00  
2024/05/13 17:16:29-07:00 Blender quit

Platform & Versions (please complete the following information):

Attach log files Nothing more in the log files:

2024/05/13 17:25:29-07:00 + cat /sessions/session-8135b61ecd17485a9c4f387e22b0ffc2ml2plxad/scripts/addons/AliceLG/logs/__init__.py /sessions/session-8135b61ecd17485a9c4f387e22b0ffc2ml2plxad/scripts/addons/AliceLG/logs/alice-lg.log /sessions/session-8135b61ecd17485a9c4f387e22b0ffc2ml2plxad/scripts/addons/AliceLG/logs/pylightio.log
2024/05/13 17:25:29-07:00 # ##### BEGIN GPL LICENSE BLOCK #####
2024/05/13 17:25:29-07:00 #
2024/05/13 17:25:29-07:00 #  Copyright © 2020 Christian Stolze
2024/05/13 17:25:29-07:00 #
2024/05/13 17:25:29-07:00 #  This program is free software: you can redistribute it and/or modify
2024/05/13 17:25:29-07:00 #  it under the terms of the GNU General Public License as published by
2024/05/13 17:25:29-07:00 #  the Free Software Foundation, either version 3 of the License, or
2024/05/13 17:25:29-07:00 #  (at your option) any later version.
2024/05/13 17:25:29-07:00 #
2024/05/13 17:25:29-07:00 #  This program is distributed in the hope that it will be useful,
2024/05/13 17:25:29-07:00 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
2024/05/13 17:25:29-07:00 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2024/05/13 17:25:29-07:00 #  GNU General Public License for more details.
2024/05/13 17:25:29-07:00 #
2024/05/13 17:25:29-07:00 #  You should have received a copy of the GNU General Public License
2024/05/13 17:25:29-07:00 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
2024/05/13 17:25:29-07:00 #
2024/05/13 17:25:29-07:00 # ##### END GPL LICENSE BLOCK #####
2024/05/13 17:25:29-07:00  
2024/05/13 17:25:29-07:00  
2024/05/13 17:25:29-07:00 # THIS FILE IS NEEDED FOR PYTHON:
2024/05/13 17:25:29-07:00 # https://docs.python.org/3/tutorial/modules.html#packages
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 - ----------------------------------------------
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 - Initializing 'Alice/LG v2.2.1' ...
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 -  [#] Add-on path: /sessions/session-8135b61ecd17485a9c4f387e22b0ffc2ml2plxad/scripts/addons/AliceLG
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 -  [#] Missing dependencies. Please install them in the preference pane or using the 'blender -- --alicelg-install' command line call.
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 - Unregister the addon:
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 -  [#] Stopping frustum and block renderers.
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 -  [#] Removing all registered classes.
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 -  [#] Unloading the python dependencies.
2024/05/13 17:25:29-07:00 [INFO] 05/14/2024 00:25:29 -  [#] Shutting down the loggers.
regcs commented 6 months ago

Thank you for the detailed description, @prestomation. Is there also a side-packages-install.log in the add-on's log folder?

prestomation commented 6 months ago

nope! I used cat $LOG_DIR and only those other 2 log files existed there

regcs commented 6 months ago

Hm, ok. That is strange, because then the corresponding function is most-likely not called at all. I will prepare a small debugging version later which will do some more log entries. Please stay tuned. :)

prestomation commented 5 months ago

I've got the code setup so I can modify and submit using my customized version.

I've added some logging statements and it appears the 'LookingGlassAddonInitHandler' function never runs.

I was able to manually pip install the dependencies by copying what the code does. It no longer complains about missing dependencies, but of course when I go to render 'LookingGlassAddonInitHandler' still isn't running so it does nothing.

Any ideas why this handler won't run? My command looks like this:

blender --background /path/to/scene.blend --addons AliceLG -- --alicelg-render --render-output /path/to/output --render-frame 1

prestomation commented 5 months ago

here is a more complete log

2024/06/02 21:39:31-07:00 + blender --background /sessions/session-24cb65572c954e39867d111e437f4385itdbuxjp/assetroot-5980370788e3377c6cb0/gettingfuzzy/assets/char/fuzzypixel/rig/fuzzypixel_rig.blend --addons AliceLG -- --alicelg-render --render-output /sessions/session-24cb65572c954e39867d111e437f4385itdbuxjp/assetroot-5980370788e3377c6cb0/blender-lg/output/output_#### --render-frame 1
2024/06/02 21:39:31-07:00 Failed to open dir (No such file or directory): /run/user/1001/gvfs/
2024/06/02 21:39:31-07:00 Blender 3.6.8 (hash f6ae60f3eeda built 2024-01-16 00:32:28)
2024/06/02 21:39:31-07:00 Read blend: "/sessions/session-24cb65572c954e39867d111e437f4385itdbuxjp/assetroot-5980370788e3377c6cb0/gettingfuzzy/assets/char/fuzzypixel/rig/fuzzypixel_rig.blend"
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 14 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: region type 15 missing in space type "View3D" (id: 1) - removing region
2024/06/02 21:39:31-07:00 Warning: File written by newer Blender binary (401.24), expect loss of data!
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 - ----------------------------------------------
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 - Initializing 'Alice/LG v2.2.1' ...
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Add-on path: /sessions/session-24cb65572c954e39867d111e437f4385itdbuxjp/scripts/addons/AliceLG
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Found module 'pynng' v.0.8.0.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Found module 'cv2' v.4.9.0.80.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Found module 'pylightio' v.1.0.0.
2024/06/02 21:39:33-07:00 WARN (bgl): source/blender/python/generic/bgl.c:2660 BPyInit_bgl: 'bgl' imported without an OpenGL backend. Please update your add-ons to use the 'gpu' module. In Blender 4.0 'bgl' will be removed.
2024/06/02 21:39:33-07:00 [Alice/LG] [DEBUG] 06/03/2024 04:39:33 - Blender arguments: ['blender', '--background', '/sessions/session-24cb65572c954e39867d111e437f4385itdbuxjp/assetroot-5980370788e3377c6cb0/gettingfuzzy/assets/char/fuzzypixel/rig/fuzzypixel_rig.blend', '--addons', 'AliceLG', '--']
2024/06/02 21:39:33-07:00 [Alice/LG] [DEBUG] 06/03/2024 04:39:33 - Addon arguments: ['--alicelg-render', '--render-output', '/sessions/session-24cb65572c954e39867d111e437f4385itdbuxjp/assetroot-5980370788e3377c6cb0/blender-lg/output/output_####', '--render-frame', '1']
2024/06/02 21:39:33-07:00 [Alice/LG] [DEBUG] 06/03/2024 04:39:33 - Background =true
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Registered add-on operators in Blender.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Done.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 - Connecting to Looking Glass Bridge ...
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Created socket: <pynng.nng.Req0 object at 0x7fd05b110460>
2024/06/02 21:39:33-07:00 [pyLightIO] [ERROR] 06/03/2024 04:39:33 - Could not connect. Is Looking Glass Bridge running?
2024/06/02 21:39:33-07:00 [pyLightIO] [WARNING] 06/03/2024 04:39:33 - Added service 'Looking Glass Bridge' to the service manager, but service is not ready.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Connection failed.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] Looking Glass 65''  (id: 0)' of type '65_gen2'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] Looking Glass Portrait (id: 1)' of type 'portrait'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] 8.9'' Looking Glass (id: 2)' of type 'standard'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] Looking Glass 16'' (id: 3)' of type '4k_gen2'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] Looking Glass 32'' (id: 4)' of type '8k_gen2'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] 15.6'' Looking Glass (id: 5)' of type 'large'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] 15.6'' Pro Looking Glass (id: 6)' of type 'pro'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Emulating device '[Emulated] Looking Glass 8k (id: 7)' of type '8k'.
2024/06/02 21:39:33-07:00 [pyLightIO] [INFO] 06/03/2024 04:39:33 - Removing service 'Looking Glass Bridge' ...
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 - Unregister the addon:
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Stopping frustum and block renderers.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Removing all registered classes.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Unloading the python dependencies.
2024/06/02 21:39:33-07:00 [Alice/LG] [INFO] 06/03/2024 04:39:33 -  [#] Shutting down the loggers.
2024/06/02 21:39:33-07:00  

As an aside, are pynng, cv2, and pylightio required for a non-interactive render?

regcs commented 5 months ago

Hi @prestomation, thanks for your messages and sorry for not getting back to this earlier.

The LookingGlassAddonInitHandler not being called would either be a Blender bug on Linux (just confirmed it works on macOS in headless mode) or a misinterpretation because you looked at the console. By default, Alice/LG disables logging to the console at the beginning of LookingGlassAddonInitHandler to not spam the console in case other add-on's also log info. But it always writes the info to the log files. Let's try to debug this further.

Attached you find two files where I also added some more debugging statements. I also placed the above mentioned logger level update to the end of LookingGlassAddonInitHandler. Please do the following:

  1. Download the modfied files (Archiv.zip)
  2. Unzip and then overwrite the corresponding .py files in your Alice/LG directory
  3. Delete one of your dependencies (e.g., "cv2") from your AliceLG/lib/ folder and start Blender with '--alicelg-install' flag set.
  4. From your AliceLG/logs/ folder, please copy the alice-lg.log, pylightio.log, and side-packages-install.log here.

Thank you!

As an aside, are pynng, cv2, and pylightio required for a non-interactive render?

More or less, yes. These packages are needed for the interaction of emulation of Looking Glass devices and rendering quilts. Strictly, pynng is probably not strictly required because you don't communicate with Looking Glass bridge in headless mode. But it is a dependency for pylightio and it would complain, if it would not be there.

prestomation commented 5 months ago

Please see attached: pylightio.log is empty and there is no "side-packages-install.log". Looking at the diff of what you gave me and then the output I see it looks like LookingGlassAddonInitHandler isn't running.

pylightio.log

alice-lg.log

regcs commented 5 months ago

Thank you, @prestomation! I figured, I forgot to change the logging level. So, there is still a chance, it is executed.

Can you try this modified version and send me the log files again?

Archiv.zip

prestomation commented 5 months ago

Thanks @regcs . Unfortunately I'm still seeing no change. Also I have upgraded to blender 4.1.1 incase there was some bug on the version I was using but behavior is the same

alice-lg.log pylightio.log

regcs commented 5 months ago

Hm, that's bad news then. If the handler is not called at all and it works on macOS, but not on Linux, it looks rather like a Blender bug. I will try to find some time to isolate the code pieces and send you some test code. That will at least show us, if the problem is related to the app handlers or not.

In the meantime, do you have another machine to test this on?

prestomation commented 5 months ago

Thanks @regcs . So the plugin works fine for me on my local windows machine and I can continue to use it and am not blocked exactly.

I am specifically trying to get it to run on a specific renderfarm service that runs Amazon Linux. There are options to run windows but this is more expensive and has other issues unrelated to AliceLG I don't really want to deal with right now. I'm fine running on my local but if you have ideas I'm all ears!

regcs commented 5 months ago

Ok, glad to hear, it doesn't totally block you. Still want to know what is causing this. I am just a bit bound here, because I cannot test on Linux myself at the moment and never used AWS.

In case you have the option to test on another Linux distribution, let me know.

Regardless of that, we will stick to the plan and I will provide you with some isolated code pieces to test. Might just take me a few days. So, please stay tuned :)