-
-
Notifications
You must be signed in to change notification settings - Fork 849
Raspberry Pi
The Raspberry Pi is a very popular family of single-board computers for many kinds of programming experiments and hardware tinkering projects. A new open-source graphics driver has been created by Eric Anholt, which enables you to run Stellarium with hardware acceleration on the multi-core models 2 and 3. Don't expect a super computer, but you should get typically over 10 frames per seconds, which should be enough for many applications where you don't want to waste too much energy. (E.g. solar/battery powered observatory.) I get 18fps on a 1400x1050 screen with Satellites not shown.
For the current Raspbian ("Buster", 2019), just
- activate the "OpenGL Driver" in
raspi-config
, Advanced options, Full KMS. - install the build requirements and
- follow the building instructions for Linux.
For previous Raspbian ("Stretch" as of early 2018), you must
- activate the "Experimental OpenGL Driver" in
raspi-config
- build
libdrm
andMesa 17
from sources (see below) - install the build requirements and
- follow the building instructions for Linux.
Alternatively, you can run Ubuntu Mate. On version 16.04.3 which has Mesa 17.0.7, I followed https://ubuntu-mate.community/t/tutorial-activate-opengl-driver-for-ubuntu-mate-16-04/7094 to activate VC4, and tried Stellarium 0.16.1 from our ppa. You don't have to compile anything yourself!
I (AF) found this preferable with Stretch 2018-0627 because Mesa would not configure for me.
The following seemed to work on Pi3B+ model http://www.raspberryconnect.com/gamessoftware/item/314-trying_out_opengl_on_raspberry_pi_3
2019-08: Ubuntu Mate 18.04.2 LTS also works. However, the arm64 version seems not yet polished. Stellarium shows nice 8-14fps in 1680x1050 but frequently crashes.
The new driver seems to work pretty well in many cases, but some hardware limitations persist.
- You cannot show your own landscapes or 3D sceneries with any textures larger than 2048x2048 pixels. Also the built-in "Sterngarten" scenery will not work.
- The Scenery3D plugin should be used with Perspective Projection only. All other projections require too much texture memory.
- It seems that some bug prevents OBJ planets from being rendered. Keep this option disabled!
- If you want higher framerate, consider disabling the Satellites plugin, or at least think about reducing number of satellites to the ones you are critically interested in. Also, don't load too many minor bodies.
- The DSS layer seems to work for short periods, then the X server fails. It may have to do with limitations of texture memory. You can try to press Ctrl-Alt-Backspace to restart it, but sometimes you will have to reboot if the graphics failed.
The following instructions which are required for Raspbian "Stretch" have been taken from Eric Anholt's site (https://github.com/anholt/mesa/wiki/VC4-complete-Raspbian-upgrade) on February 24, 2018. Fortunately we don't need to build a new kernel!
Until Raspbian gets its libdrm updated, we need to build it ourselves.
sudo apt-get install \
xutils-dev libpthread-stubs0-dev \
automake autoconf libtool git
git clone git://anongit.freedesktop.org/mesa/drm
cd drm
./autogen.sh \
--prefix=/usr \
--libdir=/usr/lib/arm-linux-gnueabihf
make
sudo make install
sudo apt-get install \
flex bison python-mako \
libxcb-dri3-dev libxcb-dri2-0-dev \
libxcb-glx0-dev libx11-xcb-dev \
libxcb-present-dev libxcb-sync-dev \
libxshmfence-dev \
libxdamage-dev libxext-dev libxfixes-dev \
x11proto-dri2-dev x11proto-dri3-dev \
x11proto-present-dev x11proto-gl-dev \
libexpat1-dev libudev-dev gettext \
libxrandr-dev
git clone git://anongit.freedesktop.org/mesa/mesa
cd mesa
./autogen.sh \
--prefix=/usr \
--libdir=/usr/lib/arm-linux-gnueabihf \
--with-gallium-drivers=vc4 \
--with-dri-drivers= \
--with-egl-platforms=x11,drm
make
sudo make install
You may want to install a swap file, otherwise you may run out of virtual memory when compiling https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
Then, make sure to install the build requirements and follow the building instructions for Linux.
If you are doing the compile on your Pi, follow the Linux instructions but use the command
nice make -j4
Otherwise, you may lose control of the pi with all cores busy. Or run with
make -j3
to keep one core free for other tasks.
2019-10-10: Stellarium works great out of the box. Install Raspbian, clone the GIT repo, install Linux build dependencies, and
mkdir build; cd build
cmake -DCMAKE_BUILD_TYPE="Release" ../stellarium
make -j4
On a model with 4GB you don't need a larger swap file. Within 16 minutes, Stellarium was built, with about 17fps at FullHD resolution. Without satellites, 22fps.