Cuda not working with custom rootfs

I am trying to create a custom rootfs based off the ubuntu 16.04 arm64 base image. I extract the tarball to the rootfs folder, chroot to install network-manager and openssh-server, and then run apply_binaries.sh before flashing. After installing cuda on the device, running the deviceQuery sample always returns a device count of 0. Am I missing any steps here?

There is probably more than one issue, but the GPU driver is tied to the Xorg ABI version. On R27.1 in the “/var/log/xorg.0.log” file you will see something like this:

[    17.992] (II) Module ABI versions:
[    17.992]    X.Org ANSI C Emulation: 0.4
[    17.992]    <b>X.Org Video Driver: 20.0</b>
[    17.992]    X.Org XInput driver : 22.1
[    17.992]    X.Org Server Extension : 9.0

For each extension ABI in the ABI versions any item not matching the ABI will fail, e.g., XInput being incorrect will cause mouse and keyboard to fail. I suspect that at least in part your Video Driver ABI is not 20.0. Someone will need to verify if this is correct since some things have changed when going from kernel 3.x series to kernel 4.x series, but I do not think this has changed.