Advertisement
daddy_jones

pkg_nvidia_gpu

Jul 11th, 2020
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. """pkg_nvidia_gpu command.
  2.  
  3. @author: Paul Hunnnisett phunnilemur@gmail.com
  4. """
  5.  
  6. from cleanroom.command import Command
  7. from cleanroom.location import Location
  8. from cleanroom.systemcontext import SystemContext
  9.  
  10. import typing
  11.  
  12.  
  13. class PkgNvidiaGpuCommand(Command):
  14. """The pkg_nvidia_gpu command."""
  15.  
  16.  
  17. def __init__(self, **services: typing.Any) -> None:
  18. """Constructor."""
  19. super().__init__(
  20. "pkg_nvidia_gpu", help_string="Set up NVidia GPU.", file=__file__, **services
  21. )
  22.  
  23.  
  24. def validate(self, location: Location, *args: typing.Any, **kwargs: typing.Any) -> None:
  25. """Validate the arguments."""
  26. self._validate_no_arguments(location, *args, **kwargs)
  27.  
  28.  
  29. def __call__(
  30. self,
  31. location: Location,
  32. system_context: SystemContext,
  33. *args: typing.Any,
  34. **kwargs: typing.Any
  35. ) -> None:
  36. """Execute command."""
  37.  
  38. # Set some kernel parameters for:
  39. system_context.set_or_append_substitution(
  40. "KERNEL_CMDLINE", "nvidia-drm.modeset=1 nouveau.blacklist=1"
  41. )
  42.  
  43.  
  44. self._execute(
  45. location,
  46. system_context,
  47. "pacman",
  48. "nvidia",
  49. "nvidia-settings",
  50. "nvidia-utils",
  51. "opencl-nvidia",
  52. "libvdpau",
  53. "lib32-libvdpau",
  54. "lib32-nvidia-utils",
  55. "lib32-opencl-nvidia",
  56. "vdpauinfo",
  57. "mesa",
  58. "mesa-demos",
  59. )
  60.  
  61. self._execute(
  62. location.next_line(),
  63. system_context,
  64. "create",
  65. "/etc/modprobe.d/nouveau-blacklist.conf",
  66. "blacklist noveau",
  67. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement