fix(install/gpu):Fix docker not being able to leverage the GPU on systems that have SELinux Enforced
Description
Tested on a fresh Fedora Cloud Edition VM with a fresh seed.iso (nocloud), with the prerequisite of having docker and lspci installed now the script bring the VM from 0 to full GPU acceleration.
This fix include:
- Introduced a function to enable SELinux
container_use_devicesboolean for GPU access in containers. - Configured NVIDIA Container Runtime in Docker and ensured the runtime is activated by restarting Docker.
- Applied changes conditionally for relevant distributions like Fedora, RHEL, CentOS, Rocky, and openSUSE.
- Added a user confirmation prompt for enabling SELinux changes to address security implications.
This PR fixes #
Docker not being able to access an Nvidia GPU and failing with:
Failed to initialize NVML: Insufficient Permissions
Signed commits
- [x] Yes, I signed my commits.
Deploy Preview for localai ready!
| Name | Link |
|---|---|
| Latest commit | 40883c410db074bd887753c903f7717d5be7241c |
| Latest deploy log | https://app.netlify.com/sites/localai/deploys/680e229926dc120008f71f0b |
| Deploy Preview | https://deploy-preview-5252--localai.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Spotted a string that i forgot to change in the new function, will fix later
That's nice, thanks for your contribs @Bloodis94 !
I just had some time on my hands and a dream :smile:, by the way i fixed the typo and the PR is again ready for review