The Ubuntu 22.04.2 LTS (Jammy Jellyfish) Desktop is hardware accelerated with wayland GPU, so you can use SDL2 with GPU by default on desktop.
sudo apt update
sudo apt upgrade
sudo apt install libsdl2-2.0-0 libsdl2-dev
git clone https://github.com/libsdl-org/SDL
git checkout release-2.0.20
If the installation was completed succesfully OpenGL ES2 Cube Demo should appear in the screen.