FORUMS
Remove All Ads from XDA

Build kernel from source and boot to Ubuntu using L4T (Linux for Tegra) rootfs

355 posts
Thanks Meter: 79
 
By yahoo2016, Senior Member on 19th December 2015, 08:47 PM
Post Reply Email Thread
12th January 2016, 01:26 PM |#101  
Junior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by yahoo2016

I took me about 9 minutes to build kernel without "-j". CPU usage for all 8 cores was about 20%.

When I tried "make O=$TEGRA_KERNEL_OUT zImage -j" without "9", CPU usage for all 8 cores was solid 100%, memory usage increased to 100% (16GB) and my HP Z-book locked up.

When I tried "make O=$TEGRA_KERNEL_OUT zImage -j9", CPU usage for all 8 cores was near 100%, memory usage was less than 1GB and build finished in 2 minutes without error.

"make O=$TEGRA_KERNEL_OUT zImage -j" seems to use up to all <available RAM - ~800MB> on my machine which means that when I e.g. open Firefox before compiling I run into memory issues (a lot of programs are swapped to disk and therefore my system becomes very unresponsive (luckily there's the magic sysrq key for that )). However, when I don't have other programs open it seems to work (right after a reboot at least). In this case make started ~4500 Processes (in order to try the "-j" option I had to remove the maximum process limits in /etc/security/limits.conf) and used (nearly) all available memory. Both "-j" and "-j9" took ~2m40s on my machine, so I'll simply stick with using "-j9".

(Edit: It seems that having 4500 CPU cores (and perhaps even more) could actually be useful (for a short time at least) to compile the Linux kernel ^^)
 
 
12th January 2016, 01:35 PM |#102  
OP Senior Member
Thanks Meter: 79
 
More
Quote:
Originally Posted by verbosetextfile

"make O=$TEGRA_KERNEL_OUT zImage -j" seems to use up to all <available RAM - ~800MB> on my machine which means that when I e.g. open Firefox before compiling I run into memory issues (a lot of programs are swapped to disk and therefore my system becomes very unresponsive (luckily there's the magic sysrq key for that )). However, when I don't have other programs open it seems to work (right after a reboot at least). In this case make started ~4500 Processes (in order to try the "-j" option I had to remove the maximum process limits in /etc/security/limits.conf) and used (nearly) all available memory. Both "-j" and "-j9" took ~2m40s on my machine, so I'll simply stick with using "-j9".

(Edit: It seems that having 4500 CPU cores (and perhaps even more) could actually be useful (for a short time at least) to compile the Linux kernel ^^)

I updated my first post to include your inputs so other members can take the advantage of "-j9" without searching through all posts:
************************************************** ************************************************** ************************************
As suggested by verbosetextfile, adding "-j9" to "make" in "first.sh" could significantly increase build speed (e.g., by factor of 4):
http://forum.xda-developers.com/show...0&postcount=97

************************************************** ************************************************** *************************************
12th January 2016, 06:12 PM |#103  
Junior Member
Thanks Meter: 4
 
More
One small correction: You should really only do 'make -j<N>' where N is the amount of threads your computer has +1, so If I have a 4 core computer without hyperthreading then 'make -j5' is best. Running without a parameter given to '-j' is probably a bad idea, as this lets make spawn as many jobs as it wants, which is silly, since much more than the number of hardware threads you have will only increase memory usage but not increase compilation speed.
The Following User Says Thank You to urisma For This Useful Post: [ View ] Gift urisma Ad-Free
12th January 2016, 10:39 PM |#104  
OP Senior Member
Thanks Meter: 79
 
More
Quote:
Originally Posted by urisma

One small correction: You should really only do 'make -j<N>' where N is the amount of threads your computer has +1, so If I have a 4 core computer without hyperthreading then 'make -j5' is best. Running without a parameter given to '-j' is probably a bad idea, as this lets make spawn as many jobs as it wants, which is silly, since much more than the number of hardware threads you have will only increase memory usage but not increase compilation speed.

You are correct, when I tried "-j901", memory usage quickly approaches 16 GB before I killed it.
13th January 2016, 12:10 AM |#105  
OP Senior Member
Thanks Meter: 79
 
More
I received my replacement Shield TV today, just like the other owner posted:

https://forums.geforce.com/default/t...sues/?offset=5

recovery mode does not work anymore after forced update to 2.1.

Update:

After many more tries today including fast tapping power button after power up, I was able to get to recovery mode. I flashed my SATV (Shield Android TV) with Nvidia ROM 1.3 using "fastboot". Now recovery mode is working again reliably every time. Now I have a fully working SATV for development with ROM 1.3.
15th January 2016, 01:21 PM |#106  
OP Senior Member
Thanks Meter: 79
 
More
Has anyone tried Bluetooth with any combination of kernel and Linux rootfs? I can see bluetooth device using "rfkill list" and unblock it using "rfkill unblock 0", but bluetooth still shows as "disabled" in "system settings".
18th January 2016, 06:41 PM |#107  
CableBurner's Avatar
Member
Flag Bavaria =)
Thanks Meter: 5
 
More
Hi,
on my system i am not able to start the xserver with HDMI plugged in at boot.
startx hangs on 'Loading extension GLX'
cat /var/log/Xorg.0.log hangs at:
[ 415.077] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"

If i boot and then plug in HDMI later, it works:
Loading extension GLX
Loading extension NV-GLX
Loading extension NV-CONTROL
Loading extension XINERAMA
...
cat /var/log/Xorg.0.log:
[ 67.382] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"
[ 67.751] Loading extension NV-GLX
[ 67.765] (==) NVIDIA(0): Disabling shared memory pixmaps
[ 67.766] (==) NVIDIA(0): Backing store enabled
[ 67.766] (==) NVIDIA(0): Silken mouse enabled
[ 67.771] (==) NVIDIA(0): DPMS enabled

Nothing special from dmesg.
Is there any possibility to reset the whole HDMI controller somewhere in sysfs? This could be packed into a startup script and then launch X/lightdm...
Best Regards,
Udo
19th January 2016, 11:19 AM |#108  
OP Senior Member
Thanks Meter: 79
 
More
Quote:
Originally Posted by CableBurner

Hi,
on my system i am not able to start the xserver with HDMI plugged in at boot.
startx hangs on 'Loading extension GLX'
cat /var/log/Xorg.0.log hangs at:
[ 415.077] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"

If i boot and then plug in HDMI later, it works:
Loading extension GLX
Loading extension NV-GLX
Loading extension NV-CONTROL
Loading extension XINERAMA
...
cat /var/log/Xorg.0.log:
[ 67.382] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"
[ 67.751] Loading extension NV-GLX
[ 67.765] (==) NVIDIA(0): Disabling shared memory pixmaps
[ 67.766] (==) NVIDIA(0): Backing store enabled
[ 67.766] (==) NVIDIA(0): Silken mouse enabled
[ 67.771] (==) NVIDIA(0): DPMS enabled

Nothing special from dmesg.
Is there any possibility to reset the whole HDMI controller somewhere in sysfs? This could be packed into a startup script and then launch X/lightdm...
Best Regards,
Udo

Which kernel/rootfs were you using? Have you tried different HDMI TV/monitors?

Update:

I was able to duplicate your case for one of Dell monitors (DELL 2408WFP) using L4T rootfs.
19th January 2016, 06:45 PM |#109  
CableBurner's Avatar
Member
Flag Bavaria =)
Thanks Meter: 5
 
More
Quote:
Originally Posted by yahoo2016

Which kernel/rootfs were you using? Have you tried different HDMI TV/monitors?

Update:

I was able to duplicate your case for one of Dell monitors (DELL 2408WFP) using L4T rootfs.

Hi, i followed this one, which should be based on yours: http://www.tatsch.it/linux-4-tegra-w...dia-shield-tv/
I tried different devices: Dell U2412M, Samsung LE23C450, and this Touch Panel.
I think it has to do with the hot plug detect. I cut the hot plug signal on my hdmi cable and booted with HDMI plugged in. Than i connect the hp signal with a switch and can start X/lightdm. But this is quite messy

Best Regards,
Udo
21st January 2016, 08:32 PM |#110  
Junior Member
Thanks Meter: 7
 
More
Thank you very much for sharing how to install L4T on Shield TV!
I found this post and I'm using this boot.img, because I am lazy.
http://forum.xda-developers.com/show...2&postcount=53
It worked very well and I can run CUDA samples and develop my CUDA program on it.

I'm using my Shield TVwith lastest update 2.1.
I flashed linux boot.img to boot partition and boot.img in NVIDIA SHIELD ANDROID TV Recovery OS Image 2.1.0 to recovery partition.
So I can boot both Ubuntu and Android.
When I use ubuntu, just turn on Shield TV or reboot.
When I use android, I boot fastboot and select "boot recovery kernel".
This is how to get fastboot menu with update 2.1.
1. Turn off shield
Touch and hold about 10s in android or "sudo shutdown -h now" in ubuntu.
2. Tap power button once to turn on. Don't keep touching.
3. Wait for about 1 second.
4. Touch and hold power button until you see fastboot menu.
Shield TV need to be connect to PC with use-otg cable.
I can get fastboot menu without unpluging power supply.
It works in 1 or 2 tries.
The Following 2 Users Say Thank You to demotomohiro For This Useful Post: [ View ] Gift demotomohiro Ad-Free
21st January 2016, 10:23 PM |#111  
OP Senior Member
Thanks Meter: 79
 
More
Quote:
Originally Posted by demotomohiro

Thank you very much for sharing how to install L4T on Shield TV!
I found this post and I'm using this boot.img, because I am lazy.
http://forum.xda-developers.com/show...2&postcount=53
It worked very well and I can run CUDA samples and develop my CUDA program on it.

I'm using my Shield TVwith lastest update 2.1.
I flashed linux boot.img to boot partition and boot.img in NVIDIA SHIELD ANDROID TV Recovery OS Image 2.1.0 to recovery partition.
So I can boot both Ubuntu and Android.
When I use ubuntu, just turn on Shield TV or reboot.
When I use android, I boot fastboot and select "boot recovery kernel".
This is how to get fastboot menu with update 2.1.
1. Turn off shield
Touch and hold about 10s in android or "sudo shutdown -h now" in ubuntu.
2. Tap power button once to turn on. Don't keep touching.
3. Wait for about 1 second.
4. Touch and hold power button until you see fastboot menu.
Shield TV need to be connect to PC with use-otg cable.
I can get fastboot menu without unpluging power supply.
It works in 1 or 2 tries.

Thanks for the feedback and trick to boot to recovery mode with update 2.1.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes