Preempt_rt kernel

May 16, 2019 - 1:18 PM

  • I have received my order.
    What is version kernel is being shipped with the AtomicPi images? I want use a preempt_rt kernel with the AtomicPi and I would like to know what I am starting with?

    This post was edited May 30, 2019 02:36PM
    0
  • OK, I got my atomicpi.
    I have downloaded linux-stable-rt-4.19.31-rt18.tar.gz and linux-rt-devel-5.0.14-rt9.tar.gz. I have built linux-stable-rt-4.19.31-rt18 for an arm64 board. Has anybody compiled a preempt_rt kernel for the atomicpi?
    I also found linux-image-4.19.0-0.bpo.5-rt-amd64-unsigned (4.19.37-3~bpo9+1). Has anybody used a debian rt kernel package for the atomicpi?

    0
  • Yep 5.0.14 with 5.0.14-rt9 patch
    I installed the latest Lubuntu Bionic Beaver (after reading some good results regarding Lubuntu) and have used my 5.0.14 rt for evaluating the Atomic Pi's use with Linuxcnc. ( I built the kernel & linuxcnc packages on another machine running Lubuntu )
    With the kernel option isolcpus=0,1,3 (not a typo) I have been getting latency that will make it suitable for use with a MESA ethernet card.

    Before I tried that path I installed Debian Stretch and used a backported debian rt kernel.

    0
  • Thanks, Robert. I have been trying to get Stretch to run because I like Synaptic and I wasn't able to get Synaptic to run under Lubuntu Bionic.
    The problem is that after installing Stretch twice from USB stick. Each time it will boot immediately following the install but after removing the USB stick it fails to boot because something in the command line thinks the uSD should still be /dev/sdb2 but it is /dev/sda2 after removing the USB stick. It fails on initramfs. After failing to boot the boot process no longer sees the uSD as a bootable option.

    0
  • I installed to emmc, which was really straight forward.
    Usually grub uses a UUID for the root partition to pass to the kernel, so it shouldn't be an issue finding root.
    I think your grub.cfg may have a line as follows.

    set root='hd1,msdosX' (Where X is the partition) as when grub was installed it was on /dev/sdb = hd1
    I think when the grub menu comes up you will need to press e to edit the particular menu and change hd1 to hd0.
    Or you could put the SD card in another machine, mount the card and change every instance of hd1 to hd0.

    Now this may not work, as I haven't tried it myself...but this would be the course of action I would try. I imagine you may have to edit /etc/default/grub as well...hd1 maybe referenced there was well.

    Tho I'm not too sure where the emmc would end up.....

    But installing to emmc is the easiest way to go.

    0
  • I got my 240gb SSD today. I downloaded linux-rt-devel-5.0.14-rt9.tar.gz and have it compiling right now. I was missing a few dependencies at first but it seems to be working right now. I have already compiled linuxcnc.
    My question is do I need to recompile linuxcnc after I have the preempt_rt kernel installed?

    0
  • Not for uspace (if it has already been compiled with a previous rt_premept kernel) everything should be ok.
    Are you compiling on the Atomic Pi or another machine ?
    I installed Lubuntu on my T530-Thinkpad (I'm a little bit of a Thinkpad fan) and do most of my compiling on that.
    One thing you might want to check...if you have compiled linuxcnc is that apache is part of the deps for building (I think it's to do with w3c-linkchecker)....apache might actually be running as a service.
    You may want to check what services are running and turn off those that aren't required or you don't want.

    0
  • I compiled on the Atomic Pi and that was without a preempt_rt kernel. That is why I thought I might need to recompile once I get preempt_rt running.

    0
  • Yep in that case you will.

    One thing I have noticed is that spi-gpio-custom & i2c-gpio-custom kernel modules don't actually work with the 5x series kernels. They build via dkms & will load but don't appear to work as should.
    I'm going to have a go with a 4 series rt kernel.

    0
  • Just compiled a 4.19.37 kernel with the matching patch.
    spi-gpio-custom & i2c-gpio-custom modules work as expected.
    So far I'm running latency-histogram --nobase with 2 instances of glxgears and using firefox with isolcpus=01,3 and max latency is 33.5us. I disabled irqbalance through systemctl.
    Obviously firefox isn't the quickest using isolcpus=0,1,3...okay it bumped up to 37.2 with opening a pdf.
    I think it will be a usable candidate fro Linuxcnc using a Mesa 7i92 ethernet card.
    One thing I should mention I have wifi turned off.

    0
  • I am in the process of compiling linux-stable-rt-4.19.31-rt18 because I am running it on my RockPro64. When it is done, I will check the patch for linux-4.19.37-rt20 and see what the differences are. I downloaded it after the other compile started.

    0
  • There were a quite the number of changes, so, I went ahead and compiled linux-4.19.37-rt20. I just got home from a short trip out of town and the compile/install was done. So I rebooted and it came up fine. I hadn't been able to get any of the earlier efforts to boot properly, so this time I installed stretch on the emmc and installed the preempt_rt kernel on it. It booted ok. There were a few minor hiccups, but nothing game changing, so far. Probably the fact that I backed everything up this time. It wasn't worth the bother of crashing.

    0
  • It amazing the difference in latency switching from xfce to lxde.
    Checkout this post by JT on the Linuxcnc forums:
    https://forum.linuxcnc.org/9-installing-linuxcnc/36609-lubuntu-18-04#134728

    Hence my reason for running Lubuntu. Or you may get good latencies from Stretch with lxde and the std debian rt kernel

    Some good info on debian install with RT & linuxcnc (you can select lxde rather MATE)
    http://gnipsel.com/linuxcnc/uspace/debian9-rt.html

    0