Podman Stats Does not work - Cgroups v2 issue

I was using Podman on Rocky Linux’s latest version and got this error.

Error: stats is not supported in rootless mode without cgroups v2

Running podman info --debug gave the following output.

host:
  arch: amd64
  buildahVersion: 1.21.3
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
...

Then I tried running the following command to enable cgroups v2

sudo grubby --update-kernel=/boot/vmlinuz-$(uname -r) --args="systemd.unified_cgroup_hierarchy=1"

And now, podman stats is giving another error.

WARN[0013] Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/user.slice/19b6668bc6278a66b3ffc98ae1515af25f5bebcd20bf26de803cae41c4485f59/memory.current: no such file or directory
WARN[0013] Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/user.slice/19b6668bc6278a66b3ffc98ae1515af25f5bebcd20bf26de803cae41c4485f59/pids.current: no such file or directory
WARN[0013] Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/user.slice/5507087b3133950e4dbee35692af9bdb9a6b2cc473f3005306e27e9d05a72bd3/memory.current: no such file or directory
WARN[0013] Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/user.slice/5507087b3133950e4dbee35692af9bdb9a6b2cc473f3005306e27e9d05a72bd3/pids.current: no such file or directory

Any idea why is this happening and how to fix it?

And now I can’t create a container anymore. Getting the following error.

Error: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: open /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/user.slice/libpod-0f4e830f91d144edc5a2a19caa7ebc3c748aa60256ba841e32d86200e542c639.scope/pids.max: no such file or directory: OCI runtime attempted to invoke a command that was not found

Did you ever got cgroups v2 working?