slackware 14.2 + linuxcnc + linux-4.9.80 + rtai-5.1 need some help with modules

More
17 May 2018 11:53 #110814 by jmr
Hi.
kernel source is in /root/linux-4.9.80. there is a symlink to it as /usr/src/linux
rtai is installed in /usr/realtime-4.9.80-rtai with symlink /usr/realtime
this is FINE i think: I can run /usr/realtime/testsuite/kern/latency/run and get some good results.
Linuxcnc (downloaded with git) also compiles, ./configure --enable-non-distributable --with-realtime=/usr/realtime-4.9.80-rtai, then make, make setuid
then I have a problem:
chuj@emc2:/usr/linuxcnc/scripts$ ./latency-test 
insmod: ERROR: could not insert module /usr/linuxcnc/rtlib/rtapi.ko: Unknown symbol in module
and then in dmesg:
May 17 11:46:55 emc2 kernel: [ 3813.764230] rtapi: Unknown symbol rtf_put (err 0)
and so on
but IF I copy rtapi.ko in /lib/modules/4.9.80-rtai/ i can load it with modprobe and it loads rtai_sem, rtai_shm, rtai_fifos, rtai_sched and rtai_hal, so there is no real problem, just missing symbols somwhere. Of course, halrun and/or latency-test just wants to use the insmod, and fails if the modules are already installed, and also calls them by full path. I tried to symlink the rtlib dir in /lib/modules... and run depmod, but it did not help.
I suspect i'm missing one step here. as all of that symbols are in /usr/linuxcnc/rtlib/Module.symvers.
Any ideas? Should I have the directories organized differently?
More
17 May 2018 16:12 #110817 by AnnoyingMutt
check your rtapi.conf

Can't remember exact location you will have to search for it.
The following user(s) said Thank You: jmr
More
17 May 2018 21:58 - 17 May 2018 22:27 #110822 by jmr
i found it in /usr/linuxcnc/scripts:
# DO NOT EDIT THIS FILE !
#
# ../scripts/rtapi.conf.  Generated from rtapi.conf.in by configure. 
# on Thu May 17 10:10:13 CEST 2018
#

# A few parameters from emc2/Makefile.inc
EMC2_HOME=/usr/linuxcnc
KERNELDIR=/root/linux-4.9.80
RTLIB_DIR=/usr/linuxcnc/rtlib
MODULE_EXT=.ko
RTPREFIX=rtai
KERNEL_VERS=4.9.80-rtai

# Sets the default DEBUG level
DEBUG='1'

# Path to the realtime kernel modules
MODPATH=/usr/realtime-4.9.80-rtai/modules

# List of realtime kernel modules to be loaded
if [ "5" = "3" ] ; then \
    MODULES="adeos rtai_hal rtai_ksched rtai_fifos rtai_sem rtai_math"
    RTAI=5
    MODPATH_adeos=
    MODPATH_rtai_hal=/usr/realtime-$(uname -r)/modules/rtai_hal.ko
    MODPATH_rtai_ksched=
    MODPATH_rtai_fifos=/usr/realtime-$(uname -r)/modules/rtai_fifos.ko
    MODPATH_rtai_sem=/usr/realtime-$(uname -r)/modules/rtai_sem.ko
    MODPATH_rtai_math=
elif [ "5" = "5" ] ; then \
    MODULES="rtai_hal rtai_sched rtai_math"
    RTAI=5
    MODPATH_rtai_hal=/usr/realtime-$(uname -r)/modules/rtai_hal.ko
    MODPATH_rtai_sched=/usr/realtime-$(uname -r)/modules/rtai_sched.ko
    MODPATH_rtai_math=
else
case `uname -r` in
*-rtai*)
    MODULES="rtapi rtai_hal rtai_sched"
    MODPATH_rtai_hal=/usr/realtime-`uname -r`/modules/rtai_hal.ko
    MODPATH_rtai_sched=/usr/realtime-`uname -r`/modules/rtai_sched.ko
;;
*)  MODULES=
esac
fi
There is no mention of rtapi.ko. Paths seem ok, and the "5"="3" is... very unlikely. I tried adding defining MODPATH_rtapi in *-rtai* case, and adding it to MODULES as You can see. This did not change the behavior.
I copied the rtapi.ko to /lib/modules... insmod /lib/modules....rtapi.ko fails with unknown symbols. modprobe rtapi loads it with no word. wtf? man insmod states that modprobe "is more clever and can handle module dependencies"
Maybe i have the answer now... After modprobe, there is rtai_fifos, rtai_sched, rtai_sem, rtai_shm and rtai_hal loaded. with that modprobed i CAN insmod the rtapi! I will try adding them to rtapi.conf.
update:
this issue solved. Had also to add rtai_shm to module helper whitelist. Now I need to get ulimit -l bigger..
Last edit: 17 May 2018 22:27 by jmr. Reason: update
More
17 May 2018 23:16 - 18 May 2018 02:14 #110824 by AnnoyingMutt
ulimit solution

docs.slackware.com/studioware:tips_and_h...ng_and_locked_memory

Don't forget to reboot.

I ran with a 4.4.71 kernel......latencies are not so good on this old Dell Optiplex 170l may try on my AMD hardware.

I forgot about the editing the module helper code.
Last edit: 18 May 2018 02:14 by AnnoyingMutt.
More
18 May 2018 08:53 #110834 by jmr
This looks much more universal - I got around it using set-rlimits, but adding a line to the config for each and every possible executable is not nice., that ulimit approach looks more promising.
I compiled/tested on dell optiplex gx520 with some pIV inside. With this setup I had quite stable ~6000-7000ns max latency, affected by onboard video (which is why i ran latency-test on remote X), and also integrated audio - opening the mixer caused a big spike. Hdd and network seem ok.
I also tested and it booted on pentium II with ecc memory, it needed lapic in the boot line. Performance was not that good - more like 30uS. My ultimate goal now would be to find a mobo that will have nice latency and an ISA slot... I have some in the bin. Need to change the caps to get it working. It that and another one or two is not as fast as this dell i can stick to double parport for a moment...
Thanks!
More
18 May 2018 09:15 #110835 by AnnoyingMutt
I usually just disable the sound completely in the BIOS.....I'm really just testing on the Dell as a proof of concept, I have a couple of AMD M\B and combined with a Radeon GPU (one has on board video that I'm leaning towards) that give some really good results, actually they really rocket with an SSD, plus being uATX boards I should be able to shoe horn the MB into my cabinet.

I never seem to get good results with Intel based setups, I'm guessing that's just the hardware I have access to, but AMD based setups with a Radeon gpu appear to be sweet.

But glad to see you have it going.
Time to create page: 0.096 seconds
Powered by Kunena Forum