Mycroft installer broken? Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
in03
Posts: 13
Joined: Sun Aug 08, 2021 2:19 pm

Mycroft installer broken?

Post by in03 »

Hey guys,

Just running a fresh install of DietPi v7.6.2 on my Raspberry Pi 4 and I've run into a glitch with the DietPi-optimized Mycroft installer.
It runs fine until the prompt for PocketSphinx comes up:

Code: Select all

                    Welcome to Mycroft!  

This script is designed to make working with Mycroft easy.  During this
first run of dev_setup we will ask you a few questions to help setup
your environment.

The Precise Wake Word Engine requires the AVX instruction set, which is
not supported on your CPU. Do you want to fall back to the PocketSphinx
engine? Advanced users can build the precise engine with an older
version of TensorFlow (v1.13) if desired and change use_precise to true
in mycroft.conf.
  Y)es, I want to use the PocketSphinx engine or my own.
  N)o, stop the installation.
Choice [Y/N]:
If I select Yes, it fails:

Image

Any ideas?
User avatar
Joulinar
Posts: 6525
Joined: Sat Nov 16, 2019 12:49 am

Re: Mycroft installer broken?

Post by Joulinar »

hmm I did a test installation and Mycroft installer was working as expected

Code: Select all

[ INFO ] DietPi-Software | sudo -u mycroft ./dev_setup.sh -sm, please wait...

                    Welcome to Mycroft!

This script is designed to make working with Mycroft easy.  During this
first run of dev_setup we will ask you a few questions to help setup
your environment.

Do you want to run on 'master' or against a dev branch?  Unless you are
a developer modifying mycroft-core itself, you should run on the
'master' branch.  It is updated bi-weekly with a stable release.
  Y)es, run on the stable 'master' branch
  N)o, I want to run unstable branches
Choice [Y/N]:  Y - using 'master' branch
Already on 'master'
M       dev_setup.sh
Your branch is up to date with 'origin/master'.

Mycroft is actively developed and constantly evolving.  It is recommended
that you update regularly.  Would you like to automatically update
whenever launching Mycroft?  This is highly recommended, especially for
those running against the 'master' branch.
  Y)es, automatically check for updates
  N)o, I will be responsible for keeping Mycroft updated.
Choice [Y/N]:  Y - update automatically


There are several Mycroft helper commands in the bin folder.  These
can be added to your system PATH, making it simpler to use Mycroft.
Would you like this to be added to your PATH in the .profile?
Choice [Y/N]:  Y - Adding Mycroft commands to your PATH
Type mycroft-help to see available commands.

The standard location for Mycroft skills is under /opt/mycroft/skills.
For convenience, a soft link has been created called 'skills' which leads
to /opt/mycroft/skills.

(Developer) Do you want to automatically check code-style when submitting code.
If unsure answer yes.

Choice [Y/N]: Will install PEP8 pre-commit hook...

Interactive portion complete, now installing dependencies...
Interesting point, the question you got are different from what I have seen :?

Could you share some more system details pls

Required Information
  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
  • Kernel version | uname -a
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
in03
Posts: 13
Joined: Sun Aug 08, 2021 2:19 pm

Re: Mycroft installer broken?

Post by in03 »

Thanks for trying on your end Joulinar.
What version are you running?

It loos like your Mycroft install prompt didn't warn you about not having AVX support? Which is when I'm prompted to fallback to PocketSphinx and the install script fails from there.

I am on RPi 4 8GB, so aarch64bit

Code: Select all

$ cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=7
G_DIETPI_VERSION_SUB=6
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='not applicable'
G_LIVE_PATCH_STATUS[1]='applied'
G_LIVE_PATCH_STATUS[2]='applied'
G_LIVE_PATCH_STATUS[3]='applied'
G_LIVE_PATCH_STATUS[4]='applied'

Code: Select all

$ echo $G_DISTRO_NAME $G_RASPBIAN
bullseye 0

Code: Select all

$ uname -a
Linux DietStack 5.10.63-v8+ #1457 SMP PREEMPT Tue Sep 28 11:27:02 BST 2021 aarch64 GNU/Linux

Code: Select all

$ echo $G_HW_MODEL_NAME
RPi 4 Model B (aarch64)
in03
Posts: 13
Joined: Sun Aug 08, 2021 2:19 pm

Re: Mycroft installer broken?

Post by in03 »

Digging through the setup file on GitHub, it seems they've changed the AVX/Pocketsphinx prompt last month to accommodate aarch64.
Link: https://github.com/MycroftAI/mycroft-co ... v_setup.sh

Code: Select all

    # The AVX instruction set is an x86 construct
    # ARM has a range of equivalents, unsure which are (un)supported by TF.
    if ! grep -q avx /proc/cpuinfo && ! [[ $(uname -m) == 'arm'* || $(uname -m) == 'aarch64' ]]; then
      echo "
The Precise Wake Word Engine requires the AVX instruction set, which is
not supported on your CPU. [...] 
So that explains the new prompt, but as for the install failing (the error from my original post):

Code: Select all

bash: line1: jq: command not found

It looks like there's a bug in the script where jq is called to write some json to file before it's actually installed later as a dependency.

Line 194:

Code: Select all

$SUDO bash -c 'jq ". + { \"use_precise\": true }" /etc/mycroft/mycroft.conf > tmp.mycroft.conf' 
Line 468:

Code: Select all

install_deps
Looks like that line is mangled though:

Code: Select all

parse error: Invalid numeric literal at line 1, column 3
Assuming a fresh install, a workaround I've found for now is to run the installer until the AVX/Pocketsphinx prompt, create a backup of the mycroft.conf file, delete the original, continue the installer until next prompt and then restore the mycroft.conf file. This just bypasses that if statement with jq.Or of course you could always install from source and modify the dev_setup.sh script.

I'm working on a pull request and I've submitted an issue to the Mycroft GitHub.
User avatar
Joulinar
Posts: 6525
Joined: Sat Nov 16, 2019 12:49 am

Re: Mycroft installer broken?

Post by Joulinar »

Ah yeah I tested on 32bit. Perfect you are going to submit a PR on Mycroft GitHub. :D
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
in03
Posts: 13
Joined: Sun Aug 08, 2021 2:19 pm

Re: Mycroft installer broken?

Post by in03 »

Hey all. Submitted the pull-request here if any interested:
https://github.com/MycroftAI/mycroft-core/pull/3012

Turns out, the AVX on aarch64 problem is already fixed on the dev branch.
but you may run into it anyway if you elect to use the 'master' branch when prompted by the installer (as the official DietPi documentation recommends). It changes branches mid-install, but after the AVX check. If you cancel the install after switching branches and run it again later, you'll be wrongly prompted that your system doesn't support AVX. Hopefully this existing fix will be merged into master soon.

I did still end up writing a fix to solve the jq dependency issue for those actually running Intel/AMD without AVX support (unfortunately, probably very few users here! :lol:' ). It was also wrongly setting `use_precise` to 'true' instead of 'false' in mycroft.conf, so that should be good now.
User avatar
Joulinar
Posts: 6525
Joined: Sat Nov 16, 2019 12:49 am

Re: Mycroft installer broken?

Post by Joulinar »

thx for sharing and contributing to this issue at Mycroft GitHub 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply