The issue you're encountering is due to the --writable flag conflicting with the --nv (NVIDIA GPU support) flag in Apptainer (formerly Singularity). The --writable flag makes the container's filesystem writable, but this can prevent the NVIDIA drivers and libraries from being properly mounted into the container, which is why nvidia-smi is not found.
How to Fix nvidia-smi in Apptainer
1. Remove the --writable Flag
The simplest solution is to remove the --writable flag if you don't need a writable filesystem. The --nv flag requires read-only access to the host's NVIDIA drivers and libraries.
bash
apptainer shell --fakeroot --nv debian-sandbox/
2. Use --nv with --containall (if needed)
If you need a writable filesystem, you can try using --containall instead of --writable. This ensures all necessary host files (including NVIDIA libraries) are mounted.
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.