Skip to content

Commit

Permalink
Merge pull request NixOS#314564 from dawidd6/gpt4all
Browse files Browse the repository at this point in the history
gpt4all: 2.7.5 -> 2.8.0
  • Loading branch information
drupol authored May 25, 2024
2 parents eb53d91 + 4705acc commit bcf738f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 19 additions & 3 deletions pkgs/by-name/gp/gpt4all/package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
, config
, stdenv
, fetchFromGitHub
, cmake
Expand All @@ -7,15 +8,17 @@
, shaderc
, vulkan-headers
, wayland
, cudaSupport ? config.cudaSupport
, cudaPackages ? { }
}:

stdenv.mkDerivation (finalAttrs: {
pname = "gpt4all";
version = "2.7.5";
version = "2.8.0";

src = fetchFromGitHub {
fetchSubmodules = true;
hash = "sha256-i/T6gk8ICneW624008eiStgYNv5CE8w0Yx8knk57EFw=";
hash = "sha256-aSz37+1K26Xizf4cpV45a2DnSsl959VQok/ppFRk/hs=";
owner = "nomic-ai";
repo = "gpt4all";
rev = "v${finalAttrs.version}";
Expand All @@ -26,6 +29,8 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cmake
qt6.wrapQtAppsHook
] ++ lib.optionals cudaSupport [
cudaPackages.cuda_nvcc
];

buildInputs = [
Expand All @@ -39,12 +44,23 @@ stdenv.mkDerivation (finalAttrs: {
shaderc
vulkan-headers
wayland
];
] ++ lib.optionals cudaSupport (
with cudaPackages;
[
cuda_cccl.dev
cuda_cudart.dev
cuda_cudart.lib
cuda_cudart.static
libcublas.dev
libcublas.lib
]);

cmakeFlags = [
"-DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=OFF"
"-DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON"
"-DKOMPUTE_OPT_USE_BUILT_IN_FMT=OFF"
] ++ lib.optionals (!cudaSupport) [
"-DLLMODEL_CUDA=OFF"
];

postInstall = ''
Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8556,6 +8556,10 @@ with pkgs;

gparted = callPackage ../tools/misc/gparted { };

gpt4all-cuda = gpt4all.override {
cudaSupport = true;
};

gpt2tc = callPackage ../tools/text/gpt2tc { };

gptcommit = callPackage ../development/tools/gptcommit {
Expand Down

0 comments on commit bcf738f

Please sign in to comment.