Need Real-Time kernel for Jetson-TK1 to work on Ubuntu 14.04

hello

  • i want help in developing a real-time application on Jetson-TK1 so i want a trusted real-time kernel to make the Ubuntu 14.04 work as preemptive kernel or a RT-Linux

  • any ideas can help me
    -there are some previous discussions about that but not giving the correct answer.


1- https://devtalk.nvidia.com/default/topic/475824/realtime-kernel/

2- https://devtalk.nvidia.com/default/topic/387738/realtime-dsp-w-cuda-on-linux-product-selection-advice/

3- https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch29.html

4- https://devtalk.nvidia.com/default/topic/456973/parallel-of-cpu-and-gpu-in-real-time-imaging/

5- https://devtalk.nvidia.com/default/topic/452771/gpgpu-with-a-hard-real-time-os-/

6- TK1 Jetson Real Time 3.10.24 Linux Kernel config help (important but no complete answer )

https://devtalk.nvidia.com/default/topic/821345/tk1-jetson-real-time-3-10-24-linux-kernel-config-help/

https://devtalk.nvidia.com/default/topic/821342/embedded-systems/tk1-jetson-real-time-3-10-24-linux-kernel-config-help/

http://nv-tegra.nvidia.com/gitweb/?p=linux-3.10.git

7- https://devtalk.nvidia.com/default/topic/803869/jetson-tk1/real-time-linux-on-tegra-k1-soc/

8- https://devtalk.nvidia.com/default/topic/738005/cuda-6-0-and-real-time-linux/

9- https://devtalk.nvidia.com/default/topic/457947/cuda-with-a-real-time-kernel-how-do-i-integrate-rtx-with-cuda-/?offset=3

10- https://devtalk.nvidia.com/default/topic/480959/is-there-support-for-cuda-in-any-rtos-/

11- https://devtalk.nvidia.com/default/topic/762997/cuda-under-a-multithreaded-environment/?offset=3

12- Simply impossible to use an Nvidia card on a real-time kernel (no musician can use nvidia)

https://devtalk.nvidia.com/default/topic/777636/simply-impossible-to-use-an-nvidia-card-on-a-real-time-kernel-no-musician-can-use-nvidia-/

Nothing about the real-time linux kernel to work fine with jetson tk1

i will wait for answer from someone or from NVIDIA it self.

One thing to consider is that Linux itself was never meant to be “hard” real time. If you cut out enough of the general/multi-purpose desktop environment you’d stand a chance of getting close to real time, but not exactly.

One limitation I see is the inability to spread hardware interrupts over multiple cores. This means that only CPU0 can handle drivers from hardware devices…all hardware devices (every single driver allowed in must be optimized and minimal if they are to cooperate on a single core). If one driver hogs the time slice, then the rest suffer. Other software can be spread over several CPU cores, but if you have something urgent from a hardware device, CPU0 just won’t be immediately giving up access to something else.

The fast IRQ (FIQ) is designed to aid real time, but this is not generally available in Linux by design (the scheduler does not know about FIQ). The idea behind FIQ is that it is designed to be serviced immediately, and that the code space directly above the interrupt vector begins without need for a branch instruction. Like other interrupts, this is on CPU0, but has hardware-enforced priority. If you add the ability for some drivers/hardware to be able to generate/service FIQ then you could definitely get some improved latency from this…unfortunately, you’re probably also going to interfere with some of the other interrupt handling which was not designed to deal with that kind of forcible yanking away of control from a regular IRQ to FIQ.

On an Intel multi-core CPU normally only CPU0 could handle hardware interrupts, just like the ARM multi-core CPU. However, there is some hardware assist that combined with an asynchronous programmable interrupt controller (IO-APIC) hardware IRQs can be spread across cores…this is an extreme boost in reducing latency with systems being able to remain smooth even with extreme hardware IRQ rate/load (IRQ starvation occurs much earlier under load with no IO-APIC versus with IO-APIC). It takes a slight bit more time to use the IO-APIC versus running without IO-APIC when not enough IRQs are occurring to need multiple cores, but as interrupt request rate goes up (meaining hardware drivers needing a time slice), the IO-APIC version just doesn’t slow down until it is at a much much higher load than compared to the CPU without the IO-APIC.

ARM Cortex-A series does not have the hardware to easily implement an IO-APIC, but I sometimes wonder if some approximation could be achieved with some GPIO trickery and a custom equivalent to the IO-APIC code sitting just above the FIQ interrupt as a sort of surrogate hardware IRQ handler. I’ve not figured that one out.

If real time were even “moderately difficult” under Linux and not easy I suspect the needs of so many people would mean that we’d already have the hard real time Linux distributions. Ubuntu itself is not meant for that, though you could get vast improvements by judicious cutting of lots of things, including graphical desktops.

Also note that ARM does make the Cortex-R series, which is the real time hardware. Tegra chips use the Cortex-A series which is designed for high performance in generalized situations…on average, not as a real time performance.

i am rely appreciate your valuable comments , but i think that jetson-tk1 can give good results in high speed calculations or real time if some points are solved:

1- using a real time kernel instead of its kernel(in Ubuntu 14.04), reduce some service and the GUI from the system during operation.[i do not know can i use the nvidia development kit on the new kernel or not]

2- running with only one user interrupt to control the system operation.

3- make some threads work on the ARM and the matrix or image threads to work on the GPU

you can correct me if i am wrong, or you can help me if you are familiar of that i will appreciate your help because i am not expert on that.

thanks

The X11 ABI is tied to the kernel. You could possibly build a new kernel with that ABI, it’s public. I doubt it would be easy. The nVidia hardware driver for video is tied to that ABI…if that ABI is preserved then the nVidia driver can be used. However, that’s just one obvious ABI, there may be others. What you really need is a separate open source real time o/s you can port various ABIs to while sticking to the GNU ELF format (this is the format of the proprietary binaries)…but even then the ARM CPUs are not Cortex-R series so you could not guarantee real time even if comes very close (“far better” is not the same as hard real time).

The approach most likely to be taken is to have a second controller or FPGA added on for specialty real time tasks. You’d then need the driver to just this particular device be essentially real time and not the entire Linux kernel.