locaal-ai / obs-backgroundremoval

An OBS plugin for removing background in portrait images (video), making it easy to replace the background when recording or streaming.
GNU General Public License v2.0
2.83k stars 190 forks source link

Nix build fails with "Specify CUDA_TOOLKIT_ROOT_DIR" even though DISABLE_ONNXRUNTIME_GPU is ON #598

Open Zahrun opened 4 weeks ago

Zahrun commented 4 weeks ago

Describe the bug

If CUDA is enabled in NixOS, Nix cmake build fails in FindCUDA with "Specify CUDA_TOOLKIT_ROOT_DIR" even though DISABLE_ONNXRUNTIME_GPU is ON

See https://github.com/NixOS/nixpkgs/issues/335605

To Reproduce

  1. Enable CUDA, CUDNN and unfree pacakges via
 nixpkgs.config = {
   allowUnfree = true;
   cudaSupport = true;
   cudnnSupport = true;
 };
2. Add CUDA-Toolkit and CUDNN to Sytem-Packages
cudaPackages.cudatoolkit
cudaPackages.cudnn
3. Add OBS and plugins to packages via
(pkgs.wrapOBS {
  plugins = with pkgs.obs-studio-plugins; [
    waveform
    wlrobs
    obs-backgroundremoval
    obs-pipewire-audio-capture
  ];
})

Log

https://gist.github.com/RedEtherbloom/f427920f2f37f779ebdab5943e254363

Additional context

All other packages build normally. OBS builds normally if we remove obs-backgroundremoval from the plugin list.

Any idea why cmake is trying FindCUDA even though DISABLE_ONNXRUNTIME_GPU is ON?