28 lines
931 B
Nix
28 lines
931 B
Nix
{ pkgs, ... }:
|
|
{
|
|
# assumes common-gpu-amd from nixos-hardware is also added
|
|
# TODO: should we move it from flake.nix to here?
|
|
|
|
# nixos-hardware common-amd option
|
|
hardware.amdgpu.opencl = true;
|
|
|
|
|
|
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
|
|
nixpkgs.config.rocmSupport = true;
|
|
nixpkgs.config.vdpauSupport = true;
|
|
nixpkgs.config.vaapiSupport = true;
|
|
|
|
|
|
hardware.opengl.enable = true;
|
|
# https://libreddit.noximilien.pbsds.net/r/archlinux/comments/nih9c9/amdgpu_vs_modesetting_in_current_510_kernels_xorg/
|
|
services.xserver.videoDrivers = [ "amdgpu" ]; # use gpu, adaptive sync and and hardware page flipping
|
|
#services.xserver.videoDrivers = [ "modesetting" ]; # integrated (non-accelerated) framebuffer, KMS
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
|
|
];
|
|
environment.systemPackages = with pkgs; [
|
|
nvtop-amd
|
|
];
|
|
}
|