Error: Env variable CROSS_COMPILE_AARCH64_PATH is not set!

Hi,
I’m trying to build a customized kernel and encountered an issue below:

/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ sudo ./nvbuild.sh -o $PWD/kernel_out
Error: Env variable CROSS_COMPILE_AARCH64_PATH is not set!!

I followed below:

/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel/kernel$ ./kernel-5.10/scripts/rt-patch.sh apply-patches
The PREEMPT RT patches are already applied to the kernel!
/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel/kernel$ export CROSS_COMPILE_AARCH64_PATH=
/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel/kernel$ export CROSS_COMPILE_AARCH64=/home/mvsk/Downloads/aarch64--glibc--stable-final/bin/aarch64-buildroot-linux-gnu-
/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ sudo ./nvbuild.sh -o $PWD/kernel_out
Error: Env variable CROSS_COMPILE_AARCH64_PATH is not set!!

I followed this link to build.

It’s a little bit hard to understand that I should set the env variable CROSS_COMPILE_AARCH64_PATH= to nothing…
Any comments would be appreciated.

Thank you!

Hi tae123890,

These 2 commands run with different user.
Please run the following command to build the kernel instead.

$ ./nvbuild.sh -o $PWD/kernel_out

Thank you for the response.

I did the ./nvbuild.sh -o $PWD/kernel_out and looks same.
BTW, Is it correct to set CROSS_COMPILE_AARCH64_PATH= to nothing?
I followed this guide.

/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ export CROSS_COMPILE_AARCH64=/home/mvsk/Downloads/aarch64--glibc--stable-final/bin/aarch64-buildroot-linux-gnu-
/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ export CROSS_COMPILE_AARCH64_PATH=
/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ echo $CROSS_COMPILE_AARCH64
/home/mvsk/Downloads/aarch64--glibc--stable-final/bin/aarch64-buildroot-linux-gnu-
/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ echo $CROSS_COMPILE_AARCH64_PATH 

/usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_Kernel_DeviceTree/kernel$ ./nvbuild.sh -o $PWD/kernel_out
Error: Env variable CROSS_COMPILE_AARCH64_PATH is not set!!

It seems not correct.
Please refer to Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation and configure the path of your toolchain.

In your case, it should be the following:

$ export CROSS_COMPILE_AARCH64_PATH=/home/mvsk/Downloads/aarch64--glibc--stable-final
1 Like

Thanks! It worked.

I placed the kernel source on /usr/src and added the environment variables in the /etc/environment.
I did sudo ./nvbuild.sh -o $PWD/kernel_out, and it’s finished successfully.

I have another question:

$ cd <path_to_kernel_source>
$ sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=<top>/Linux_for_Tegra/rootf

Where is the path_to_kernel_source?
Which path should I set as $TEGRA_KERNEL_OUT?

Thanks!

In your case, it seems /usr/src as you said.
Please note it the environment variable you exported is temporary and only available in your current console.

It can be any directory. Normally, we would create a directory call kernel_out under the path of your kernel source. There’s an example in the guide.

I added the environment variables in the file /etc/environment, so I don’t think it’s temporary.

One more question, sorry:
On this document, it says I should untar nvidia_kernel_display_driver_source.tbz2 but I can’t find this file. I can find this file in public_source.tbz2 but the directory name of output of untar nvidia_kernel_display_driver_source.tbz2 is NVIDIA-kernel-module-source-TempVersion/. Is it ok that the version name is TempVersion or am I doing it wrong way?

Thank you!

okay, then it should exist permanently every time you open the new console.

It should be alright.
You can also download the source of each repository from Working With Sources.

1 Like

Thank you for your response.

I created modules successfully with the Makefile in NVIDIA-kernel-module-source-TempVersion/.
But there is one thing I confused
According to this guide doc, I should copy the modules to <top>/Linux_for_Tegra/rootfs/usr/lib/modules/$(uname -r)/extra/opensrc-disp/, but I can see two directories:
The one is /usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_SDK/rootfs/usr/lib/modules/5.10.120-tegra/
The other one is /usr/src/MIC-713_OrinNX_5.1.2_V1.0.1_SDK/rootfs/usr/lib/modules/5.10.120-rt70-tegra/

Should I copy the modules to both?
I did RT-patch.

Thanks!

Please just confirm which one would be used in your case.
It seems 5.10.120-rt70-tegra/ if you apply RT-patch.

Yes. I will use 5.10.120-rt70-tegra.
So I created extra/opensrc-disp/ directory in it and copy the modules in it.

Thanks to your support, I finally flashed!
But after the flash, the screen is just black.
My target device is jetson orin NX.
After booting with NVIDIA logo, nothing shows up.

I found the step in the official doc like In Orin, fix the black screen. This is not required on Xavier.
It says that type the command sudo depmod -a, but how can I type it? even the tty also doesn’t work…

Any comment would be appreciated!

Log in via serial console and run this command.
This is only required on Orin series because graphics drivers are handled differently between Orin and Xavier.

2 Likes

This is the step I conducted:

  1. Setting the username and password with a command ./l4t_create_default_user.sh -u <username> -p <password>as it says.
  2. I connected to Jetson orin to my host PC with micro-usb cable .
  3. Opened Putty for serial console and login with the username and password I registered on 1.
  4. Did sudo depmod -a
  5. reboot.

Unfortunately, the result is all the same… After booting with Nvidia logo, it’s black screen.
I tried three times but nothing changed.
Did I do something wrong?

Thanks!

You need to make sure these drivers are really loaded with sudo lsmod.

This is the output of sudo lsmod:

$ sudo lsmod
Module                  Size  Used by
fuse                  131072  3
nvidia_modeset       1138688  0
lzo_rle                16384  16
lzo_compress           16384  1 lzo_rle
zram                   36864  4
ramoops                28672  0
snd_soc_tegra186_asrc    40960  1
reed_solomon           20480  1 ramoops
snd_soc_tegra186_dspk    20480  2
snd_soc_tegra210_ope    36864  1
snd_soc_tegra186_arad    28672  2 snd_soc_tegra186_asrc
snd_soc_tegra210_iqc    16384  0
snd_soc_tegra210_mvc    20480  2
snd_soc_tegra210_afc    20480  6
snd_soc_tegra210_dmic    20480  4
snd_soc_tegra210_adx    32768  4
snd_soc_tegra210_amx    36864  4
snd_soc_tegra210_i2s    24576  6
snd_soc_tegra210_mixer    49152  1
tpm_tis_spi            16384  0
snd_soc_tegra210_admaif   131072  1
snd_soc_tegra210_sfc    61440  4
tpm_tis_core           28672  1 tpm_tis_spi
snd_soc_tegra_pcm      16384  1 snd_soc_tegra210_admaif
loop                   40960  1
mttcan                 69632  0
can_dev                36864  1 mttcan
can_raw                28672  0
can                    28672  1 can_raw
aes_ce_blk             36864  0
crypto_simd            24576  1 aes_ce_blk
cryptd                 32768  1 crypto_simd
aes_ce_cipher          20480  1 aes_ce_blk
ghash_ce               28672  0
sha2_ce                20480  0
sha256_arm64           28672  1 sha2_ce
sha1_ce                20480  0
snd_soc_spdif_tx       16384  0
snd_soc_tegra_machine_driver    16384  0
snd_soc_tegra210_adsp   774144  1
snd_soc_tegra_utils    32768  3 snd_soc_tegra210_admaif,snd_soc_tegra_machine_driver,snd_soc_tegra210_adsp
snd_soc_simple_card_utils    24576  1 snd_soc_tegra_utils
tegra_bpmp_thermal     16384  0
userspace_alert        16384  0
nvadsp                118784  1 snd_soc_tegra210_adsp
nv_imx219              20480  0
snd_soc_tegra210_ahub  1273856  3 snd_soc_tegra210_ope,snd_soc_tegra210_sfc
tegra210_adma          28672  2 snd_soc_tegra210_admaif,snd_soc_tegra210_adsp
snd_hda_codec_hdmi     65536  1
snd_soc_rt5640        126976  1
ar0234                364544  0
snd_soc_rl6231         16384  1 snd_soc_rt5640
snd_hda_tegra          16384  0
snd_hda_codec         135168  2 snd_hda_codec_hdmi,snd_hda_tegra
snd_hda_core           98304  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_tegra
r8168                 495616  0
spi_tegra114           32768  0
nvidia               1462272  1 nvidia_modeset
ina3221                24576  0
pwm_fan                24576  0
nvgpu                2781184  0
binfmt_misc            24576  1
nvmap                 225280  2 nvgpu
ip_tables              36864  0
x_tables               53248  1 ip_tables

At least the modules I copied during the kernel-building steps are on the list like nvidia.ko, nvidia_modeset.ko, and nvgpu.ko.
I tried to follow the kernel-building steps the official document offers including RT-patch.
Could you give me any hints?

Then what do you have with /var/log/Xorg.0.log?

The output of cat /var/log/Xorg.0.log:

$cat /var/log/Xorg.0.log
[    24.849] (--) Log file renamed from "/var/log/Xorg.pid-1959.log" to "/var/log/Xorg.0.log"
[    24.850]
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[    24.850] Build Operating System: linux Ubuntu
[    24.850] Current Operating System: Linux tegra-ubuntu 5.10.120-rt70-tegra #1 SMP PREEMPT RT Tue Jul 16 16:49:10 KST 2024 aarch64
[    24.851] Kernel command line: pcie_aspm=off root=PARTUUID=5f0167e2-66c4-4371-b962-a3be9367bea5 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb
[    24.851] Build Date: 29 March 2023  12:53:02PM
[    24.851] xorg-server 2:1.20.13-1ubuntu1~20.04.8 (For technical support please see http://www.ubuntu.com/support)
[    24.851] Current version of pixman: 0.38.4
[    24.851]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[    24.851] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    24.851] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jul 18 05:08:23 2024
[    24.852] (==) Using config file: "/etc/X11/xorg.conf"
[    24.852] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    24.852] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    24.854] (==) No Layout section.  Using the first Screen section.
[    24.854] (==) No screen section available. Using defaults.
[    24.854] (**) |-->Screen "Default Screen Section" (0)
[    24.854] (**) |   |-->Monitor "<default monitor>"
[    24.854] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[    24.854] (**) |   |-->Device "Tegra0"
[    24.854] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[    24.854] (==) Automatically adding devices
[    24.854] (==) Automatically enabling devices
[    24.854] (==) Automatically adding GPU devices
[    24.854] (==) Automatically binding GPU devices
[    24.854] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    24.856] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    24.856]    Entry deleted from font path.
[    24.856] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    24.856]    Entry deleted from font path.
[    24.856] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    24.856]    Entry deleted from font path.
[    24.856] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    24.856]    Entry deleted from font path.
[    24.856] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    24.856]    Entry deleted from font path.
[    24.856] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        /usr/share/fonts/X11/Type1,
        built-ins
[    24.856] (==) ModulePath set to "/usr/lib/xorg/modules"
[    24.856] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[    24.856] (II) Loader magic: 0xaaaab9c3a010
[    24.856] (II) Module ABI versions:
[    24.856]    X.Org ANSI C Emulation: 0.4
[    24.856]    X.Org Video Driver: 24.1
[    24.856]    X.Org XInput driver : 24.1
[    24.856]    X.Org Server Extension : 10.0
[    24.858] (++) using VT number 1

[    24.862] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c1
[    24.865] (II) no primary bus or device found
[    24.865] (WW) "dri" will not be loaded unless you've specified it to be loaded elsewhere.
[    24.865] (II) "glx" will be loaded by default.
[    24.865] (II) LoadModule: "extmod"
[    24.865] (II) Module "extmod" already built-in
[    24.865] (II) LoadModule: "glx"
[    24.866] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    24.872] (II) Module glx: vendor="X.Org Foundation"
[    24.872]    compiled for 1.20.13, module version = 1.0.0
[    24.872]    ABI class: X.Org Server Extension, version 10.0
[    24.872] (II) LoadModule: "nvidia"
[    24.872] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[    24.882] (II) Module nvidia: vendor="NVIDIA Corporation"
[    24.882]    compiled for 1.6.99.901, module version = 1.0.0
[    24.882]    Module class: X.Org Video Driver
[    24.882] (II) NVIDIA dlloader X Driver  35.4.1  Release Build  (bugfix_main)  (buildbrain@mobile-u64-6422-d7000)  Tue Aug  1 12:40:10 PDT 2023
[    24.882] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    24.883] (WW) Falling back to old probe method for NVIDIA
[    24.884] (II) Loading sub module "fb"
[    24.884] (II) LoadModule: "fb"
[    24.884] (II) Loading /usr/lib/xorg/modules/libfb.so
[    24.885] (II) Module fb: vendor="X.Org Foundation"
[    24.885]    compiled for 1.20.13, module version = 1.0.0
[    24.886]    ABI class: X.Org ANSI C Emulation, version 0.4
[    24.886] (II) Loading sub module "wfb"
[    24.886] (II) LoadModule: "wfb"
[    24.886] (II) Loading /usr/lib/xorg/modules/libwfb.so
[    24.887] (II) Module wfb: vendor="X.Org Foundation"
[    24.887]    compiled for 1.20.13, module version = 1.0.0
[    24.887]    ABI class: X.Org ANSI C Emulation, version 0.4
[    24.887] (II) Loading sub module "ramdac"
[    24.887] (II) LoadModule: "ramdac"
[    24.887] (II) Module "ramdac" already built-in
[    24.890] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    24.890] (II) NVIDIA(0): Creating default Display subsection in Screen section
        "Default Screen Section" for depth/fbbpp 24/32
[    24.890] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32
[    24.890] (==) NVIDIA(0): RGB weight 888
[    24.890] (==) NVIDIA(0): Default visual is TrueColor
[    24.890] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[    24.890] (DB) xf86MergeOutputClassOptions unsupported bus type 0
[    24.890] (**) NVIDIA(0): Option "AllowEmptyInitialConfiguration" "true"
[    24.890] (**) NVIDIA(0): Enabling 2D acceleration
[    24.890] (II) Loading sub module "glxserver_nvidia"
[    24.890] (II) LoadModule: "glxserver_nvidia"
[    24.891] (II) Loading /usr/lib/xorg/modules/extensions/libglxserver_nvidia.so
[    24.922] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
[    24.922]    compiled for 1.6.99.901, module version = 1.0.0
[    24.922]    Module class: X.Org Server Extension
[    24.922] (II) NVIDIA GLX Module  35.4.1  Release Build  (bugfix_main)  (buildbrain@mobile-u64-6422-d7000)  Tue Aug  1 12:38:45 PDT 2023
[    24.924] (II) NVIDIA: The X server supports PRIME Render Offload.
[    24.949] (EE) NVIDIA(GPU-0): Failed to select a display subsystem.
[    24.949] (EE) NVIDIA(0): Failing initialization of X screen
[    24.949] (II) UnloadModule: "nvidia"
[    24.949] (II) UnloadSubModule: "glxserver_nvidia"
[    24.949] (II) Unloading glxserver_nvidia
[    24.949] (II) UnloadSubModule: "wfb"
[    24.949] (II) UnloadSubModule: "fb"
[    24.949] (EE) Screen(s) found, but none have a usable configuration.
[    24.949] (EE)
Fatal server error:
[    24.949] (EE) no screens found(EE)
[    24.949] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[    24.949] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    24.949] (EE)
[    24.955] (EE) Server terminated with error (1). Closing log file.

Please also share the full serial console log for further check.

Sorry, what does the full serial console log mean?

For the devkit, you can refer to the following instruction to capture serial console log.
Jetson Nano & NX Style - Serial Debug Console - JetsonHacks

For the custom board, please contact your board vendor for details.