Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

davinci-resolve: 17.4.3 -> 18.1.4 #240549

Merged
merged 2 commits into from
Jul 2, 2023
Merged

Conversation

yuuyins
Copy link
Contributor

@yuuyins yuuyins commented Jun 29, 2023

Description of changes

See #238026 (comment), #238026 (comment)

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@yuuyins yuuyins force-pushed the davinci-resolve branch 3 times, most recently from c053605 to 095bca1 Compare June 29, 2023 15:46
@yuuyins yuuyins marked this pull request as ready for review June 29, 2023 16:18
@yuuyins yuuyins marked this pull request as draft June 29, 2023 16:25
@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 29, 2023

@ofborg eval

@ofborg ofborg bot requested a review from jshcmpbll June 29, 2023 16:31
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Jun 29, 2023
@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 29, 2023

of course ofborg won't eval/build nonfree derivations... i will left it at this. if anyone's interested, please, pick it up.

https://github.com/NixOS/nixpkgs/pull/240549/checks?check_run_id=14664185468

OfBorg / davinci-resolve, davinci-resolve.passthru.tests on x86_64-linux

           ];
         }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnfree = true; }
       to ~/.config/nixpkgs/config.nix.

Cannot nix-instantiate `davinci-resolve.passthru.tests' because:
error: attribute 'tests' in selection path 'davinci-resolve.passthru.tests' not found

@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 29, 2023

after successful build, there are still missing dependencies/libs like libdbus-1.so.3 so was not able to run

let-env 'NIXPKGS_ALLOW_UNFREE' = 1; nix build --impure '/mnt/pro/dev/org.nixos/nixpkgs/davinci-resolve#davinci-resolve'
[1/19/24 built, 870 copied (2876.4/2879.7 MiB), 641.4 MiB DL] building davinci-resolve-18.1.4 (unpackPhase): unpacking source archive /nix/store/rfxva36fcys7lmmqlmdjh1m6006zmgzy-davinci-reso[[1/19/24 built, 870 copied (2876.4/2879.7 MiB), 641.4 MiB DL] building davinci-resolve-18.1.4 (fixupPhase): shrinking /nix/store/j525zvvzcahpd4pjz62zx3dmwdip4q6g-davinci-resolve-18.1.4/libs[1[1/19/24 built, 870 copied (2876.4/2879.7 [1/19/24 built, 870 copied (2876.4/2879.7 MiB), 641.4 λ yuu @ li-nixos in /mnt/pro/dev/org.nixos/nixpkgs/davinci-resolve

./result/bin/davinci-resolve
/nix/store/j525zvvzcahpd4pjz62zx3dmwdip4q6g-davinci-resolve-18.1.4/bin/resolve: error while loading shared libraries: libdbus-1.so.3: cannot open shared object file: No such file or directory

i just added dbus as dependency, but I'm afraid other dependencies for run-time will be missing as well

We appreciate help to find if any dependency still is missing. That is, help building from scratch to find out (as building davinci-resolve takes some time and uses full computing resources on my current machine, and ofborg won't eval/build nonfree derivations like davinci-resolve)

export NIXPKGS_ALLOW_UNFREE=1
nix build --print-build-logs --impure '/path/to/nixpkgs#davinci-resolve'
...
./result/bin/davinci-resolve

if davinci-resolve still errors with something like error while loading shared libraries: libdbus-1.so.3..., try to e.g. nix-locate libdbus-1.so.3 to find which package has that, and add as dependency just as I did with dbus. Then

unlink result
sudo nix-collect-garbage --delete-old

and redo the

export NIXPKGS_ALLOW_UNFREE=1
nix build --print-build-logs --impure '/path/to/nixpkgs#davinci-resolve'
...
./result/bin/davinci-resolve

#238026 (comment) could give hints on what libraries/dependencies davinci resolve 18.1.4 needs

@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 29, 2023

Alright, after adding dbus and dependencies from @BKSalman gist https://gist.github.com/BKSalman/53dc4a4bd3eb3989f88ce25b66d82853

it runs

nvidia-offload ./result/bin/davinci-resolve
ActCCMessage Already in Table: Code= c005, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= c006, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= c007, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= 2282, Mode=  0, Level=  0, CmdKey= 8, Option= 0
PnlMsgActionStringAdapter Already in Table: Code= 615e, Mode=  0, Level=  0, CmdKey= -1, Option= 0
log4cxx: No appender could be found for logger (BtCommon).
log4cxx: Please initialize the log4cxx system properly.
QSocketNotifier: Can only be used with threads started with QThread
18.1.4.0009 Linux/Clang x86_64
Main thread starts: 17A19800
log4cxx: setFile(./logs/rollinglog.txt,true) call failed.
log4cxx: IO Exception : status code = 30
0x7f7117a19800 | Undefined            | INFO  | 2023-06-29 17:44:16,032 | --------------------------------------------------------------------------------
log4cxx: No output stream or file set for the appender named [RollLogAppender].
0x7f7117a19800 | Undefined            | INFO  | 2023-06-29 17:44:16,033 | Loaded log config from /home/yuu/.local/share/DaVinciResolve/configs/log-conf.xml
0x7f7117a19800 | Undefined            | INFO  | 2023-06-29 17:44:16,033 | --------------------------------------------------------------------------------
Resolve communication is open and waiting..
Accepted new client
Socket disconnected

Davinci Resolve 18.1.4)

Full let-env 'NIXPKGS_ALLOW_UNFREE' = 1; nix build --print-build-logs --impure '/mnt/pro/dev/org.nixos/nixpkgs/davinci-resolve#davinci-resolve' log
davinci.log

@yuuyins yuuyins marked this pull request as ready for review June 29, 2023 23:14
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/2377

@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 29, 2023

@BKSalman @icodeforyou-dot-net @jshcmpbll @davidak

please review

@mweinelt mweinelt requested a review from davidak June 29, 2023 23:21
@BKSalman
Copy link
Contributor

BKSalman commented Jun 29, 2023

@BKSalman @icodeforyou-dot-net @jshcmpbll @davidak

please review

Thank you for taking the time and working on this!!

However unfortunately I'm in a vacation right now, and don't have my machine, so I can't review it now, but I think it should be all good as long as you used deps from the gist (since i got it to work on my machine with the gist), and you verified it yourself, maybe the other dear commenters can review it!

Added dependencies according with given Salman Abuhaimed's gist.
Resorted dependencies alphabetically.

References:
- NixOS#238026 (comment)
- https://gist.github.com/BKSalman/53dc4a4bd3eb3989f88ce25b66d82853

Co-authored-by: Salman Abuhaimed <85521119+BKSalman@users.noreply.github.com>
@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 29, 2023

(this last force push was just to add correct Salman Abuhaimed email in Co-authored last commit)

Copy link
Contributor

@l0b0 l0b0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the program, but the PR looks great - alphabetically ordered args, long flags, Python 3. 👍

@yuuyins
Copy link
Contributor Author

yuuyins commented Jun 30, 2023

Just a notice for anyone who might want to try testing: MP4s do not work on DR Linux free version https://wiki.archlinux.org/title/DaVinci_Resolve#Mp4_clips_are_not_working

needs to convert to MOV as usual for working with video files

ffmpeg -i input.mp4 -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le -f mov output.mov

and if using pipewire, needs to enable alsa for audio to work e.g.

{
  services.pipewire = {
    enable = true;

    alsa = {
      enable = true;
      support32Bit = true;
    };
   
    pulse.enable = true;

    wireplumber.enable = true;
  };
}

then

systemctl --user restart pipewire pipewire-pulse wireplumber

restart davinci-resolve, and audio should work

@ic4-y
Copy link

ic4-y commented Jun 30, 2023

@yuuyins thanks for your work, 🚀

I just came back to my computer to see you've been working relentlessly on this the past couple of hours! 😄

@davidak
Copy link
Member

davidak commented Jun 30, 2023

Result of nixpkgs-review pr 240549 run on x86_64-linux 1

1 package built:
  • davinci-resolve

Copy link
Member

@davidak davidak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good

Builds, runs

AMD GPU with OpenCL detected

Screenshot from 2023-06-30 13-41-47

Can someone test a Nvidia GPU with CUDA?

No issue found with function

Tested:

  • Create a new project
  • Load existing projects
  • Playback project timeline
  • Cut video
  • Apply color correction
  • Apply effects
  • Apply transition
  • Render projects

Thanks for your efforts! ✨

@yuuyins
Copy link
Contributor Author

yuuyins commented Jul 1, 2023

@davidak with nvidia offload, tested with nvidia cuda

davinci-resolve-preferences-memory-and-gpu-nvidia-cuda

davinci-resolve-18 1 4-linux-nvidia-cuda-render

tested:

  • Create a new project
  • Load existing projects
  • Playback project timeline
  • Cut video
  • Apply color correction
  • Apply effects
  • Fusion
  • Color
  • Fairlight
  • Render projects

@figsoda figsoda added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Jul 1, 2023
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1008

Copy link
Member

@jshcmpbll jshcmpbll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BKSalman Nice find on dbus. I was trying update this myself and was hitting a lot of issues.

Nice work @yuuyins 🥳 Would love help maintaining it if anyone is interested too - im still trying (albeit slowly) to make the derivation build the studio and beta versions too

buildInputs = [
libGLU
xorg.libXxf86vm
];

src = runCommandLocal "${pname}-src.zip"
rec {
outputHashMode = "recursive";
outputHashAlgo = "sha256";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
outputHashAlgo = "sha256";

@pbsds
Copy link
Member

pbsds commented Jul 2, 2023

Considering davinci refuses to evaluate on 23.05 due to the python2 dep, i believe a backport can be considered a non-breaking change.

@BKSalman
Copy link
Contributor

BKSalman commented Jul 3, 2023

Thanks for your work @yuuyins and everyone!

@SimonBrandner
Copy link
Contributor

Could someone please add the backport release-23.05 label?

@pbsds
Copy link
Member

pbsds commented Aug 24, 2023

I'm much in favor, but won't be the one to call the shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1-10 10.rebuild-linux: 1 12.approvals: 2 This PR was reviewed and approved by two reputable people
Projects
None yet
Development

Successfully merging this pull request may close these issues.