Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node core dumps with illegal instruction #2

Closed
rlmcclain opened this issue May 1, 2020 · 13 comments
Closed

node core dumps with illegal instruction #2

rlmcclain opened this issue May 1, 2020 · 13 comments

Comments

@rlmcclain
Copy link

rlmcclain commented May 1, 2020

Hello. I really like the idea of this project. Trying to follow your non-Docker instructions.
Here is the result of install.sh
rich@myarch:~/bin/webcam-virtual-background-master$ ./install.sh
Defaulting to user installation because normal site-packages is not writeable
Collecting numpy==1.18.2
Using cached numpy-1.18.2-cp38-cp38-manylinux1_x86_64.whl (20.6 MB)
Collecting opencv-python==4.2.0.32
Using cached opencv_python-4.2.0.32-cp38-cp38-manylinux1_x86_64.whl (28.2 MB)
Requirement already satisfied: requests==2.23.0 in /usr/lib/python3.8/site-packages (from -r fakecam/requirements.txt (line 3)) (2.23.0)
Collecting pyfakewebcam==0.1.0
Using cached pyfakewebcam-0.1.0.tar.gz (12 kB)
Requirement already satisfied: chardet>=3.0.2 in /usr/lib/python3.8/site-packages (from requests==2.23.0->-r fakecam/requirements.txt (line 3)) (3.0.4)
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.8/site-packages (from requests==2.23.0->-r fakecam/requirements.txt (line 3)) (2.9)
Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.8/site-packages (from requests==2.23.0->-r fakecam/requirements.txt (line 3)) (1.25.9)
Installing collected packages: numpy, opencv-python, pyfakewebcam
Running setup.py install for pyfakewebcam ... done
Successfully installed numpy-1.18.2 opencv-python-4.2.0.32 pyfakewebcam-0.1.0
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
audited 167 packages in 1.536s
1 package is looking for funding
run npm fund for details
found 0 vulnerabilities

I created my v4l2loopback on /dev/video20 and modified fake.py line 24.
I get this error when attempting to run 'node app.js':
rich@myarch:/bin/webcam-virtual-background-master/bodypix$ node --version
v14.1.0
rich@myarch:
/bin/webcam-virtual-background-master/bodypix$ node app.js
Illegal instruction (core dumped)

I've never used node.js or Docker before. Any guidance on debugging this? Any commands I could issue to give you more information?
Regards,
RichM

@fiblan
Copy link
Owner

fiblan commented May 2, 2020

Hi @rlmcclain, thanks for your interest.

As suggest by ianni67 in #1, it is better to use nvm and change nodejs version

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
nvm install node v10.16.3

then check node version with

node --version

As soon as you give me feedback, I update the README with this hint.

@ianni67
Copy link

ianni67 commented May 2, 2020

The comment referred by Fiblan has changed, now it is number #3:
All the best.

@rlmcclain
Copy link
Author

Thanks for the reply. I managed to run these command and get version 10.16.3 installed and do the npm rebuild:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
nvm install node 10.16.3

then rebuild the tensorflow module for node.js:

cd bodypix
npm rebuild @tensorflow/tfjs-node build-addon-from-source

Then I opened a new terminal session and did this:

$ cd ~/bin/webcam-virtual-background-master
$ nvm use 10.16.3
Now using node v10.16.3 (npm v6.9.0)
$ node --version
v10.16.3
$ cd bodypix
$ node app.js
node-pre-gyp info This Node instance does not support builds for N-API version 5
node-pre-gyp info This Node instance does not support builds for N-API version 5
Illegal instruction (core dumped)

Similar result - still core dumped.

@ianni67
Copy link

ianni67 commented May 2, 2020

For some reason, nvm installed a newer version than 10.16.3.
In my pc I have:

node --version
v14.1.0

So, please run
nvm install node v14.1.0, then re-build the tensorflow node again. Sorry for the issue.

@rlmcclain
Copy link
Author

Thanks for your continued assistance.
14.1.0 is where I originally started:

rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ nvm use 14.1.0
Now using node v14.1.0 (npm v6.14.4)
rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ node --version
v14.1.0
rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ npm rebuild @tensorflow/tfjs-node build-addon-from-source

> @tensorflow/[email protected] install /home/rich/bin/webcam-virtual-background-master/bodypix/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.7.4.tar.gz
* Building TensorFlow Node.js bindings
@tensorflow/[email protected] /home/rich/bin/webcam-virtual-background-master/bodypix/node_modules/@tensorflow/tfjs-node
rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ node app.js
Illegal instruction (core dumped)

Back to where we started.

@ianni67
Copy link

ianni67 commented May 2, 2020

I'm very sorry. Looks like your issue is not the same as mine, and I made you waste time.
@fiblan will probably take care of this

@fiblan
Copy link
Owner

fiblan commented May 2, 2020

Please, try this:

rm -fr node_modules
npm install
node app.js

@rlmcclain
Copy link
Author

Here we go.

rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ rm -rf node_modules
rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ npm install

> @tensorflow/[email protected] install /home/rich/bin/webcam-virtual-background-master/bodypix/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.7.4.tar.gz
* Downloading libtensorflow
[==============================] 9019249/bps 100% 0.0s
* Building TensorFlow Node.js bindings
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.

added 94 packages from 100 contributors and audited 167 packages in 19.268s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ ll
total 56
drwxr-xr-x  3 rich rich  4096 May  2 13:26 ./
drwxr-xr-x  4 rich rich  4096 Apr 26 15:57 ../
-rw-r--r--  1 rich rich  1046 Apr 26 15:57 app.js
-rw-r--r--  1 rich rich   319 Apr 26 15:57 Dockerfile
drwxr-xr-x 87 rich rich  4096 May  2 13:26 node_modules/
-rw-r--r--  1 rich rich   170 Apr 26 15:57 package.json
-rw-r--r--  1 rich rich 30823 May  1 13:53 package-lock.json
rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ node --version
v14.1.0
rich@myarch:~/bin/webcam-virtual-background-master/bodypix$ node app.js
Illegal instruction (core dumped)

Same result. I really appreciate your continued help.

@ianni67
Copy link

ianni67 commented May 2, 2020

Sorry for commenting again, but it really looks like an issue with tensorflow-js (tfjs). It relies on some pre-compiled stuff that might have some compatibility issues with your pc.

@fiblan
Copy link
Owner

fiblan commented May 3, 2020

@rlmcclain
Copy link
Author

Here it is. I don't see 'avx':

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 905e Processor
stepping        : 2
microcode       : 0x10000db
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
bogomips        : 5016.05
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 905e Processor
stepping        : 2
microcode       : 0x10000db
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 1
cpu cores       : 4
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
bogomips        : 5016.05
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 905e Processor
stepping        : 2
microcode       : 0x10000db
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 2
cpu cores       : 4
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
bogomips        : 5016.05
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 16
model           : 4
model name      : AMD Phenom(tm) II X4 905e Processor
stepping        : 2
microcode       : 0x10000db
cpu MHz         : 800.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 3
cpu cores       : 4
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
bogomips        : 5016.05
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

@ianni67
Copy link

ianni67 commented May 3, 2020

I do have avx in flags. It looks like your cpu is missing avx extensions and the Tensorflow js runtime is compiled to use those extensions.
I hope this link from Tensorflow github can help.

@rlmcclain
Copy link
Author

Thanks for all the guidance and research. You learn something new everyday. I built my desktop in 2009 and it has been my 'work at everyday' desktop for 11 years with no issues. Although I've changed the Linux distro a few times. I'm not into gaming, so I had no need to upgrade. It has worked fine for all that I need to do. Guess I got my moneys worth. But I think it may be time to upgrade. Seems like a good quarantine project. Again, thanks for the help. You have both been very generous with your time and knowledge. Best Wishes, RichM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants