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

Search This thread
G

GuestK0099

Guest
had a look into 4.4 seems like some bindings have changed should be fairly possible though,
 
Last edited:

chtulu

Member
Jul 18, 2017
41
1
Done that, and made a missing dtb file for kernel 4.4, it does not go past the nvidia logo.

Without new dtb file, it just reboots.
 

sunxishan

New member
Apr 16, 2011
2
0
JetPack-L4T-3.1-linux-x64.run is with R28.1, it may have some issues here.
You can try to download JetPack 3.0. I tested it and everything works just fine.

Dear Android Hackers,

Short version: L4T in running on my SATV 2015 but CUDA seems not to work correctly.

Long Version: My device is a Shield TV 2015 device and I basically followed the instruction in the first post:

  • Firmware upgrade after Shield activation to the most recent version
  • Bootloader unlocking using
    Code:
    fastboot oem unlock
  • Flashing "mmcblk1p1.img" obtained in the first post (yahoo2106s Kernel) using
    Code:
    fastboot flash boot mmcblk1p1.img
  • Preparing a sdcard according to https://xdaforums.com/showpost.php?p=69202451&postcount=421 and using Tegra210_Linux_R24.2.1_aarch64.tbz2 and Tegra_Linux_Sample-Root-Filesystem_R24.2.1_aarch64.tbz2 and an Ubuntu 14.04 Qemu container

Result was that the SATV boots Linux now! :highfive::good: !! Thanks very much to yahoo2016 and all other contributors to this recipe.

My major interest however is running CUDA on this device. Therefore I

  • downloaded JetPack-L4T-3.1-linux-x64.run, and run it within an Ubuntu 14.04 Qemu container. There I downloaded cuda-repo-l4t-8-0-local_8.0.84-1_arm64.deb and the cuda-l4t.sh script
  • used the script on my SATV to install the cuda debian package. It also installed some other dependencies as well.
  • extended the PATH and LD_LIBRARY_PATH environment variables
  • compiled (succuessfully) the shipped cuda examples in /usr/local/cuda/samples using make

However the execution of any sample failed: running
Code:
/usr/local/cuda/samples/5_Simulations/nbody/nbody -benchmark -numbodies=65536
only results in the error message
Code:
Error: only 0 Devices available, 1 requested.  Exiting.
Strangely also
Code:
lshw -short
does not show the existance of any graphics card hardware:
Code:
H/W path  Device           Class      Description
=================================================
                           system     foster_e
/0                         bus        Motherboard
/0/0                       processor  cpu
/0/1                       processor  cpu
/0/2                       processor  cpu
/0/3                       processor  cpu
/0/4                       memory     2973MiB System memory
/1        usb2             bus        Nvidia xHCI Host Controller
/1/3                       generic    USB 10/100/1000 LAN
/2        usb1             bus        Nvidia xHCI Host Controller
/3        wlan0            network    Wireless interface
/4        dummy0           network    Ethernet interface
/5        enx00044b482f33  network    Ethernet interface

On the other hand,
Code:
glxinfo | grep NVIDIA
shows
Code:
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA Tegra X1 (nvgpu)/integrated
OpenGL core profile version string: 4.5.0 NVIDIA 24.2.1
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL version string: 4.5.0 NVIDIA 24.2.1
OpenGL shading language version string: 4.50 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 24.2.1
and glxgears runs with
Code:
13362 frames in 5.0 seconds = 2672.306 FPS

Does anyone have an idea what could be wrong here? I was thinking that maybe
  1. could it be the wrong kernel: Is gpgpu processing not enables in this kernel? I also tested some other kernel images for the SATV 2015 which I found in this forum and on http://www.tatsch.it/linux-4-tegra-with-cuda-on-nvidia-shield-tv/ using
    Code:
    fastboot boot <kernel>.img
    . None of them was able to boot my SATV
  2. Is cuda 8.0 too new and I should use older version (7.0)?
  3. Is this some dtp problem? I did not yet fully understand what this dtp files are for
 
G

GuestK0099

Guest
Done that, and made a missing dtb file for kernel 4.4, it does not go past the nvidia logo.

Without new dtb file, it just reboots.

You will need to add the shields DTSes (not dtb) to the hardware/something/something dir and diff the Jetson dtses with 3.10 for what you need to change @yahoo2016
 

chtulu

Member
Jul 18, 2017
41
1
You will need to add the shields DTSes (not dtb) to the hardware/something/something dir and diff the Jetson dtses with 3.10 for what you need to change @yahoo2016

Well, I'm not that dumb, I know that, I spent hours, not only to add the missing dts and dtsi, but also to verify them against the existing similar one. Unfortunately with the new dtb file it does not go past the Nvidia logo.
 
G

GuestK0099

Guest
Well, I'm not that dumb, I know that, I spent hours, not only to add the missing dts and dtsi, but also to verify them against the existing similar one. Unfortunately with the new dtb file it does not go past the Nvidia logo.

I would see if there is any earlyprintk output
 

chtulu

Member
Jul 18, 2017
41
1
I would see if there is any earlyprintk output

Tried earlyprintk, nothing. I do not have a console so I can not see the reason why with the new dtb, the shield does not go past the Nvidia logo. I need someone with shield tv 2017 and console to try the new dtb.
 
Last edited:

sunxishan

New member
Apr 16, 2011
2
0
mmcblk0p33.img can be download from here:

Please try it use "sudo fastboot boot mmcblk0p33.img"

hi yahoo2016,

When I use this boot image mmcblk0p33.img for new Shield TV 2017, it can boot up without problems but it seems some problem with some internal driver?
when I hooked up a usb camera I cannot see /dev/video0 device.
If I switch back to sda1.img and use roofs on my USB drive everything works just fine. I think it should not be my roofs problem.

when boot from sda1.img,
Code:
ubuntu@tegra-ubuntu:~$ sudo dmesg | grep video
[    7.145279] uvcvideo: Found UVC 1.00 device HD Pro Webcam C920 (046d:082d)
while boot with mmcblk0p33.img,
Code:
ubuntu@tegra-ubuntu:~$ sudo dmesg | grep video
[    0.336250] Linux video capture interface: v2.00

I think here is the problem.

If you can share some hint how to build this boot image maybe i can debug to see what is the issue.

Thanks,

Xishan
 
Last edited:

crnkoj

Senior Member
Feb 16, 2011
1,844
398
hey guys, been longer away, but still have one of my shields 2015 running the L4T on it (not entirely sure which version though anymore), lsb_release says 16.0.4.1 LTS Xenial.
Now I was wondering if I can update it without breaking it and which packages need to be held back? Thanks!
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
hey guys, been longer away, but still have one of my shields 2015 running the L4T on it (not entirely sure which version though anymore), lsb_release says 16.0.4.1 LTS Xenial.
Now I was wondering if I can update it without breaking it and which packages need to be held back? Thanks!
L4T R24.2.1 is still the last known working version for SATV.

I have been trying L4T R28 on Jetson TX1/TX2, there are many issues.

There is no DTS for SATV (foster) in L4T R28. It appears Nvidia dropped L4T support for SATV since release of TX2.
 
  • Like
Reactions: crnkoj

crnkoj

Senior Member
Feb 16, 2011
1,844
398
L4T R24.2.1 is still the last known working version for SATV.

I have been trying L4T R28 on Jetson TX1/TX2, there are many issues.

There is no DTS for SATV (foster) in L4T R28. It appears Nvidia dropped L4T support for SATV since release of TX2.
Thanks. But what about the Ubuntu updates through apt-get, can I do those? BTW are you updating the latest usable kernel with security updates?
edit> one more thing, did we give up on chainloading o-boot after the android bootloader? This guy got it working for the old OMAP devices, perhaps useable ideas?
https://xdaforums.com/galaxy-nexus/development/bootloader-boot-multi-boot-support-t2201146
https://xdaforums.com/galaxy-s2/general/uboot-bootloader-true-multiboot-t1680898
 
Last edited:

yahoo2016

Senior Member
Nov 24, 2015
392
88
Thanks. But what about the Ubuntu updates through apt-get, can I do those? BTW are you updating the latest usable kernel with security updates?
edit> one more thing, did we give up on chainloading o-boot after the android bootloader? This guy got it working for the old OMAP devices, perhaps useable ideas?
https://xdaforums.com/galaxy-nexus/development/bootloader-boot-multi-boot-support-t2201146
https://xdaforums.com/galaxy-s2/general/uboot-bootloader-true-multiboot-t1680898
I do not see issues for "sudo apt-get update".
I have not touched my SATVs for long time. I have been busy with TX1s/TX2s at work.
 
  • Like
Reactions: crnkoj

crnkoj

Senior Member
Feb 16, 2011
1,844
398
I do not see issues for "sudo apt-get update".
I have not touched my SATVs for long time. I have been busy with TX1s/TX2s at work.
Thanks mate.
Speaking of tx1/2, I saw the tx1 costs 239e now, whole the tx2 costs 600e. Is everything working fine with those? Is it possible to compile kernels natively on those, eventually use a different distronic than Ubuntu with working nvidia drivers (eg like for desktop cards in PCs for instance with gentoo)?
 

yahoo2016

Senior Member
Nov 24, 2015
392
88
Thanks mate.
Speaking of tx1/2, I saw the tx1 costs 239e now, whole the tx2 costs 600e. Is everything working fine with those? Is it possible to compile kernels natively on those, eventually use a different distronic than Ubuntu with working nvidia drivers (eg like for desktop cards in PCs for instance with gentoo)?
Unless more GPU cores are needed, TX1s are better valued. TX1s are compatible with earlier versions of L4Ts, TX2s only support L4T 27 and later.
There are significant differences between kernel of L4T 24.2.1 and kernels of L4T 27 and later.
L4T 24.2.1 has been stable and everything seems working (the same for SATV) as far as I know.
There have been many issues reported for TX2s on Nvidia Devtalk.
I have been natively compiling L4T kernels for both TX1s and TX2s. 32 bit compilers are not needed for later L4Ts.
We are more hardware oriented to use TX1s/TX2s for sensor (e.g., MIPI cameras, IMUs) related work and have not tried to use OSs other than L4T. The vendors only supply drivers for L4T.
 
  • Like
Reactions: crnkoj

deerish

Member
Jan 6, 2016
35
8
Tried earlyprintk, nothing. I do not have a console so I can not see the reason why with the new dtb, the shield does not go past the Nvidia logo. I need someone with shield tv 2017 and console to try the new dtb.

Please provide your work thus far. The UART is on the debug connector next to the fan header.
 

chtulu

Member
Jul 18, 2017
41
1
Please provide your work thus far. The UART is on the debug connector next to the fan header.

Hi, I have already lost one shield tv, trying to get the last kernel working, so I am not going to use the UART, besides the shield is running 24/7 with cuda code, so no chance.

I have made the new dtb for shield tv 2017 and not the one this thread is about, but as I said the shield is stuck at the logo when using it, so I gave up. If someone want to have a look to the entire source code dtb, dts etc I can upload somewhere.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    Update (08/26/2017) Update:

    I updated my SATV Pro 2015 to ROM 5.x, I did not have to replace dtb file. The img files from link below seem still working.


    The following have been tested for SATV ROM 3.x.

    Latest boot images based on L4T24.2 for external SD card, USB drive, internal EMMC and internal HDD can be downloaded from:
    https://drive.google.com/file/d/0Bz5kaPQJx_AgZ3lvWWZFNmJFcmM/view?usp=sharing

    Where,
    "mmcblk1p1.img" is for booting to rootfs on external SD card.
    "sda1.img" is for booting to rootfs on external USB drive (or SD card in USB adapter), or internal SATA HDD of modified 16GB SATV.
    "mmcblk0p29.img" is for booting to rootfs on partition 29 (User Data) of internal eMMC of 16GB SATV if only Ubuntu is needed.
    "mmcblk0p1.img" is for boot to rootfs on partition 1 of internal eMMC of SATV Pro.
    "sda32.img" is for booting to rootfs on partition 32 (User Data) of HDD of 500GB SATV Pro if only Ubuntu is needed.
    "sda33.img" is for booting to rootfs on partition 33 of HDD of 500GB SATV Pro for Ubuntu (modification of HDD partition table is needed).
    "sda34.img" is for booting to rootfs on partition 34 of HDD of 500GB SATV Pro for Ubuntu (modification of HDD partition table is needed).


    You will need to download L4T24.2 driver package and rootfs from Nvidia (https://developer.nvidia.com/embedded/linux-tegra), apply binary drivers to rootfs and copy it to external SD card/USB drive, see this post:

    http://xdaforums.com/showpost.php?p=69202451&postcount=421

    or internal eMMC or HDD (of SATV Pro):
    http://xdaforums.com/showpost.php?p=69202672&postcount=422

    L4T24.2 dtb from L4T24.2 rootfs "/boot" needs to be flashed. To find dtb name for your SATV, type the following in recovery mode:
    sudo fastboot oem dtbname

    Flash the wrong dtb will likely brick the SATV!!!

    To have Wifi working, "/lib/firmware/brcm/fw_bcmdhd.bin" need to be replaced with the one from SATV (in /system/vendor/firmware/bcm4354).

    To build kernel from source, download the latest L4T kernel source, modify tegra21_defconfig by adding "CONFIG_ANDROID=y", example configuration file can be downloaded from the following link

    https://xdaforums.com/showpost.php?p=69078331&postcount=417
    4
    I was able to build kernel using cm13.0 source and boot to L4T R23.1 rootfs.

    Configuration file for CM13.0, kernel image, and "boot.img" can be downloaded from the following link:

    https://drive.google.com/file/d/0Bz...0Bz5kaPQJx_AgT1ZTWGxtQzBzSW8/view?usp=sharing

    To have wifi working, the following 2 files from your SATV need to be copied to linux rootfs:

    CONFIG_BCMDHD_FW_PATH="/data/misc/wifi/firmware/fw_bcmdhd.bin"
    CONFIG_BCMDHD_NVRAM_PATH="/data/misc/wifi/firmware/nvram.txt"


    Maybe someone is interested.

    I got a functional kernel from the official resources for the shield 3.0 version.

    How to get it, see here:
    http://nv-tegra.nvidia.com/gitweb/?p=manifest/android/binary.git;a=blob_plain;f=README_SHIELD;hb=rel-24-foster-r2-partner

    You need to install 'repo' on your computer. Be careful, you get the full android sources. You need a lot
    of space.

    You can go into the kernel-subdirectory and compile a kernel (same procedure and Enviroment-Variables
    as usual).

    But you can use 'tegra21_defconfig' without corrections to get a kernel, that boots Ubuntu from L4T 23.1 or 23.2. I don't know if wifi or bluetooth is running.

    My experience is, the main thing is to find a Kernel that fits to 'tegra210-foster-e-p2530-0930-e02-00.dtb' from the new 3.0 Version, if you like to use android and linux (from recovery partition or vice versa) together.
    3
    Hello yahoo2016,

    you are right, if you use the kernel and tegra210-foster-e-p2530-0930-e02-00.dtb from L4T24.1 64bit over SATV ROM 3.1, you can successfully start the ubuntu desktop with 4k resolution But at this point android is broken. But you can switch back to SATV ROM 3.1 without a problem. That was differnt with version 2.1.

    Maybe you are interested to know this.

    One correction,

    I made a mistake. SATV ROM 3.1 works with the tegra210-foster-e-p2530-0930-e02-00.dtb from L4T24.1.

    So you can run android and ubuntu from sd-card parallel without a problem.
    2
    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://xdaforums.com/showpost.php?p=64589752&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.
    2
    I read first post in this thread, built my boot.img and flashed it to my shield TV.
    I could connect to my shield using ssh, but it couldn’t display a desktop.
    And “sudo shutdown -h now” didn’t work.
    The boot.img built by yahoo2016 can display desktop and shutdown/reboot worked fine.
    My display is “SEIKI SE39UY04” and it supports 3840x2160@30Hz mode.

    I compared shieldTv_defconfig and cyanogenmod_foster_defconfig, and I found that some framebuffer options are set in shieldTv_defconfig.
    CONFIG_FB_NVIDIA=y
    CONFIG_FB_NVIDIA_BACKLIGHT=y
    CONFIG_FB_SIMPLE=y
    They are set yes in shieldTV_defconfig, but they are not set in cyanogenmod_foster_defconfig.
    They are also not set in Jetson TK1, but it displays console message to my display before desktop screen comes.
    I remember that Gentoo wiki for x86/64 says in-kernel nvidia framebuffer driver conflicts with the nvidia binary driver.
    I don’t know wether it also true or not in arm64 CPU or Shield TV, I removed these options and rebuilt the kernel.
    But I still didn’t see desktop and shutdown deosn’t work.
    Then, I removed “CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y”, but no change.
    Then, I removed following options:
    CONFIG_DUMMY_CONSOLE=y
    CONFIG_FRAMEBUFFER_CONSOLE=y
    CONFIG_FONT_8x8=y
    CONFIG_FONT_8x16=y
    They are enabled in Jetson TK1 but I disabled them.
    It worked! I got desktop and shutdown/reboot worked from a ssh client.
    But I found a problem. When I connect display to my shield TV but don’t connect mouse and keyboard, my shield TV displays NVIDIA logo forever and I cannot connect to my shield TV from a ssh client.
    When I connect display, mouse and keyboard, I can get the desktop.
    When I disconnect both display, mouse and keyboard, I can use shield from ssh client and my console CUDA program works.
    No matter if framebuffer related options are set yes or not, I don’t see console message from my display.

    I should try more combinations of kernel options to find out which options do wrong.
    But I will do it later.
    I'm going to talk about L4T on Shield TV on Jetson meet up event in Japan next week.
    I have to make the slide which compare shield TV and jetson TX1, explains why installing linux on shield tv, and how to do it in Japanese.
    I will put link to this topic on my slide.
    I think there are many people who are interested in shield TV as linux machine in my country.