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

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

Open
yconst opened this issue Sep 5, 2015 · 5 comments
Open

Comments

@yconst
Copy link

yconst commented Sep 5, 2015

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
Copy link
Author

yconst commented Sep 5, 2015

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 yconst closed this as completed Sep 5, 2015
@yconst yconst changed the title Can't open device file: /var/lib/jpcnn/char_dev on RPi 2 B Can't open device file: /var/lib/jpcnn/char_dev on RPi 2 B (kernel 4.1) Sep 6, 2015
@yconst
Copy link
Author

yconst commented Sep 6, 2015

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: #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!

@yconst yconst reopened this Sep 6, 2015
@qingwufong
Copy link

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
Copy link

fad0 commented Aug 26, 2016

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

@rhysdg
Copy link

rhysdg commented Oct 8, 2016

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

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

4 participants