Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running Stata on Raspberry Pi 4B (a guide)

    I know this is more of a ‘geek’ idea but in case you can’t always take your laptop with you (like me) and still need to use Stata, there’s a possibility to do so offline on a Linux-based microcomputer (the alternative would be to rent an amd64-based server or to use your school’s/company’s RDP). You will need a a) Raspberry Pi 4B (64-bit, 4GB or 8GB RAM) (which costs ca. $150 / € 120, including a box, fan and a SD card) with a Debian/Ubuntu-based 64-bit OS, b) Stata Linux edition (when you purchase Stata, it comes in three versions: Windows, Mac, and Linux), and c) basic knowledge of Linux and shell.

    Here’s the guide and a script to set up the chroot under Raspberry Pi: https://github.com/econcz/chroot_x86_64

    In case you wish to use the Raspberry Pi headlessly, you’ll need to configure VNC:
    https://www.raspberrypi.org/document...te-access/vnc/

    I personally add this line to my user’s crontab to match my tablet’s screen resolution over VNC:
    Code:
    @reboot        sleep 10; export DISPLAY=:0; xrandr --newmode "1392x1024_60.00" $(gtf 1392 1024 60 | awk 'NR==3' | sed -E 's/Modeline.+"//'); xrandr --addmode HDMI-1 "1392x1024_60.00"; xrandr --output HDMI-1 --mode "1392x1024_60.00"
    I tested the whole set-up several times, it’s a little slow but works well.

    Good luck!

    PS I recommend not deleting this post since there were questions on the forum whether people can use Stata on their iPads, Android tablets etc. or not. This is a working solution.

  • #2
    Updated the GitHub Repository. Found a way to call Stata with Java and Python 3 using Kyle Barron’s Jupyter Kernel under chroot (over “reverse” ssh).
    The speed is OK.

    PS There is no 64-bit ARM conda distribution I’m afraid, so it has to be run from chroot like Stata.
    Last edited by Ilya Bolotov; 19 Jul 2021, 10:54.

    Comment


    • #3
      Hi lIya

      Thanks - great that you have done this. It would be very useful for me. Slight stumbling block for me though in case you/others have come across this: When I execute any chroot_x86_64 command, eg sudo ./chroot_x86_64 --install I get the error:

      ./chroot_x86_64:227: parse error near '}'

      I have looked at line 227 & nothing obviously wrong with the code strikes me. I suspect I am missing something silly, but wonder if you or anyone else has met this obstacle?

      I am running Ubuntu 22.04 LTS on a Pi 4 & have installed dependencies. Thanks in advance.

      Comment


      • #4
        Hi Rob,

        Try a different shell. I'm using zsh. If the problem persists, please let me know.

        Stata is a little buggy on Raspberry Pi and may crash for big calculations. Small ones work well though.

        Comment


        • #5
          Hello everyone! I’ve just tested Stata 18 SE under my Linux chroot setup on Raspberry Pi 4B.
          It worked perfectly in both CLI and GUI and never crashed on intensive calculations.
          The only small downside against a full-fledged PC is a somewhat slower speed because of the x86_64 emulation.

          PS I’m using Raspbian 11 aarch64/arm64 (64-bit, latest possible), Debian 11 amd64 (x86-64, latest possible) for the chroot, qemu-user-static from apt, latest QEMU build from GitHub, and Stata 18 SE for Unix.

          Comment


          • #6
            Debian 12 as a chroot offers even better performance for Stata 18 on Raspberry Pi. Previously, there were still errors in Python integration.
            However, there seem to be no issues with it anymore (I’m using the latest version of mambaforge).
            Please find the updated script here: https://github.com/econcz/chroot_x86_64 (the resolv.conf/DNS bug under the Debian 12 chroot was fixed).

            PS Please run
            Code:
            sudo apt install zsh
            before using the script.

            Comment

            Working...
            X