Message Boards Message Boards

GROUPS:

10.3 on the Raspberry Pi

Posted 5 years ago
11887 Views
|
17 Replies
|
2 Total Likes
|

Version 10.3 is now out on the Raspberry Pi. See the announcement on the RPi blog. If you haven't upgraded to Jessie, now is a perfect time to do so.

Yeah. - must call in sick today so I can play.

17 Replies

That's great news! :-) I can't wait to play with the Sense HAT.

Mathematica is now at version 10.3. This adds support for a larger set of the functionality detailed in Stephen Wolfram’s new “Elementary Introduction to the Wolfram Language” book. It also supports the use of the Sense HAT, adds interfacing to Arduino, and includes many new Mathematica functions.

Sense Hat

@BoB LeSuer, I'm looking forward to learning from your up coming experiments.

Yes, lot't of fun. I have to shop for more supplies.

In addition to v10.3 of Mathematica, we also have access to an experimental hardware accelerated OpenGL driver for the RPi. It's not quite ready for prime time yet, but I was wondering if and how this new package can help with 3D graphics rendering in Mathematica. The examples demoing the new OpenGL driver are pretty nice, but when I enabled the driver, I saw no significant speed enhancement when rendering, for example the output of Plot3D.

I am not familiar with graphics driver technology. Is the acceleration due to the hardware driver supposed to automatically enhance the performance of Mathematica? Is this something that can be enabled user-side? I see some mention of OpenGL (and Mesa - don't know what that is) under SystemInformation[]; is Mathematica for the RPi compiled with software rendering, making the new experimental driver useless for the time being?

We are certainly interested in offloading as much as work as possible to the Raspberry Pi's competent GPU. We're just seeing it for the first time just like you, so we need to take some time to figure out how to make use of the driver. We absolutely do have the ability to take advantage of OpenGL but for our next update my team will be working to figure out how best to utilize that in a way that is stable and doesn't pass instructions to software fallbacks.

Thanks for the response, Alex. As I mentioned, I'm not familiar with driver technology and did not know if this was something that could be enabled at the user-end or if it needed to be integrated into the design. You answered that question.

Alex, I encountered the following fatal problems with Mathematical 10.3 on the Raspberry Pi Jessie Raspian 2016-02-09 release date downloaded from the RaspberryPi Foundation around 2/11/16. After updating the cache, I tried to do the sudo apt-get dist-upgrade to try to do what the Foundation recommended on their blog, even though this has not been a good way to go in the past with Mathematica 10.0.2+ for the Pi. Mathematica 10.3 opened fine (and I verified it was indeed 10.3), but when I tried to load the package for the Finite Element Meshing, <<NDSolveFEM, (which command and package worked fine on the previous release of 10.0.2+) Mathematica hung up. I tried it a few times, and depending on if I did another command that worked first or not, Mathematica would either hang up catastrophically (would not shut down even with the kill the kernal or task manager, had to pull the plug on the RPi2 to shut down), or else Mathematica would bomb and just quit suddenly (i.e close window and end the program).

Thinking the problem might have been in the dist-upgrade (which took forever to do) and possible conflicting dependencies or some such, I downloaded the fresh .img file for the 2/9/2016 Jessie Raspian release with MMA 10.3 and transferred it to a blank microSD card. I did not load any other software on, because I wanted to see if the same problem happened with a fresh install of Jessie Raspian. Same problem with 10.3 bombing and locking up the system so it could not be shut down and would not kill the kernal. This indicates something very wrong in the 10.3 release that I hope you will look into and fix. It ran normal commands, like Plot[Sin[x],{x,0,20}] just fine.

Keith,

I can reproduce the error with mathematica. When using wolfram I do not get a problem, but as I have not used this package, I cannot debug further to see if the package loaded properly.

We've reproduced the issue-- so it's definitely not your installation. I'm working on finding the least destructive workaround for this problem right now. I'll get back to you shortly.

FWIW, I get the error "Assertion 'result' failed at FunctionalFrequency.h:561" if I run mathematica from the command line. The following, however, indicates that the package is working and is a possible workaround. From a command line type wolfram then in the session:

<<JavaGraphics`
<<NDSolve`FEM`
bmesh = ToBoundaryMesh[Disk[]]
o = ToElementMesh[bmesh]["Wireframe"]
Show[o]

The wiremesh appears for me. In my setup I am connecting to the RPi via SSH and have an X server running on my Windows machine, so the java graphics works.

How 'bout a linear algebra package on the GPU first?

The VideoCore IV doesn't have any OpenCL support, to my knowledge. So if someone were to write accelerated BLAS libraries for it, they would be low-level and completely specific to that GPU (if they were really beneficial at all).

Honestly, I think we would be happy to just get the VideoCore doing what it was designed to do for our software as opposed to making it do something it was never intended to do. We also experimented with performance tuned BLAS libraries for the ARM CPU, but the Raspberry Pi distribution's use of ARMv6 [Raspberry Pi 1] software for their ARMv7 [Raspberry Pi 2] and ARMv8 [Raspberry Pi 3] devices makes that very difficult. Libraries like OpenBLAS don't do the same sort of runtime CPU detection that things like Intel MKL do and the hand-tuned assembly for ARMv6 will often just crash on ARMv7 (and have missing operations if you target ARMv7 and attempt to run it on ARMv6).

I would definitely be interested if anyone did create such libraries, though. Of course a tremendous amount of time and validation from vendors and the community would be required to get them up the quality where they'll be accurate enough in all scenarios we rely on them. For now, I'm having to use very basic CBLAS because it's the best way to deliver software that runs on all generations of the Raspberry Pi and is relatively accurate.

Thanks, Alex.

Until fairly recently, the VideoCore was closed source. Now, though, I see google rumblings that it's being documented and/or hacked, and there are people patching assemblers together for special purposes.

https://github.com/hermanhermitage/videocoreiv/wiki/VideoCore-IV-Programmers-Manual

Here's a video that makes me feel that I could eventually understand what's going on:

http://youtu.be/eZd0IYJ7J40

Building a raspberry pi quaternion package on the GPU would be a fine winter project. Too bad there are only 10 days left of winter.

Cheers, Fred

Alex and Bob,

Thanks for noticing my post and responding. Bob, here is what I was working through trying to learn how to apply the finite element method using Mathematica's new (v 10) features. Go to http://reference.wolfram.com/language/FEMDocumentation/ref/ToBoundaryMesh.html and open the first example. Load the package <<NDSolve'FEM' (yes there are weird backward apostrophes below the ~ key present as in the example, just not after I submit the reply so I had to use regular apostrophes for this reply to get it to show them). Open the examples and try to execute the commands in the first example, bmesh = ToBoundaryMesh[Disk[]] , and then execute ToElementMesh[bmesh]["Wireframe"] , which is one below just the plain disk boundary only . This gives the nice meshed disk in the example in MMA 10.0.2+ on the Pi. However, you don't get that far without bombing MMA in 10.3 for the Pi. I have not tried this example on the windows version, so I don't know if it has the same 10.3 problem or not.(?). My Windows machine at home is only running MMA 9.0.1.0, and I have not had the time to upgrade it to the later version.

The behavior you're seeing is specific to this particular release of our Raspberry Pi distribution (it's not even really a Linux-ARM issue).

Sorry about the delay in responding, I expect the issue with loading the FEM package will be addressed in the next release, but in the interim the following may be used as a workaround.

Evaluate first

 Protect[NDSolve`FEM`mkArgCompletion];

(this command may also be added to the kernel init.m file to avoid typing it every time)

Then loading NDSolve`FEM` should not cause a hang or a crash. There will be a harmless warning message about the above symbol being protected, but it will not affect the functionality.

enter image description here

Posted 5 years ago

Hello, I just tried Mathematica 10.3 on Jessie. However,

DeviceRead["RaspiCam"]

no longer works. I am using

Import["!raspistill -w 300 -h 200 -t 1 -o -", "JPG"]

to get around the issue for now. Hopefully it will be fixed in the future. Thank you.

What is the error you are getting? You can use following commands to make it work using DeviceRead[]

enter image description here

Posted 5 years ago

It gave no error message. Just hung there.

However, tonight when I tried it again, and followed your instruction of using DeviceOpen[] first, Mathematica seemed to download some kind of update from Wolfram server, and it works exactly as you have shown.

So, it is working now. Thanks a lot for your feedback.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract