Failed to run mount hooks

I followed the usual procedure for installing lxd using snap. I am at version 5.9. I created an instance main using lxc launch, and then I get the following error:

Name: main
Status: STOPPED
Type: container
Architecture: x86_64
Created: 2023/01/08 06:06 CST
Last Used: 2023/01/08 06:21 CST

Log:

lxc main 20230108122141.954 WARN conf - …/src/src/lxc/conf.c:lxc_map_ids:3592 - newuidmap binary is missing
lxc main 20230108122141.954 WARN conf - …/src/src/lxc/conf.c:lxc_map_ids:3598 - newgidmap binary is missing
lxc main 20230108122141.956 WARN conf - …/src/src/lxc/conf.c:lxc_map_ids:3592 - newuidmap binary is missing
lxc main 20230108122141.956 WARN conf - …/src/src/lxc/conf.c:lxc_map_ids:3598 - newgidmap binary is missing
lxc main 20230108122142.421 ERROR conf - …/src/src/lxc/conf.c:run_buffer:321 - Script exited with status 1
lxc main 20230108122142.421 ERROR conf - …/src/src/lxc/conf.c:lxc_setup:4400 - Failed to run mount hooks
lxc main 20230108122142.421 ERROR start - …/src/src/lxc/start.c:do_start:1272 - Failed to setup container “main”
lxc main 20230108122142.421 ERROR sync - …/src/src/lxc/sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 4)
lxc main 20230108122142.430 WARN network - …/src/src/lxc/network.c:lxc_delete_network_priv:3631 - Failed to rename interface with index 0 from “eth0” to its initial name “veth0962acc6”
lxc main 20230108122142.430 ERROR start - …/src/src/lxc/start.c:__lxc_start:2107 - Failed to spawn container “main”
lxc main 20230108122142.430 WARN start - …/src/src/lxc/start.c:lxc_abort:1036 - No such process - Failed to send SIGKILL via pidfd 17 for process 14381
lxc main 20230108122142.430 ERROR lxccontainer - …/src/src/lxc/lxccontainer.c:wait_on_daemonized_start:877 - Received container state “ABORTING” instead of “RUNNING”
lxc main 20230108122147.533 WARN conf - …/src/src/lxc/conf.c:lxc_map_ids:3592 - newuidmap binary is missing
lxc main 20230108122147.533 WARN conf - …/src/src/lxc/conf.c:lxc_map_ids:3598 - newgidmap binary is missing
lxc 20230108122147.555 ERROR af_unix - …/src/src/lxc/af_unix.c:lxc_abstract_unix_recv_fds_iov:218 - Connection reset by peer - Failed to receive response
lxc 20230108122147.555 ERROR commands - …/src/src/lxc/commands.c:lxc_cmd_rsp_recv_fds:128 - Failed to receive file descriptors for command “get_state”

==============

The profile I used is here:

config:
environment.DISPLAY: :0
nvidia.driver.capabilities: all
nvidia.runtime: “true”
user.user-data: |
#cloud-config
# Create new user
users:
- name: gokul
groups: sudo
shell: /bin/bash
package_upgrade: true
packages:
- x11-apps
- mesa-utils
locale: en_US.UTF-8
timezone: America/Chicago
description: simple with gpu
devices:
Ethernet:
name: eth0
network: lxdbr0
type: nic
GPU:
type: gpu
root:
path: /
pool: default
type: disk
name: Nvidia
used_by: []

I got it working around. I removed these two lines:
nvidia.driver.capabilities: all
nvidia.runtime: “true”

and then started the instance, and then edited the profile by adding those removed lines again, and it worked.