The supported kernels documentation states compatibility Up to 5.10.230-223.885.amzn2.x86_64 on Amazon Linux 2 distros. AL2 defaults to using a 5.10 kernel, but aside from trial and error I can’t find a good way to identify compatibility. Am I missing something obvious?
You are right, Amazon Linux 2 (AL2) defaults to a 5.10 kernel series, however, determining which kernels will work with a specific piece of software (e.g. drivers, eBPF tools, etc.) is not straightforward. Even the documentation that states compatibility with the kernel version of 5.10.230-223.885.amzn2.x86_64 can be useful but without other centralized ways to way to specifically check compatibility and if anyone else made it work, testing is a way of life. Using uname -r to show what version I am using (and if I really need to upgrade) and looking through AL’s release notes or the release notes/changlog from the tool author may provide information to deduce whether to use my current kernel version with my specific software. Another way to leak out interesting information about the AL2 kernel is to keep up with the Amazon Linux 2 kernel changelog repo on GitHub or to use the amazon-linux-extras tool.