diff --git a/README.md b/README.md index 9e7778d..b6eff65 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ See code for all available configurations. | [Dell XPS 15 9560][] | `` | | [Dell XPS 15 9560, intel only][] | `` | | [Dell XPS 15 9560, nvidia only][] | `` | +| [Dell XPS 15 9500][] | `` | +| [Dell XPS 15 9500, nvidia][] | `` | | [Google Pixelbook][] | `` | | [Inverse Path USB armory][] | `` | | Lenovo IdeaPad Z510 | `` | diff --git a/common/gpu/nvidia.nix b/common/gpu/nvidia.nix new file mode 100644 index 0000000..fed9fa9 --- /dev/null +++ b/common/gpu/nvidia.nix @@ -0,0 +1,22 @@ +{ lib, pkgs, ... }: + +# This creates a new 'nvidia-offload' program that runs the application passed to it on the GPU +# As per https://nixos.wiki/wiki/Nvidia +let + nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec -a "$0" "$@" + ''; +in +{ + services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; + environment.systemPackages = [ nvidia-offload ]; + + hardware.nvidia.prime = { + offload.enable = lib.mkDefault true; + # Hardware should specify the bus ID for intel/nvidia devices + }; +} diff --git a/dell/xps/15-9500/README.wiki b/dell/xps/15-9500/README.wiki new file mode 100644 index 0000000..ebcb5e3 --- /dev/null +++ b/dell/xps/15-9500/README.wiki @@ -0,0 +1,22 @@ += Dell XPS 15 9550 = + +== Tested Hardware == + +* CPU: Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz +* RAM: 64 GB +* HDD: 1 TiB SSD +* Screen: 15" 4k (3840✕2160) +* Graphics: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile], with Intel Graphics too. +* Input: Touchscreen and trackpad. + +== Notes == + +Also tested with Dell WD19TB Thunderbolt Dock. + +== NVIDIA Offload == + +In order to run a program on the NVIDIA gpu, you can use the `nvidia-offload` function, for example: +``` +nvidia-offload `nix-shell -p glxinfo --run 'glxgears'` +``` +This is a short bash script that sets the proper environment variables and calls your command. diff --git a/dell/xps/15-9500/default.nix b/dell/xps/15-9500/default.nix new file mode 100644 index 0000000..c7beda4 --- /dev/null +++ b/dell/xps/15-9500/default.nix @@ -0,0 +1,21 @@ +{ lib, ... }: +let + thermald-conf = ./thermald-conf.xml; +in +{ + imports = [ + ../../../common/cpu/intel + ../../../common/pc/laptop + ../../../common/pc/laptop/ssd + ]; + + # Boot loader + boot.kernelParams = lib.mkDefault [ "acpi_rev_override" ]; + + # This will save you money and possibly your life! + services.thermald.enable = lib.mkDefault true; + + # Thermald doesn't have a default config for the 9500 yet, the one in this repo + # was generated with dptfxtract-static (https://github.com/intel/dptfxtract) + services.thermald.configFile = lib.mkDefault thermald-conf; +} diff --git a/dell/xps/15-9500/nvidia/default.nix b/dell/xps/15-9500/nvidia/default.nix new file mode 100644 index 0000000..451b6eb --- /dev/null +++ b/dell/xps/15-9500/nvidia/default.nix @@ -0,0 +1,15 @@ +{ lib, pkgs, ... }: +{ + imports = [ + ../default.nix + ../../../../common/gpu/nvidia.nix + ]; + + hardware.nvidia.prime = { + # Bus ID of the Intel GPU. + intelBusId = lib.mkDefault "PCI:0:2:0"; + + # Bus ID of the NVIDIA GPU. + nvidiaBusId = lib.mkDefault "PCI:1:0:0"; + }; +} diff --git a/dell/xps/15-9500/thermald-conf.xml b/dell/xps/15-9500/thermald-conf.xml new file mode 100644 index 0000000..bc13d35 --- /dev/null +++ b/dell/xps/15-9500/thermald-conf.xml @@ -0,0 +1,205 @@ + + + + + Auto generated + XPS 15 9500 + QUIET + + 0 + 10000 + 68000 + 56000 + 56000 + 250 + + + + auto_zone_0 + + + SEN2 + 55000 + Passive + + B0D4 + 1 + 45000000 + + + + SEN2 + 57000 + Passive + + B0D4 + 1 + 40000000 + + + + SEN2 + 60000 + Passive + + B0D4 + 1 + 35000000 + + + + SEN2 + 64000 + Passive + + B0D4 + 3 + 35000000 + + + + SEN2 + 68000 + Passive + + B0D4 + 3 + 20000000 + + + + SEN2 + 70000 + Passive + + B0D4 + 3 + 15000000 + + + + + + auto_zone_1 + + + SEN5 + 38000 + Passive + + B0D4 + 1 + 22000000 + + + + SEN5 + 39000 + Passive + + B0D4 + 1 + 17000000 + + + + SEN5 + 40000 + Passive + + B0D4 + 3 + 12000000 + + + + SEN5 + 41000 + Passive + + B0D4 + 3 + + + + + + auto_zone_2 + + + VIR1 + 57000 + Passive + + B0D4 + 3 + 15000000 + + + + VIR1 + 60000 + Passive + + B0D4 + 3 + + + + + + auto_zone_3 + + + VIR2 + 76000 + Passive + + B0D4 + 1 + + + + + + auto_zone_4 + + + WRLS + 80000 + Passive + + B0D4 + 1 + + + + + + auto_zone_5 + + + STG1 + 66000 + Passive + + B0D4 + 1 + 19000000 + + + + STG1 + 90000 + Passive + + B0D4 + 1 + + + + + + + + diff --git a/flake.nix b/flake.nix index c30d3c9..b6e6718 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,8 @@ dell-xps-15-9560 = import ./dell/xps/15-9560; dell-xps-15-9560-intel = import ./dell/xps/15-9560/intel; dell-xps-15-9560-nvidia = import ./dell/xps/15-9560/nvidia; + dell-xps-15-9500 = import ./dell/xps/15-9500; + dell-xps-15-9500-nvidia = import ./dell/xps/15-9500/nvidia; google-pixelbook = import ./google/pixelbook; inversepath-usbarmory = import ./inversepath/usbarmory; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510;