"unable to allocate CUDA0 buffer" after Updating Ubuntu Packages

Hi, @all

We have fixed this issue. Internal review and testing are also done.
But the fix includes an upstream patch that needs extra reviewing, so it needs some time to release the solution.

Currently, you can get the fix via building a custom kernel with the following instructions.
Please note that the upstreaming patch (a94ca4c.diff.zip) might change during the upstream review process.


Download source

  1. public_sources.tbz2
    https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v4.4/sources/public_sources.tbz2

  2. toolchain
    https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v3.0/toolchain/aarch64--glibc--stable-2022.08-1.tar.bz2

  3. Changes: (please unzip the files to *.diff files)
    7959247.diff.zip (1.7 KB)
    a94ca4c.diff.zip (1.2 KB)
    b27a1a7.diff.zip (1.5 KB)
    cfe6242.diff.zip (3.3 KB)
    e488812.diff.zip (2.0 KB)

Unpack source

$ tar xf public_sources.tbz2 
$ tar xf aarch64--glibc--stable-2022.08-1.tar.bz2 
$ cd Linux_for_Tegra/source/
$ tar xf kernel_src.tbz2
$ tar xf kernel_oot_modules_src.tbz2
$ tar xf nvidia_kernel_display_driver_source.tbz2

Apply changes

$ cd Linux_for_Tegra/source/kernel/kernel-jammy-src/
$ patch -p1 < [/path/to/a94ca4c.diff]
$ cd ../nvidia-oot/
$ patch -p1 < [/path/to/cfe6242.diff]
$ patch -p1 < [/path/to/e488812.diff]
$ patch -p1 < [/path/to/b27a1a7.diff]
$ patch -p1 < [/path/to/7959247.diff]

Build kernel

$ cd ../ # back to Linux_for_Tegra/source/ folder
$ export CROSS_COMPILE=$PWD/../../aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
$ make -C kernel
...
================================================================================
Kernel Image: [path/to/Linux_for_Tegra/source/kernel/kernel-jammy-src/arch/arm64/boot/Image]
Kernel sources compiled successfully.
================================================================================
$ export INSTALL_MOD_PATH=<install-path>/Linux_for_Tegra/rootfs/
$ sudo -E make install -C kernel
$ cp kernel/kernel-jammy-src/arch/arm64/boot/Image <install-path>/Linux_for_Tegra/kernel/Image

Build nv-oot

$ export CROSS_COMPILE=$PWD/../../aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
$ export KERNEL_HEADERS=$PWD/kernel/kernel-jammy-src
$ make modules
================================================================================
Display driver compiled successfully.
================================================================================
$ export INSTALL_MOD_PATH=<install-path>/Linux_for_Tegra/rootfs/
$ sudo -E make modules_install
$ cd <install-path>/Linux_for_Tegra
$ sudo ./tools/l4t_update_initrd.sh

Flash

Please follow the document below to flash the system:


After flashing the device with the custom kernel, please mark hold the kernel to prevent it from being overwritten by the r36.4.7.

$ sudo apt-mark hold nvidia-l4t-display-kernel nvidia-l4t-kernel nvidia-l4t-kernel-dtbs nvidia-l4t-kernel-headers nvidia-l4t-kernel-oot-headers nvidia-l4t-kernel-oot-modules 

Once the official release is ready, you can unhold these packages to get the fix without reflashing.

Thanks.