I'm very sorry, I had only tested 'file' before. I just tested 'char' and it does not work properly; only 'file' works correctly. rocminfo can correctly identify the GPU. finally, I added the following content for the iGPU of the 7840HS:
# For AMD GPU
lxc.cgroup2.devices.allow = c 226:0 rwm
lxc.cgroup2.devices.allow = c 226:128 rwm
lxc.cgroup2.devices.allow = c 242:0 rwm
lxc.mount.entry = /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry = /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry = /dev/kfd dev/kfd none bind,optional,create=file
it may also be applicable to other AMD GPUs.