Issues rebuilding the kernel gk20a/gk20a.h (and dev-t18x.h): No such file or directory

I’m having issues rebuilding the TX2 kernel under Ubuntu 16.04 x86_64

sudo apt-get install gcc-aarch64-linux-gnu

Downloaded R27.1 sources

export CROSS_COMPILE=aarch-linux-gnu-
make kernel tegra21_defconfig

I get :

CC drivers/gpio/gpio-pca953x.o
CC drivers/gpio/gpio-tegra.o
LD drivers/gpio/built-in.o
CC drivers/gpu/…/…/…/nvgpu/drivers/gpu/nvgpu/common/linux/timers.o
drivers/gpu/…/…/…/nvgpu/drivers/gpu/nvgpu/common/linux/timers.c:21:25: fatal error: gk20a/gk20a.h: No such file or directory
compilation terminated.
scripts/ recipe for target ‘drivers/gpu/…/…/…/nvgpu/drivers/gpu/nvgpu/common/linux/timers.o’ failed

Anyone else seen this of can see what I’m doing wrong?

If this is a TX2 and not a TX1 then tegra21_defconfig would be incorrect. The TX1 is the Tegra 21x series, the TX2 is the Tegra 18x series. I’d recommend a starting config from a running system’s “/proc/config.gz”, but you might also want to try config target “tegra18_defconfig” prior to building.

This is TX2. I extracted a clean r27.1.0_sources.tbz2 kernel source.

export arch=arm64
export CROSS_COMPILE=aarch-linux-gnu-
make kernel tegra18_defconfig

This time I received the following error:

CC drivers/…/…/t18x/drivers/platform/tegra/nvadsp/os-t18x.o
CC drivers/…/…/t18x/drivers/platform/tegra/nvadsp/dev-t18x.o
In file included from drivers/…/…/t18x/drivers/platform/tegra/nvadsp/dev-t18x.c:22:0:
drivers/platform/tegra/nvadsp/dev.h:32:22: fatal error: dev-t18x.h: No such file or directory
compilation terminated.

Its different but still not building. Missing an include path somewhere…

I compared the tegra18_defconfig generated (.config) with the one taken from my TX2 /proc/config.gz (Jetpack 3.0 flashed image) and they are identical.

I have not yet built the R27 kernels (soon to do but I have other things which require time first), but very likely you also need (this is because of the kernel’s compatibility mode for armhf):

export CROSS32CC=/full/path/to/bin/arm-linux-ghueabihf-gcc

Anyone here built the kernel yet who can comment on dev-t18x.h missing? Is there a CONFIG item needing removal, or is the file truly missing?

I’ve built the r27.1.0 kernel, the process is noticeably different than building the r24.1 kernel. @newmanross when you updated your kernel source branch did you use the script?

That script will clone more than just the kernel repo, it also clones a bunch of other repos, here is what the structure of my ‘sources’ directory looks like:

Linux_for_Tegra/sources $ tree -L 2
|-- hardware
| -- nvidia |-- kernel | |-- display | |-- kernel-4.4 | |-- nvgpu | |-- nvgpu-t18x | |-- nvhost | |-- nvhost-t18x | |-- nvmap | |-- nvmap-t18x | – t18x
`-- u-boot

In the 2.4.1 sources directory it just looks like this:

|-- kernel_source
`-- u-boot_source

Before the new Kernel Driver Package came out I tried to use my r24.1 driver package and just pull the r27.1.0 branch from NVIDIA and ran into a similar issue as you are describing



According to the document of Driver Package:

Have you tried to build with command “make O=$TEGRA_KERNEL_OUT” ?

As cospan said, please make sure the whole source directory is downloaded. The missing file dev-t18x.h is under t18x folder.

Another thing is the toolchain you are using. I see that you did a apt-get install of the latest aarch64 gcc toolchain. We provide a recommended toolchain to use for building Nvidia kernel source. You can download it from -

Hi All,

I tried to rebuilding the TX2 kernel as follows:

export arch=arm64
export CROSS_COMPILE=~/install/bin/aarch64-unknown-linux-gnu
export CROSS32CC=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
make mrproper
make tegra18_defconfig
make menuconfig

I received the following error:

drivers/…/…/t18x/drivers/crypto/tegra-se-nvhost.c:57:32: fatal error: t186/hardware_t186.h: No such file or directory
#include “t186/hardware_t186.h”
compilation terminated.
scripts/ recipe for target ‘drivers/…/…/t18x/drivers/crypto/tegra-se-nvhost.o’ failed
make[3]: *** [drivers/…/…/t18x/drivers/crypto/tegra-se-nvhost.o] Error 1
scripts/ recipe for target ‘drivers/…/…/t18x/drivers/crypto’ failed
make[2]: *** [drivers/…/…/t18x/drivers/crypto] Error 2
scripts/ recipe for target ‘drivers/…/…/t18x/drivers’ failed
make[1]: *** [drivers/…/…/t18x/drivers] Error 2
Makefile:958: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2

I am using the recommended toolchain by rrv!

Hi ACervantes,

Please try the steps in the documents.


I’m still getting this error, it is the dev.h that is missing. dev-t18x.h exists, but it include dev.h which doesn’t exist

I tested with tegra18_defconfig (under compiler version 4.8.5…the one that ships with documentation) and did not have an issue. Different config options may result in missing files which this config does not care about. Can you build the entire source using tegra18_defconfig, and then use something like “make nconfig” to edit to your changes one or two at a time? At some point a change should result in finding out which config item is missing something.

Hi all

i followed l4t-documentation-27-1 to compile the kernel
but i have question.

i download the L4T Sources
and followed l4t-documentation-27-1 to compile the kernel.
it will compile success.

i download kernel from;a=summary
and followed l4t-documentation-27-1 to compile the kernel.
but i have this error
100:55: fatal error: dt-bindings/soc/nvidia,tegra186-powergate.h: No such file or directory
#include <dt-bindings/soc/nvidia,tegra186-powergate.h>

anybody can help to give some suggestion

hi etta,

Thanks for your response. Where do you see this link? From any document?

Hi WayneWWW

i find the link from google

so the source code form server have some error or need more step ??

Hi etta,

The missing file is under ./t18x/include/dt-bindings/soc/nvidia,tegra186-powergate.h

Could you help check if you download this file?

Hi WayneWWW

i can’t find nvidia,tegra186-powergate.h in linux-4.4 folder form;a=summary

the kernel source form;a=summary
only one folder but the kernel source from download center not only linux-4.4 folder


It is not enough to fetch only linux-4.4 repo to build kernel after rel-27.1. As you can see in your link, there is a script for download source code and the repo t18x has the file you lost.

UPDATE: If you see fatal error: dev-t18x.h: No such file or directory

You get this error if you don’t use -O

export arch=arm64
export CROSS_COMPILE=/install/bin/aarch64-unknown-linux-gnu-
make O=$TEGRA_KERNEL_OUT tegra18_defconfig

A case of following the instructions exactly… Its all working now.