diff options
| author | Hilton Chain <hako@ultrarare.space> | 2024-03-09 21:39:18 +0800 |
|---|---|---|
| committer | John Kehayias <john.kehayias@protonmail.com> | 2024-04-24 20:06:58 -0400 |
| commit | be61a1829a19724299e46d6e3c1038229039c3ee (patch) | |
| tree | da4abbfdfb91251d91e854e869736cb4148489a1 | |
| parent | 39e64b2b7706885b8261bfbefa8dd0521072d8c7 (diff) | |
README.org: Document setup for NVIDIA graphics card.
* README.org (NVIDIA graphics card): New section.
Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
| -rw-r--r-- | README.org | 69 |
1 files changed, 69 insertions, 0 deletions
| @@ -220,6 +220,75 @@ firmware, and blacklisting of conflicting modules: | |||
| 220 | ...)) | 220 | ...)) |
| 221 | ...) | 221 | ...) |
| 222 | #+END_SRC | 222 | #+END_SRC |
| 223 | |||
| 224 | ** NVIDIA graphics card | ||
| 225 | |||
| 226 | NVIDIA graphics card support in Nonguix consists of a system service =nvidia-service-type= and a package =nvda= for application setup. | ||
| 227 | |||
| 228 | The following code serves as an example for system setup: | ||
| 229 | |||
| 230 | #+BEGIN_SRC scheme | ||
| 231 | (use-modules (gnu services gnome) | ||
| 232 | (gnu services xorg) | ||
| 233 | (nongnu packages nvidia) | ||
| 234 | (nongnu services nvidia)) | ||
| 235 | |||
| 236 | (operating-system | ||
| 237 | (kernel-arguments '("modprobe.blacklist=nouveau" | ||
| 238 | ;; Set this if the card is not used for displaying or | ||
| 239 | ;; you're using Wayland: | ||
| 240 | "nvidia_drm.modeset=1")) | ||
| 241 | (services | ||
| 242 | (cons* (service nvidia-service-type) | ||
| 243 | ;; Configure desktop environment, GNOME for example. | ||
| 244 | (service gnome-desktop-service-type | ||
| 245 | ;; Enable NVIDIA support, only do this when the card is | ||
| 246 | ;; used for displaying. | ||
| 247 | (gnome-desktop-configuration | ||
| 248 | (gnome (replace-mesa gnome)))) | ||
| 249 | ;; Configure Xorg server, only do this when the card is used for | ||
| 250 | ;; displaying. | ||
| 251 | (set-xorg-configuration | ||
| 252 | (xorg-configuration | ||
| 253 | (modules (cons nvda %default-xorg-modules)) | ||
| 254 | (drivers '("nvidia")))) | ||
| 255 | ...)) | ||
| 256 | ...) | ||
| 257 | #+END_SRC | ||
| 258 | |||
| 259 | For application setup, =mesa= has to be replaced with =nvda= for every individual package that requires the NVIDIA driver, this can be done with grafting (which doesn't rebuild packages) or rewriting inputs (which rebuilds packages) (see [[https://guix.gnu.org/manual/devel/en/guix.html#Package-Transformation-Options][Package Transformation Options]] in GNU Guix Reference Manual). For example: | ||
| 260 | |||
| 261 | #+BEGIN_SRC shell | ||
| 262 | guix build mesa-utils --with-graft=mesa=nvda | ||
| 263 | guix build mesa-utils --with-input=mesa=nvda | ||
| 264 | #+END_SRC | ||
| 265 | |||
| 266 | The above transformation can be used within an one-off software environment spawned by =guix shell= as well, for correct environment variables, the =nvda= package may be added into the environment: | ||
| 267 | |||
| 268 | #+BEGIN_SRC shell | ||
| 269 | guix shell mesa-utils nvda --with-graft=mesa=nvda \ | ||
| 270 | -- glxinfo | ||
| 271 | #+END_SRC | ||
| 272 | |||
| 273 | To graft mesa with nvda programmatically, use =replace-mesa= defined in =(nongnu packages nvidia)=: | ||
| 274 | |||
| 275 | #+BEGIN_SRC scheme | ||
| 276 | (use-modules (nongnu packages nvidia)) | ||
| 277 | |||
| 278 | ;; Replace mesa with nvda for a single package. | ||
| 279 | (replace-mesa <some-package>) | ||
| 280 | |||
| 281 | ;; Replace mesa with nvda for a package list. | ||
| 282 | (map replace-mesa (list <some-package> ...)) | ||
| 283 | |||
| 284 | ;; A package with mesa replaced is still a package, it can be part of a | ||
| 285 | ;; package list. | ||
| 286 | (list (replace-mesa <some-package>) | ||
| 287 | ...) | ||
| 288 | #+END_SRC | ||
| 289 | |||
| 290 | When the card is not used for displaying, environment variables =__GLX_VENDOR_LIBRARY_NAME=nvidia= and =__NV_PRIME_RENDER_OFFLOAD=1= may be set. | ||
| 291 | |||
| 223 | ** Substitutes for nonguix | 292 | ** Substitutes for nonguix |
| 224 | 293 | ||
| 225 | A Nonguix substitute server is available at [[https://substitutes.nonguix.org]]. | 294 | A Nonguix substitute server is available at [[https://substitutes.nonguix.org]]. |
