Add cuda for obs-backgroundremoval

This commit is contained in:
Torjus Håkestad 2024-05-28 19:44:52 +02:00
parent fcec0641aa
commit 9704525fdf

View File

@ -1,25 +1,31 @@
{ pkgs, ... }: { pkgs, lib, osConfig, ... }:
# let let
# obs-backgroundremoval_1_1_10 = (pkgs.obs-studio-plugins.obs-backgroundremoval.overrideAttrs { withCuda = if (osConfig.system.name == "gunter") then true else false;
# version = "1.1.10"; onnxruntime-gpu = (pkgs.onnxruntime.override {
# src = pkgs.fetchFromGitHub { cudaSupport = withCuda;
# owner = "occ-ai"; });
# repo = "obs-backgroundremoval"; obs-backgrounremoval-gpu = ((pkgs.obs-studio-plugins.obs-backgroundremoval.override {
# rev = "1.1.10"; onnxruntime = onnxruntime-gpu;
# hash = "sha256-6OTtmjXS3fiorEPUSjjqrS8u9fVJnnZZoD722W3JQO8="; }).overrideAttrs (old: {
# }; version = "1.1.14-beta";
# }).override { src = pkgs.fetchFromGitHub {
# onnxruntime = pkgs.unstable.onnxruntime; owner = "occ-ai";
# }; repo = "obs-backgroundremoval";
# in rev = "94be8c35fe077be93a6f5ef347a802295a36dddd";
hash = "sha256-qnxDNeTWQYiRMqT6jNp8GC8ef6aaAAY+OXAak54dVc8=";
};
cmakeFlags =
if withCuda then
(lib.lists.remove "-DDISABLE_ONNXRUNTIME_GPU=ON" old.cmakeFlags)
else old.cmakeFlags;
}));
in
{ {
programs.obs-studio = { programs.obs-studio = {
enable = true; enable = true;
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
obs-pipewire-audio-capture obs-pipewire-audio-capture
obs-shaderfilter obs-shaderfilter
]; ] ++ [ obs-backgrounremoval-gpu ];
#plugins = [ obs-backgroundremoval_1_1_10 ];
}; };
} }