How to successfully update Jetson TK1 to Ubuntu 16.04

I cannot promise that I haven’t severely broken the GPU modules in any way, but after quite a bit of work and abandoning kernel 4.4 Civil Infrastructure Platform, well, here we are at 6.1 LTS.

Here’s the errors I have at the moment:

  CALL    scripts/checksyscalls.sh
  CC      drivers/video/tegra/nvmap/nvmap_dev.o
  CC      drivers/gpu/nvgpu/gk20a/gk20a.o
  CC      drivers/video/tegra/nvmap/nvmap_heap.o
  CC      drivers/video/tegra/camera/camera.o
  CC      drivers/video/tegra/camera/camera_clk.o
drivers/video/tegra/nvmap/nvmap_heap.c: In function ‘nvmap_alloc_mem’:
drivers/video/tegra/nvmap/nvmap_heap.c:103:17: error: ‘DMA_ATTR_ALLOC_EXACT_SIZE’ undeclared (first use in this function)
  103 |         attr |= DMA_ATTR_ALLOC_EXACT_SIZE;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:103:17: note: each undeclared identifier is reported only once for each function it appears in
drivers/video/tegra/nvmap/nvmap_dev.c:115:27: error: initialization of ‘vm_fault_t (*)(struct vm_fault *)’ {aka ‘unsigned int (*)(struct vm_fault *)’} from incompatible pointer type ‘int (*)(struct vm_area_struct *, struct vm_fault *)’ [-Werror=incompatible-pointer-types]
  115 |         .fault          = nvmap_vma_fault,
      |                           ^~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_dev.c:115:27: note: (near initialization for ‘nvmap_vma_ops.fault’)
In file included from ./arch/arm/include/asm/thread_info.h:14,
                 from ./include/linux/thread_info.h:60,
                 from ./include/asm-generic/preempt.h:5,
                 from ./arch/arm/include/generated/asm/preempt.h:1,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:56,
                 from ./include/linux/wait.h:9,
                 from ./include/linux/wait_bit.h:8,
                 from ./include/linux/fs.h:6,
                 from ./include/linux/backing-dev.h:13,
                 from drivers/video/tegra/nvmap/nvmap_dev.c:23:
drivers/video/tegra/nvmap/nvmap_dev.c: In function ‘nvmap_flush_heap_block’:
./arch/arm/include/asm/page.h:12:33: error: passing argument 1 of ‘free_vm_area’ makes pointer from integer without a cast [-Werror=int-conversion]
   12 | #define PAGE_SIZE               (_AC(1,UL) << PAGE_SHIFT)
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 long unsigned int
drivers/video/tegra/nvmap/nvmap_dev.c:205:29: note: in expansion of macro ‘PAGE_SIZE’
  205 |         area = free_vm_area(PAGE_SIZE);
      |                             ^~~~~~~~~
In file included from ./include/asm-generic/io.h:994,
                 from ./arch/arm/include/asm/io.h:416,
                 from ./include/linux/io.h:13,
                 from ./include/linux/irq.h:20,
                 from ./include/asm-generic/hardirq.h:17,
                 from ./arch/arm/include/asm/hardirq.h:10,
                 from ./include/linux/hardirq.h:11,
                 from ./include/linux/highmem.h:12,
                 from ./include/linux/bvec.h:10,
                 from ./include/linux/blk_types.h:10,
                 from ./include/linux/writeback.h:13,
                 from ./include/linux/backing-dev.h:16:
./include/linux/vmalloc.h:215:37: note: expected ‘struct vm_struct *’ but argument is of type ‘long unsigned int’
  215 | void free_vm_area(struct vm_struct *area);
      |                   ~~~~~~~~~~~~~~~~~~^~~~
drivers/video/tegra/nvmap/nvmap_dev.c:205:14: error: void value not ignored as it ought to be
  205 |         area = free_vm_area(PAGE_SIZE);
      |              ^
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘nvhost_channel_suspend’:
drivers/gpu/nvgpu/gk20a/gk20a.c:74:13: error: implicit declaration of function ‘channel_cdma_op’ [-Werror=implicit-function-declaration]
   74 |         if (channel_cdma_op().stop && ch->dev)
      |             ^~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:74:30: error: request for member ‘stop’ in something not a structure or union
   74 |         if (channel_cdma_op().stop && ch->dev)
      |                              ^
drivers/gpu/nvgpu/gk20a/gk20a.c:74:41: error: invalid use of undefined type ‘struct nvhost_channel’
   74 |         if (channel_cdma_op().stop && ch->dev)
      |                                         ^~
drivers/gpu/nvgpu/gk20a/gk20a.c:75:34: error: request for member ‘stop’ in something not a structure or union
   75 |                 channel_cdma_op().stop(&ch->cdma);
      |                                  ^
drivers/gpu/nvgpu/gk20a/gk20a.c:75:43: error: invalid use of undefined type ‘struct nvhost_channel’
   75 |                 channel_cdma_op().stop(&ch->cdma);
      |                                           ^~
drivers/gpu/nvgpu/gk20a/gk20a.c:80:1: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
   80 | int nvhost_module_disable_clk(struct device *dev)
      | ^~~
In file included from ./include/linux/linkage.h:7,
                 from ./arch/arm/include/asm/bug.h:5,
                 from ./include/linux/ktime.h:26,
                 from ./include/trace/events/gk20a.h:22,
                 from drivers/gpu/nvgpu/gk20a/gk20a.c:22:
drivers/gpu/nvgpu/gk20a/gk20a.c:102:15: error: non-static declaration of ‘nvhost_module_disable_clk’ follows static declaration
  102 | EXPORT_SYMBOL(nvhost_module_disable_clk);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/export.h:87:28: note: in definition of macro ‘___EXPORT_SYMBOL’
   87 |         extern typeof(sym) sym;                                                 \
      |                            ^~~
./include/linux/export.h:147:41: note: in expansion of macro ‘__EXPORT_SYMBOL’
  147 | #define _EXPORT_SYMBOL(sym, sec)        __EXPORT_SYMBOL(sym, sec, "")
      |                                         ^~~~~~~~~~~~~~~
./include/linux/export.h:150:41: note: in expansion of macro ‘_EXPORT_SYMBOL’
  150 | #define EXPORT_SYMBOL(sym)              _EXPORT_SYMBOL(sym, "")
      |                                         ^~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:102:1: note: in expansion of macro ‘EXPORT_SYMBOL’
  102 | EXPORT_SYMBOL(nvhost_module_disable_clk);
      | ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:80:5: note: previous definition of ‘nvhost_module_disable_clk’ with type ‘int(struct device *)’
   80 | int nvhost_module_disable_clk(struct device *dev)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/export.h:57:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
   57 |         static const struct kernel_symbol __ksymtab_##sym               \
      |         ^~~~~~
./include/linux/export.h:96:9: note: in expansion of macro ‘__KSYMTAB_ENTRY’
   96 |         __KSYMTAB_ENTRY(sym, sec)
      |         ^~~~~~~~~~~~~~~
./include/linux/export.h:140:41: note: in expansion of macro ‘___EXPORT_SYMBOL’
  140 | #define __EXPORT_SYMBOL(sym, sec, ns)   ___EXPORT_SYMBOL(sym, sec, ns)
      |                                         ^~~~~~~~~~~~~~~~
./include/linux/export.h:147:41: note: in expansion of macro ‘__EXPORT_SYMBOL’
  147 | #define _EXPORT_SYMBOL(sym, sec)        __EXPORT_SYMBOL(sym, sec, "")
      |                                         ^~~~~~~~~~~~~~~
./include/linux/export.h:150:41: note: in expansion of macro ‘_EXPORT_SYMBOL’
  150 | #define EXPORT_SYMBOL(sym)              _EXPORT_SYMBOL(sym, "")
      |                                         ^~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:102:1: note: in expansion of macro ‘EXPORT_SYMBOL’
  102 | EXPORT_SYMBOL(nvhost_module_disable_clk);
      | ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:117:12: error: invalid storage class for function ‘gk20a_pm_finalize_poweron’
  117 | static int gk20a_pm_finalize_poweron(struct device *dev);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:118:12: error: invalid storage class for function ‘gk20a_pm_prepare_poweroff’
  118 | static int gk20a_pm_prepare_poweroff(struct device *dev);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:120:20: error: invalid storage class for function ‘set_gk20a’
  120 | static inline void set_gk20a(struct platform_device *dev, struct gk20a *gk20a)
      |                    ^~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:185:20: error: invalid storage class for function ‘sim_writel’
  185 | static inline void sim_writel(struct gk20a *g, u32 r, u32 v)
      |                    ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:190:19: error: invalid storage class for function ‘sim_readl’
  190 | static inline u32 sim_readl(struct gk20a *g, u32 r)
      |                   ^~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:195:13: error: invalid storage class for function ‘kunmap_and_free_iopage’
  195 | static void kunmap_and_free_iopage(void **kvaddr, struct page **page)
      |             ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:207:13: error: invalid storage class for function ‘gk20a_free_sim_support’
  207 | static void gk20a_free_sim_support(struct gk20a *g)
      |             ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:220:13: error: invalid storage class for function ‘gk20a_remove_sim_support’
  220 | static void gk20a_remove_sim_support(struct sim_gk20a *s)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:228:12: error: invalid storage class for function ‘alloc_and_kmap_iopage’
  228 | static int alloc_and_kmap_iopage(struct device *d,
      |            ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:257:22: error: invalid storage class for function ‘gk20a_ioremap_resource’
  257 | static void __iomem *gk20a_ioremap_resource(struct platform_device *dev, int i,
      |                      ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:269:12: error: invalid storage class for function ‘gk20a_init_sim_support’
  269 | static int gk20a_init_sim_support(struct platform_device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:346:19: error: invalid storage class for function ‘sim_msg_header_size’
  346 | static inline u32 sim_msg_header_size(void)
      |                   ^~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:351:20: error: invalid storage class for function ‘sim_msg_bfr’
  351 | static inline u32 *sim_msg_bfr(struct gk20a *g, u32 byte_offset)
      |                    ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:356:20: error: invalid storage class for function ‘sim_msg_hdr’
  356 | static inline u32 *sim_msg_hdr(struct gk20a *g, u32 byte_offset)
      |                    ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:361:20: error: invalid storage class for function ‘sim_msg_param’
  361 | static inline u32 *sim_msg_param(struct gk20a *g, u32 byte_offset)
      |                    ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:367:20: error: invalid storage class for function ‘sim_write_hdr’
  367 | static inline void sim_write_hdr(struct gk20a *g, u32 func, u32 size)
      |                    ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:377:19: error: invalid storage class for function ‘sim_escape_read_hdr_size’
  377 | static inline u32 sim_escape_read_hdr_size(void)
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:382:13: error: invalid storage class for function ‘sim_send_ring_bfr’
  382 | static u32 *sim_send_ring_bfr(struct gk20a *g, u32 byte_offset)
      |             ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:387:12: error: invalid storage class for function ‘rpc_send_message’
  387 | static int rpc_send_message(struct gk20a *g)
      |            ^~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:417:20: error: invalid storage class for function ‘sim_recv_ring_bfr’
  417 | static inline u32 *sim_recv_ring_bfr(struct gk20a *g, u32 byte_offset)
      |                    ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:422:12: error: invalid storage class for function ‘rpc_recv_poll’
  422 | static int rpc_recv_poll(struct gk20a *g)
      |            ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:470:12: error: invalid storage class for function ‘issue_rpc_and_wait’
  470 | static int issue_rpc_and_wait(struct gk20a *g)
      |            ^~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:518:20: error: invalid storage class for function ‘gk20a_intr_isr_stall’
  518 | static irqreturn_t gk20a_intr_isr_stall(int irq, void *dev_id)
      |                    ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:540:20: error: invalid storage class for function ‘gk20a_intr_isr_nonstall’
  540 | static irqreturn_t gk20a_intr_isr_nonstall(int irq, void *dev_id)
      |                    ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:562:13: error: invalid storage class for function ‘gk20a_pbus_isr’
  562 | static void gk20a_pbus_isr(struct gk20a *g)
      |             ^~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:589:20: error: invalid storage class for function ‘gk20a_intr_thread_stall’
  589 | static irqreturn_t gk20a_intr_thread_stall(int irq, void *dev_id)
      |                    ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:622:20: error: invalid storage class for function ‘gk20a_intr_thread_nonstall’
  622 | static irqreturn_t gk20a_intr_thread_nonstall(int irq, void *dev_id)
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:647:13: error: invalid storage class for function ‘gk20a_remove_support’
  647 | static void gk20a_remove_support(struct platform_device *dev)
      |             ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:686:12: error: invalid storage class for function ‘gk20a_init_support’
  686 | static int gk20a_init_support(struct platform_device *dev)
      |            ^~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:731:12: error: invalid storage class for function ‘gk20a_init_client’
  731 | static int gk20a_init_client(struct platform_device *dev)
      |            ^~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:105:17: error: ‘DMA_MEMORY_NOMAP’ undeclared (first use in this function)
  105 |                 DMA_MEMORY_NOMAP |= attr);
      |                 ^~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:104:15: error: too few arguments to function ‘dma_alloc_attrs’
  104 |         (void)dma_alloc_attrs(dev, len, &pa,
      |               ^~~~~~~~~~~~~~~
In file included from ./include/linux/dma-buf.h:21,
                 from ./include/linux/nvmap.h:28,
                 from drivers/video/tegra/nvmap/nvmap_heap.c:36:
./include/linux/dma-mapping.h:127:7: note: declared here
  127 | void *dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
      |       ^~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_dev.c:221:17: error: implicit declaration of function ‘unmap_kernel_range’ [-Werror=implicit-function-declaration]
  221 |                 unmap_kernel_range(kaddr, PAGE_SIZE);
      |                 ^~~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_dev.c: In function ‘nvmap_open’:
drivers/video/tegra/nvmap/nvmap_dev.c:457:24: error: ‘struct address_space’ has no member named ‘backing_dev_info’
  457 |         filp->f_mapping->backing_dev_info = &nvmap_bdi;
      |                        ^~
drivers/video/tegra/nvmap/nvmap_dev.c: In function ‘nvmap_ioctl’:
drivers/video/tegra/nvmap/nvmap_dev.c:517:68: error: macro "access_ok" passed 3 arguments, but takes just 2
  517 |                 err = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
      |                                                                    ^
In file included from ./arch/arm/include/asm/uaccess.h:234,
                 from ./include/linux/uaccess.h:11,
                 from ./include/linux/sched/task.h:11,
                 from ./include/linux/sched/signal.h:9,
                 from ./include/linux/rcuwait.h:6,
                 from ./include/linux/percpu-rwsem.h:7,
                 from ./include/linux/fs.h:33:
./include/asm-generic/access_ok.h:45: note: macro "access_ok" defined here
   45 | #define access_ok(addr, size) likely(__access_ok(addr, size))
      | 
drivers/video/tegra/nvmap/nvmap_dev.c:517:24: error: ‘access_ok’ undeclared (first use in this function)
  517 |                 err = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
      |                        ^~~~~~~~~
drivers/video/tegra/nvmap/nvmap_dev.c:517:24: note: each undeclared identifier is reported only once for each function it appears in
drivers/video/tegra/nvmap/nvmap_dev.c:519:67: error: macro "access_ok" passed 3 arguments, but takes just 2
  519 |                 err = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
      |                                                                   ^
./include/asm-generic/access_ok.h:45: note: macro "access_ok" defined here
   45 | #define access_ok(addr, size) likely(__access_ok(addr, size))
      | 
drivers/video/tegra/nvmap/nvmap_heap.c: In function ‘nvmap_free_mem’:
drivers/video/tegra/nvmap/nvmap_heap.c:119:17: error: ‘DEFINE_DMA_ATTRS’ undeclared (first use in this function)
  119 |         attr |= DEFINE_DMA_ATTRS;
      |                 ^~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:121:23: error: redeclaration of ‘attr’ with no linkage
  121 |         unsigned long attr;
      |                       ^~~~
drivers/video/tegra/nvmap/nvmap_heap.c:118:23: note: previous declaration of ‘attr’ with type ‘long unsigned int’
  118 |         unsigned long attr;
      |                       ^~~~
drivers/video/tegra/nvmap/nvmap_heap.c:121:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  121 |         unsigned long attr;
      |         ^~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘gk20a_init_client’:
drivers/gpu/nvgpu/gk20a/gk20a.c:739:9: error: implicit declaration of function ‘gk20a_pm_finalize_poweron’ [-Werror=implicit-function-declaration]
  739 |         gk20a_pm_finalize_poweron(&dev->dev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘nvhost_channel_suspend’:
drivers/gpu/nvgpu/gk20a/gk20a.c:751:13: error: invalid storage class for function ‘gk20a_deinit_client’
  751 | static void gk20a_deinit_client(struct platform_device *dev)
      |             ^~~~~~~~~~~~~~~~~~~
drivers/video/tegra/camera/camera.c: In function ‘tegra_camera_unregister’:
drivers/video/tegra/camera/camera.c:405:13: error: void value not ignored as it ought to be
  405 |         ret = misc_deregister(&camera->misc_dev);
      |             ^
make[5]: *** [scripts/Makefile.build:250: drivers/video/tegra/camera/camera.o] Error 1
make[5]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:250: drivers/video/tegra/nvmap/nvmap_dev.o] Error 1
make[5]: *** Waiting for unfinished jobs....
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘gk20a_deinit_client’:
drivers/gpu/nvgpu/gk20a/gk20a.c:755:9: error: implicit declaration of function ‘gk20a_pm_prepare_poweroff’ [-Werror=implicit-function-declaration]
  755 |         gk20a_pm_prepare_poweroff(&dev->dev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘nvhost_channel_suspend’:
drivers/video/tegra/nvmap/nvmap_heap.c:122:17: error: ‘DMA_ATTR_ALLOC_EXACT_SIZE’ undeclared (first use in this function)
  122 |         attr |= DMA_ATTR_ALLOC_EXACT_SIZE;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:782:12: error: invalid storage class for function ‘gk20a_pm_prepare_poweroff’
  782 | static int gk20a_pm_prepare_poweroff(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:820:13: error: invalid storage class for function ‘gk20a_detect_chip’
  820 | static void gk20a_detect_chip(struct gk20a *g)
      |             ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:838:12: error: invalid storage class for function ‘gk20a_pm_finalize_poweron’
  838 | static int gk20a_pm_finalize_poweron(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:126:61: error: ‘attrs’ undeclared (first use in this function); did you mean ‘attr’?
  126 |                 (void *)(uintptr_t)base, (dma_addr_t)base, &attrs);
      |                                                             ^~~~~
      |                                                             attr
drivers/gpu/nvgpu/gk20a/gk20a.c:1021:26: error: initializer element is not constant
 1021 |         .get_max_state = tegra_gpu_get_max_state,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1021:26: note: (near initialization for ‘tegra_gpu_cooling_ops.get_max_state’)
drivers/gpu/nvgpu/gk20a/gk20a.c:1022:26: error: initializer element is not constant
 1022 |         .get_cur_state = tegra_gpu_get_cur_state,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1022:26: note: (near initialization for ‘tegra_gpu_cooling_ops.get_cur_state’)
drivers/gpu/nvgpu/gk20a/gk20a.c:1023:26: error: initializer element is not constant
 1023 |         .set_cur_state = tegra_gpu_set_cur_state,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1023:26: note: (near initialization for ‘tegra_gpu_cooling_ops.set_cur_state’)
drivers/gpu/nvgpu/gk20a/gk20a.c:1026:12: error: invalid storage class for function ‘gk20a_create_device’
 1026 | static int gk20a_create_device(
      |            ^~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1064:13: error: invalid storage class for function ‘gk20a_user_deinit’
 1064 | static void gk20a_user_deinit(struct platform_device *dev)
      |             ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1100:12: error: invalid storage class for function ‘gk20a_user_init’
 1100 | static int gk20a_user_init(struct platform_device *dev)
      |            ^~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1175:12: error: invalid storage class for function ‘gk20a_pm_enable_clk’
 1175 | static int gk20a_pm_enable_clk(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1193:12: error: invalid storage class for function ‘gk20a_pm_disable_clk’
 1193 | static int gk20a_pm_disable_clk(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1208:13: error: invalid storage class for function ‘gk20a_pm_shutdown’
 1208 | static void gk20a_pm_shutdown(struct platform_device *pdev)
      |             ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1223:12: error: invalid storage class for function ‘gk20a_pm_railgate’
 1223 | static int gk20a_pm_railgate(struct generic_pm_domain *domain)
      |            ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1235:12: error: invalid storage class for function ‘gk20a_pm_unrailgate’
 1235 | static int gk20a_pm_unrailgate(struct generic_pm_domain *domain)
      |            ^~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1250:12: error: invalid storage class for function ‘gk20a_pm_suspend’
 1250 | static int gk20a_pm_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1268:12: error: invalid storage class for function ‘gk20a_pm_resume’
 1268 | static int gk20a_pm_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1273:12: error: invalid storage class for function ‘gk20a_pm_initialise_domain’
 1273 | static int gk20a_pm_initialise_domain(struct platform_device *pdev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘gk20a_pm_initialise_domain’:
drivers/gpu/nvgpu/gk20a/gk20a.c:1291:24: error: ‘struct gpd_dev_ops’ has no member named ‘save_state’
 1291 |         domain->dev_ops.save_state = gk20a_pm_prepare_poweroff;
      |                        ^
drivers/gpu/nvgpu/gk20a/gk20a.c:1292:24: error: ‘struct gpd_dev_ops’ has no member named ‘restore_state’
 1292 |         domain->dev_ops.restore_state = gk20a_pm_finalize_poweron;
      |                        ^
drivers/gpu/nvgpu/gk20a/gk20a.c:1293:24: error: ‘struct gpd_dev_ops’ has no member named ‘suspend’
 1293 |         domain->dev_ops.suspend = gk20a_pm_suspend;
      |                        ^
drivers/gpu/nvgpu/gk20a/gk20a.c:1294:24: error: ‘struct gpd_dev_ops’ has no member named ‘resume’
 1294 |         domain->dev_ops.resume = gk20a_pm_resume;
      |                        ^
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘nvhost_channel_suspend’:
drivers/gpu/nvgpu/gk20a/gk20a.c:1305:12: error: invalid storage class for function ‘gk20a_pm_init’
 1305 | static int gk20a_pm_init(struct platform_device *dev)
      |            ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1354:12: error: invalid storage class for function ‘gk20a_probe’
 1354 | static int gk20a_probe(struct platform_device *dev)
      |            ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘gk20a_probe’:
drivers/gpu/nvgpu/gk20a/gk20a.c:1494:34: error: passing argument 4 of ‘debugfs_create_bool’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1494 |                                  &gk20a->mm.ltc_enabled_debug);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  u32 * {aka unsigned int *}
In file included from drivers/gpu/nvgpu/gk20a/gk20a.c:41:
./include/linux/debugfs.h:140:32: note: expected ‘bool *’ {aka ‘_Bool *’} but argument is of type ‘u32 *’ {aka ‘unsigned int *’}
  140 |                          bool *value);
      |                          ~~~~~~^~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1491:36: error: void value not ignored as it ought to be
 1491 |         gk20a->debugfs_ltc_enabled =
      |                                    ^
drivers/gpu/nvgpu/gk20a/gk20a.c:1496:48: error: void value not ignored as it ought to be
 1496 |         gk20a->debugfs_gr_idle_timeout_default =
      |                                                ^
drivers/gpu/nvgpu/gk20a/gk20a.c:1500:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 1500 |         bool timeouts_enabled_bool = gk20a->timeouts_enabled != 0;
      |         ^~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1501:41: error: void value not ignored as it ought to be
 1501 |         gk20a->debugfs_timeouts_enabled =
      |                                         ^
drivers/gpu/nvgpu/gk20a/gk20a.c: In function ‘nvhost_channel_suspend’:
drivers/gpu/nvgpu/gk20a/gk20a.c:1515:19: error: invalid storage class for function ‘gk20a_remove’
 1515 | static int __exit gk20a_remove(struct platform_device *dev)
      |                   ^~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1550:18: error: initializer element is not constant
 1550 |         .probe = gk20a_probe,
      |                  ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1550:18: note: (near initialization for ‘gk20a_driver.probe’)
In file included from ./include/linux/device.h:15,
                 from ./include/linux/miscdevice.h:7,
                 from drivers/video/tegra/camera/camera_priv_defs.h:20,
                 from drivers/video/tegra/camera/camera_clk.h:19,
                 from drivers/video/tegra/camera/camera_clk.c:18:
drivers/video/tegra/camera/camera_clk.c: In function ‘tegra_camera_clk_set_rate’:
drivers/gpu/nvgpu/gk20a/gk20a.c:1552:21: error: initializer element is not constant
 1552 |         .shutdown = gk20a_pm_shutdown,
      |                     ^~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1552:21: note: (near initialization for ‘gk20a_driver.shutdown’)
drivers/video/tegra/camera/camera_clk.c:165:30: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint’ {aka ‘unsigned int’} [-Wformat=]
  165 |         dev_dbg(camera->dev, "%s: clk_id=%d, parent_rate=%lu, clk_rate=%lu\n",
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:129:41: note: in definition of macro ‘dev_printk’
  129 |                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
      |                                         ^~~
./include/linux/dev_printk.h:163:45: note: in expansion of macro ‘dev_fmt’
  163 |                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
      |                                             ^~~~~~~
drivers/video/tegra/camera/camera_clk.c:165:9: note: in expansion of macro ‘dev_dbg’
  165 |         dev_dbg(camera->dev, "%s: clk_id=%d, parent_rate=%lu, clk_rate=%lu\n",
      |         ^~~~~~~
drivers/video/tegra/camera/camera_clk.c:165:74: note: format string is defined here
  165 |         dev_dbg(camera->dev, "%s: clk_id=%d, parent_rate=%lu, clk_rate=%lu\n",
      |                                                                        ~~^
      |                                                                          |
      |                                                                          long unsigned int
      |                                                                        %u
drivers/gpu/nvgpu/gk20a/gk20a.c:1560:23: error: initializer element is not constant
 1560 |                 .pm = &gk20a_pm_ops,
      |                       ^
drivers/gpu/nvgpu/gk20a/gk20a.c:1560:23: note: (near initialization for ‘gk20a_driver.driver.pm’)
drivers/gpu/nvgpu/gk20a/gk20a.c:1565:19: error: invalid storage class for function ‘gk20a_init’
 1565 | static int __init gk20a_init(void)
      |                   ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1570:20: error: invalid storage class for function ‘gk20a_exit’
 1570 | static void __exit gk20a_exit(void)
      |                    ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1765:1: error: invalid storage class for function ‘do_request_firmware’
 1765 | do_request_firmware(struct device *dev, const char *prefix, const char *fw_name)
      | ^~~~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c: In function ‘nvmap_heap_create’:
drivers/video/tegra/nvmap/nvmap_heap.c:249:9: error: implicit declaration of function ‘DEFINE_DMA_ATTRS’ [-Werror=implicit-function-declaration]
  249 |         DEFINE_DMA_ATTRS(attrs);
      |         ^~~~~~~~~~~~~~~~
In file included from ./include/linux/printk.h:6,
                 from ./include/asm-generic/bug.h:22,
                 from ./arch/arm/include/asm/bug.h:60:
drivers/gpu/nvgpu/gk20a/gk20a.c:1822:13: error: initializer element is not constant
 1822 | module_init(gk20a_init);
      |             ^~~~~~~~~~
./include/linux/init.h:250:55: note: in definition of macro ‘____define_initcall’
  250 |                 __attribute__((__section__(__sec))) = fn;
      |                                                       ^~
./include/linux/init.h:260:9: note: in expansion of macro ‘__unique_initcall’
  260 |         __unique_initcall(fn, id, __sec, __initcall_id(fn))
      |         ^~~~~~~~~~~~~~~~~
./include/linux/init.h:262:35: note: in expansion of macro ‘___define_initcall’
  262 | #define __define_initcall(fn, id) ___define_initcall(fn, id, .initcall##id)
      |                                   ^~~~~~~~~~~~~~~~~~
./include/linux/init.h:291:41: note: in expansion of macro ‘__define_initcall’
  291 | #define device_initcall(fn)             __define_initcall(fn, 6)
      |                                         ^~~~~~~~~~~~~~~~~
./include/linux/init.h:296:24: note: in expansion of macro ‘device_initcall’
  296 | #define __initcall(fn) device_initcall(fn)
      |                        ^~~~~~~~~~~~~~~
./include/linux/module.h:87:25: note: in expansion of macro ‘__initcall’
   87 | #define module_init(x)  __initcall(x);
      |                         ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1822:1: note: in expansion of macro ‘module_init’
 1822 | module_init(gk20a_init);
      | ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1823:13: error: initializer element is not constant
 1823 | module_exit(gk20a_exit);
      |             ^~~~~~~~~~
./include/linux/init.h:299:57: note: in definition of macro ‘__exitcall’
  299 |         static exitcall_t __exitcall_##fn __exit_call = fn
      |                                                         ^~
drivers/gpu/nvgpu/gk20a/gk20a.c:1823:1: note: in expansion of macro ‘module_exit’
 1823 | module_exit(gk20a_exit);
      | ^~~~~~~~~~~
./include/linux/init.h:299:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  299 |         static exitcall_t __exitcall_##fn __exit_call = fn
      |         ^~~~~~
./include/linux/module.h:99:25: note: in expansion of macro ‘__exitcall’
   99 | #define module_exit(x)  __exitcall(x);
      |                         ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1823:1: note: in expansion of macro ‘module_exit’
 1823 | module_exit(gk20a_exit);
      | ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1823:1: error: expected declaration or statement at end of input
drivers/video/tegra/camera/camera_clk.c:195:33: error: implicit declaration of function ‘IO_ADDRESS’ [-Werror=implicit-function-declaration]
  195 |                                 IO_ADDRESS(TEGRA_APB_MISC_BASE);
      |                                 ^~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:249:26: error: ‘attrs’ undeclared (first use in this function)
  249 |         DEFINE_DMA_ATTRS(attrs);
      |                          ^~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:259:45: error: storage size of ‘stats’ isn’t known
  259 |                 struct dma_contiguous_stats stats;
      |                                             ^~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c: At top level:
drivers/gpu/nvgpu/gk20a/gk20a.c:1794:1: error: ‘gk20a_request_firmware’ defined but not used [-Werror=unused-function]
 1794 | gk20a_request_firmware(struct gk20a *g, const char *fw_name)
      | ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1744:5: error: ‘gk20a_init_gpu_characteristics’ defined but not used [-Werror=unused-function]
 1744 | int gk20a_init_gpu_characteristics(struct gk20a *g)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1729:5: error: ‘gk20a_do_unidle’ defined but not used [-Werror=unused-function]
 1729 | int gk20a_do_unidle(void)
      |     ^~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1657:5: error: ‘gk20a_do_idle’ defined but not used [-Werror=unused-function]
 1657 | int gk20a_do_idle(void)
      |     ^~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1645:6: error: ‘gk20a_reset’ defined but not used [-Werror=unused-function]
 1645 | void gk20a_reset(struct gk20a *g, u32 units)
      |      ^~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1604:6: error: ‘gk20a_idle’ defined but not used [-Werror=unused-function]
 1604 | void gk20a_idle(struct platform_device *pdev)
      |      ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1585:5: error: ‘gk20a_busy’ defined but not used [-Werror=unused-function]
 1585 | int gk20a_busy(struct platform_device *pdev)
      |     ^~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1580:6: error: ‘gk20a_busy_noresume’ defined but not used [-Werror=unused-function]
 1580 | void gk20a_busy_noresume(struct platform_device *pdev)
      |      ^~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1575:6: error: ‘is_gk20a_module’ defined but not used [-Werror=unused-function]
 1575 | bool is_gk20a_module(struct platform_device *dev)
      |      ^~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:1158:23: error: ‘gk20a_get_channel_from_file’ defined but not used [-Werror=unused-function]
 1158 | struct channel_gk20a *gk20a_get_channel_from_file(int fd)
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:772:6: error: ‘gk20a_put_client’ defined but not used [-Werror=unused-function]
  772 | void gk20a_put_client(struct gk20a *g)
      |      ^~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:759:5: error: ‘gk20a_get_client’ defined but not used [-Werror=unused-function]
  759 | int gk20a_get_client(struct gk20a *g)
      |     ^~~~~~~~~~~~~~~~
drivers/gpu/nvgpu/gk20a/gk20a.c:497:5: error: ‘gk20a_sim_esc_read’ defined but not used [-Werror=unused-function]
  497 | int gk20a_sim_esc_read(struct gk20a *g, char *path, u32 index, u32 count, u32 *data)
      |     ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
drivers/video/tegra/camera/camera_clk.c:195:44: error: ‘TEGRA_APB_MISC_BASE’ undeclared (first use in this function)
  195 |                                 IO_ADDRESS(TEGRA_APB_MISC_BASE);
      |                                            ^~~~~~~~~~~~~~~~~~~
drivers/video/tegra/camera/camera_clk.c:195:44: note: each undeclared identifier is reported only once for each function it appears in
make[4]: *** [scripts/Makefile.build:250: drivers/gpu/nvgpu/gk20a/gk20a.o] Error 1
make[3]: *** [scripts/Makefile.build:500: drivers/gpu/nvgpu/gk20a] Error 2
make[2]: *** [scripts/Makefile.build:500: drivers/gpu] Error 2
make[2]: *** Waiting for unfinished jobs....
drivers/video/tegra/nvmap/nvmap_heap.c:261:17: error: implicit declaration of function ‘dma_get_contiguous_stats’ [-Werror=implicit-function-declaration]
  261 |                 dma_get_contiguous_stats(co->cma_dev, &stats);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:259:45: error: unused variable ‘stats’ [-Werror=unused-variable]
  259 |                 struct dma_contiguous_stats stats;
      |                                             ^~~~~
drivers/video/tegra/camera/camera_clk.c:211:25: error: implicit declaration of function ‘tegra_clk_cfg_ex’ [-Werror=implicit-function-declaration]
  211 |                         tegra_clk_cfg_ex(clk, TEGRA_CLK_VI_INP_SEL, 2);
      |                         ^~~~~~~~~~~~~~~~
  CC [M]  drivers/power/supply/smb347-charger.o
  CC [M]  drivers/power/supply/acer_a500_battery.o
drivers/video/tegra/nvmap/nvmap_heap.c:283:33: error: ‘DMA_MEMORY_NOMAP’ undeclared (first use in this function)
  283 |                                 DMA_MEMORY_NOMAP);
      |                                 ^~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:282:23: error: too many arguments to function ‘dma_declare_coherent_memory’
  282 |                 err = dma_declare_coherent_memory(h->dma_dev, 0, base, len,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/video/tegra/nvmap/nvmap_heap.c:38:
./include/linux/dma-map-ops.h:178:5: note: declared here
  178 | int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/video/tegra/nvmap/nvmap_heap.c:306:9: error: ‘buf’ undeclared (first use in this function)
  306 |         buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC;
      |         ^~~
drivers/video/tegra/nvmap/nvmap_heap.c:306:21: error: left-hand operand of comma expression has no effect [-Werror=unused-value]
  306 |         buf->dma_dir, DMA_ATTR_SKIP_CPU_SYNC;
      |                     ^
drivers/video/tegra/nvmap/nvmap_heap.c:306:21: error: statement with no effect [-Werror=unused-value]
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:250: drivers/video/tegra/nvmap/nvmap_heap.o] Error 1
make[4]: *** [scripts/Makefile.build:500: drivers/video/tegra/nvmap] Error 2
make[4]: *** Waiting for unfinished jobs....
drivers/video/tegra/camera/camera_clk.c:211:47: error: ‘TEGRA_CLK_VI_INP_SEL’ undeclared (first use in this function)
  211 |                         tegra_clk_cfg_ex(clk, TEGRA_CLK_VI_INP_SEL, 2);
      |                                               ^~~~~~~~~~~~~~~~~~~~
drivers/video/tegra/camera/camera_clk.c:227:30: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint’ {aka ‘unsigned int’} [-Wformat=]
  227 |         dev_dbg(camera->dev, "%s: get_rate=%lu",
      |                              ^~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:129:41: note: in definition of macro ‘dev_printk’
  129 |                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
      |                                         ^~~
./include/linux/dev_printk.h:163:45: note: in expansion of macro ‘dev_fmt’
  163 |                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
      |                                             ^~~~~~~
drivers/video/tegra/camera/camera_clk.c:227:9: note: in expansion of macro ‘dev_dbg’
  227 |         dev_dbg(camera->dev, "%s: get_rate=%lu",
      |         ^~~~~~~
drivers/video/tegra/camera/camera_clk.c:227:46: note: format string is defined here
  227 |         dev_dbg(camera->dev, "%s: get_rate=%lu",
      |                                            ~~^
      |                                              |
      |                                              long unsigned int
      |                                            %u
cc1: some warnings being treated as errors

Are a result of massive changes made in the kernel overtime, as expected.

You can think of the ABI that drivers plug in to as a combination of the API and what the compiler did to make a place to plug that content in to. So it is necessary to use the release which was published for that specific Xorg X server. The ABI will be unique to that X release, the features enabled on it (ever tried to compile X? config and details to succeed are pretty high up on the scale), and perhaps even the compiler used to build the server. If GPU acceleration works though, there is no need to use anything not used already (you wouldn’t need to fix what isn’t broken). Testing CUDA would be interesting; if the X server uses the GPU, then there is a chance CUDA will also work. The main problem with a newer Ubuntu release is that the X server tends to have a new ABI, and that would mean going to the old X server, which in turn breaks a lot of the new Ubuntu packages.

Software renders, such as Mesa or Nouveau, would not generally give you hardware acceleration. Even if you have a version of this advertised as such, they are probably intended for discrete GPUs (dGPU) rather than integrated GPUs (iGPU). Most of the software you see out there for ARM is intended for dGPU, and there may not be enough public information for an iGPU driver. The interfacing to a PCIe system is more or less standardized, and you can probably treat some of the dGPU as a “black box” if you follow some standards. That definitely is not true for the interface of a Jetson’s iGPU. If it does become public at some point, it won’t be for the deprecated 32-bit TK1.

Yes, I’ve noticed some sym link changes as well that are a bit funky. I think sym links are ok, but there are places where I’m a bit concerned about multiple files that have multiple hard links. This is quite unusual, and IMHO, wrong. Two libraries which are the same file, and changing one changes the other, even if renaming the file; but there is no indication that anyone would have that this ever occurred. I expect directories to have multiple links. Sym links don’t act as multiple hard links. The only way to find all of the links is to find the inode once you know there are multiple hard links. It’s insane to try and save disk space or package complexity using multiple hard links to a regular file. Some day cd to “/lib” and run these commands as root (be careful to actually cd there…sometimes the answer changes due to crossing filesystem boundaries):

cd /lib
sudo find . -type f -links 2
sudo find . -type f -links 3

Then run “ls -l” on each file you see. Try to figure out what would happen if you created a package to update that file. 😈 Multiple hard links to a regular file are dangerous. Symlinks are easy to deal with. Just make sure you cd to wherever you are going to test from before you run the find command with the -links.

nvgpu is open source for 64-bit on the current GPUs. The Kepler GPU of the TK1 is not. If you have sufficient information on the internals of Kepler, then perhaps you could rewrite the 64-bit ARMv8-a instruction set version to run on 32-bit ARMv7-a. It isn’t as simple as recompiling, there would be a lot of hardware-dependent code, e.g., assumptions about register size and memory alignment. Even the max size of a direct branch instruction will be quite different, so if the instruction were the same on both, it might fail running the same direct branch on the TK1 (where you end up branching with an overflow on the register is unpredictable…but if the offset fit within the register, it would work).

Out-of-tree content also changes a lot. The SoC (I consider this “system on a chip”; if all is on a single board, I consider that “single board computer”, SBC) itself has some of what the out-of-tree content looks at, but so does any carrier board. The TK1 was a SoC+SBC, not just a system on a chip…the carrier board was not separable for TK1 Jetsons. The PC board content surrounding this is responsible for part of that content based on the components, and the tablet will differ from the Jetson. It is true though that things like temperature sensors and a large part of what is on the SoC to be the same. However, if you look at the 5.x kernels of newer releases on 64-bit Jetsons, some of the code is for particular modules, and some for carrier boards. You have to be careful in the case of what is on the SoC versus what is on the surrounding circuit boards for out-of-tree content; the ChromeBook will differ from the Jetson for parts not in the SoC.

L4T R24.x was not for the TK1. It has a fascinating connection though. TK1 was the last generation of a long generation of 32-bit NVIDIA SoCs. It was also the first generation with a GPU (I have a Tegra 3 dev board here, it doesn’t have a GPU; there was also a Tegra 4 which did not have a GPU). All of this was ARMv7-a instruction set, and 32-bit. When ARMv8-a came out it was a superset of ARMv7-a, plus ARMv8-a. ARMv8-a has a compatibility mode which has 100% of the ARMv7-a if you add all possible options, e.g., NEON was optional, not all ARMv7-a had this, but the ARMv8-a compatibility assumes things like NEON are present. In that mode the 64-bit CPUs run as though they are 32-bit ARMv7-a, but they also have instructions for switching back to ARMv8-a (don’t get too excited…the libraries and software to make switching useful is complicated). TK1 was the last of the ARMv7-a.

ARMv8-a never existed up to that point. Enter the TX1 (which is what a Nano is, just a different form factor; Orin Nano is a whole new beast on steroids). No libraries or code existed anywhere in the world for 64-bit ARM. 64-bit ARM was 100% new and original. However, due to the compatibility mode, it wasn’t necessary to port everything to 64-bit at once. L4T R24.x was that generation of a hybrid in the process of migrating to 64-bit ARM. The bootloader itself remained ARMv7-a 32-bit code (a compressed zImage was used in 32-bit…this had to switch to uncompressed Image instead for 64-bit because of this). Once it reached Linux, 64-bit was enabled in the kernel, but not in the user space. In fact there was one function in the kernel that was still 32-bit and used compatibility mode, so building the kernel required two compileers: One for 32-bit, and one for 64-bit.

In later L4T R24.x, I think eventually that one function in the kernel that was in compatibility mode turned into 64-bit, but maybe that was the first R27.x release. It was R27.x when both user space and kernel space first combined all in 64-bit ARMv8-a. Only parts of L4T R24.x (small parts, e.g., the user space) would work on a TK1. I would almost say that the user space for R24.x would be useful on the TK1, except that the GPU on the TX1 was Maxwell, not Kepler, and the X server and driver are not compatible with the Kepler GPU of the TK1.

R24.x and R27.x weren’t very good, R28.x was a nice release. R24.x and R27.x were new testing ground, while R28.x was a refinement.

So far as Wayland goes, consider that some of the older CUDA actually proxies through the X server. CUDA does not always talk directly to the GPU. I’m pretty sure that was “more true” in the TK1. There are a lot of cases where Wayland is a compatibility layer on top of X, so user space software would work, but eliminating X and going entirely to Wayland might differ quite a bit if you try to do this on something that is Wayland on top of X. I think much of this is similar to the 32-bit/64-bit story: There is a transition period where it isn’t pure X, nor pure Wayland. Porting from Wayland over X would be different than porting from pure X to pure Wayland. I think libraries would work fine for Wayland regardless of whether it is pure Wayland or Wayland over X. User space isn’t the problem, and CUDA libraries are special because they are not truly user space (they depend on the hardware and the drivers; I could be wrong, but I don’t believe that the CUDA libraries are 100% hardware independent, unlike many other libraries which just get recompiled on new architectures and work).

The situation surrounding using old Xorg packages and dependency conflicts is the reason why I’ve patched many of them and relating packages to prevent dependency conflicts. I had to fix a few to stop breakage when installing “ubuntu-mate-desktop^”—the way I’ve just referred to it, it makes it a “job” for apt. It’s really not even hard to fix, it’s version number spoofing, that’s how I got Ubuntu Mate Jammy + older Xorg running flawlessly relatively quickly.

It seems like several packages don’t care exactly what the version is for some of the Xorg packages. I’m only patching debs with spoofed version numbers and creating dummy packages as needed and so far has it been proven to be pretty successful. Believe it or not, I got full on Java Minecraft running on it and with some performance mods and settings tweaking, it’s actually very smooth performance-wise. I was expecting some pretty lackluster performance.

It looks like Xorg 15 (from Trusty) and Xorg 18 (from Xenial) either use the same ABI, have ABIs that barely differ, or some combination. I did not get an ABI mismatch error from the NVIDIA driver whatsoever.

I should also note that the “nvgpu” driver appears to be fully open source for the TK1. I’ve been browsing through the code and I have yet to see anything obfuscated or not hard to work with. In fact, I think I’m getting somewhat close to a working NVIDIA GK20A kernel space driver. It doesn’t seem like the absolute worst in the world. The real question is that will it work.

Also, about Wayland, it’s a bit of a strange situation, L4T 24 should be for aarch64 only yet it appears it exists for the armv7h Tegra K1. In ChromeOS, “chrome://gpu” reads it as L4T 24. In fact, there’s at least one or more “.so” files that identify it as L4T 24. Either it’s just versioned weirdly or some version of L4T was released privately for Google to use. This would be unsurprising, Mali did the same thing as well. They had r28 Midgard userspace in ChromeOS but no known r28 userspace is publicly available by any other means besides the ChromeOS installation. Mali did release their kernel space drivers for r28, but not for their user space, not even to Odroid. The ChromeBook models Peach Pit and Peach Pi when running the last ChromeOS release for them has the non-publicly-available r28 userspace libraries. That’s the only known form of “regular enough” Linux that has those userspace libraries, maybe it’s mostly used in Android. Are there any examples of getting Wayland environments working such as Weston, Gnome, etc? I know it might need EGLStream-specific things set? Maybe? I have yet to see anyone getting NVIDIA blobs + Tegra K1 + Wayland working yet.

Well, several months later did I get decently far with the driver porting process. I’ve come to a point though where my limited knowledge in C and Linux kernel development in general is preventing me from progressing. I believe I ended up getting a decent chunk of the Tegra K1 GPU kernel module ported to 4.4 SLTS by Civil Infrastructure Platform though. Had that been successful, I would have continued porting it to newer kernel releases until I got to something still updated like 6.1 LTS or 6.6 LTS. Nouveau is still broken unsurprisingly rather unfortunately (it looks like it always has been too). I wouldn’t be surprised if support for the Tegra K1 GPU gets dropped in Nouveau as both kernel space and user space are both extremely and severely broken paired with the lack of interest in fixing it.

I think the best that can be done at this point without porting the Tegra K1 GPU kernel module is to make the kernel slightly(?) safer to use. This could mean upstreaming the ChromeOS (or regular L4T) kernel to the last 3.10 LTS release, hardening the kernel, add CentOS backported security fixes (if the source is available), as well as to use the DivestOS CVE checker tool to get extra CVE patches (https://github.com/Divested-Mobile/CVE_Checker)

As far as Xorg goes, on Ubuntu Xenial 16.04, the Xorg 18.0.4 build that is in the ESM repos seems to still get SOME CVE patches or at least it did. I fired up an Ubuntu Xenial virtual machine and registered Ubuntu Pro on it so I could get the source for Xorg 18.0.4 along with the latest CVE patches. One or more of the patches has a date including the year 2024 from what it looks like. I took a look at the backported CVE patches, and though Ubuntu Xenial 16.04 ESM doesn’t support 32-bit ARM neither 64-bit ARM, the source looks like it can be compiled on 32-bit ARM just fine. I’m not an expert at bisecting and debugging software but I’m sure someone could develop a patch to get the old L4T blobs working with newer Xorg build, but it probably would require a lot of hacks due to ABI differences.

Wayland isn’t happening so long as Nouveau is broken on the Tegra K1 GPU or without LibHybris and Android blobs. Google made it work by using some kind of GBM emulator of some kind or something similar it looks like. LibHybris would be the only way to run a Wayland desktop environment so long as the desktop environment supports using the ‘hwcomposer’ backend. I tried to build LineageOS from source for the NVIDIA SHIELD K1 but it looks like it’s broken and nobody has bothered to fix it. I’m not even sure how to use LibHybris anyways.