Salt formula for deployment of NVIDIA hardware-accelerated qubes with cuda support
.
├── doc
│ └── nvidia-driver.md # Guide to this formula
├── LICENSE
├── nvidia_driver
│ └── nvidia_driver
│ ├── create.sls # Create template
│ ├── init.sls # Install drivers
│ ├── nvrun # Run a program in prime environment
│ ├── prime.sls # Install prime environment script (nvrun)
│ └── zero_swap.sls # Set swapiness to 0
├── pillar.example # All available configuration parameters
└── README.md
-
Upload
nvidia-driverto your salt environmentAny location defined in
file_rootswill work. Usually formulas are installed in/srv/formulas/For example, if you install the formula like this:
/srv/formulas/ └── nvidia_driver └── nvidia_driver ├── create.sls ├── init.sls ├── nvrun ├── prime.sls └── zero_swap.slsYou should set the following
file_roots:file_roots: base: - /srv/salt - /srv/formulas/nvidia_driver
-
Configure top file
This example assumes that you handle vm creation and configuration in dom0 separately, see
pillar.exampleif you wantnvidia_driver.createto make templates for you.# /srv/salt/top.sls base: debian-13-nv: - nvidia_driver - nvidia_driver.zero_swap fedora-42-nv: - nvidia_driver - nvidia_driver.prime
-
Apply the state
Don't forget to add
--max-concurrency=1if your vms operate the same devices to prevent them from "fighting" over it.# qubesctl --targets debian-13-nv,fedora-42-nv state.highstate
- optimus prime
- debian 13
- fedora 42
- generalize installation of drivers
- document usage via gitfs This could allow invocation of this formula without ever installing anything in dom0 (with a slight drawback of not being able to use nvidia_driver.create)
- Fail if distribuion is not supported
- Use list of dictionaries for
nvidia_driver.createconfiguration - Do whonix as well
- Automate driver package detection on debian
- Test debian 14 and fedora 43 (it does not work)
- Update it to work on debian 14 and fedora 43
future, maybe:
- rpm repository