jetpacapp / DeepBeliefSDK

The SDK for Jetpac's iOS Deep Belief image recognition framework
Other
2.86k stars 437 forks source link

Can't open device file: /var/lib/jpcnn/char_dev on RPi 2 B (kernel 4.1) #56

Open yconst opened 9 years ago

yconst commented 9 years ago

I'm following the instructions in the following blog post step by step: http://petewarden.com/2014/08/07/how-to-optimize-raspberry-pi-code-using-its-gpu/ ; however, I keep getting the following:

Can't open device file: /var/lib/jpcnn/char_dev

while testing the example using:

sudo ./jpcnn -i data/dog.jpg -n ../networks/jetpac.ntwk -t -m s

Any thoughts what may be the cause?

yconst commented 9 years ago

Just saw this https://github.com/jetpacapp/DeepBeliefSDK#getting-started-on-a-raspberry-pi-2 on the front page, can't believe I missed it.. Did not try it yet, but I guess this is the way to go in RPi 2. As such, I'm closing this issue.

yconst commented 9 years ago

Here's an update on this: After following the instructions for RPi 2, I still got the same error. Purely by coincidence I found here that in the latest linux kernel (4.1, which happens to be the one I'm using, after a recent upgrade), the device major for the mailbox has changed from 100 to 249. So I went on and changed that in source/src/lib/pi/mailbox.cpp :

#define MAJOR_NUM 249

Then I went on and followed the instructions in this issue, to remove installed jpcnn: https://github.com/jetpacapp/DeepBeliefSDK/issues/50

In addition, I had to delete the device file created by the library: sudo rm -rf /var/lib/jpcnn/

Re-compiled as per the RPi2 instructions. And finally (from within source/):

sudo cp libjpcnn.so /usr/lib/
sudo cp src/include/libjpcnn.h /usr/include/

And now it works like a charm!

qingwufong commented 8 years ago

I have same problem :( As mentioned above, I changed MAJOR_NUM, and removed file ,and re-compiled. but it doesn`t work, making me confused. Could you give me some tips? thanks a lot!

fad0 commented 8 years ago

yconst, I followed your instructions and it worked! Thank you. -FAD0

rhysdg commented 7 years ago

Hey yconst you really helped me figure that one out too. Much appreciated!