nvidia-container configuration:
1) In the file,
/etc/nvidia-container-runtime/config.toml
2) set the parameter:
no-cgroups=false
3) restart docker and run the test container
sudo systemctl restart docker
docker run --rm --runtime-nvidia --gpus all ubuntu nvidia-smi
成功。