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: 18.5.1 -> 18.6.2; add studio variant; various improvements #255577

Merged
merged 9 commits into from Dec 2, 2023

Conversation

amarshall
Copy link
Member

@amarshall amarshall commented Sep 17, 2023

Description of changes

See individual commit messages for details and caveats.

Things done

Tested both free and studio. Tested studio activation. Tested that app starts and can load existing project and various functionality. Using Nvidia GPU.

The Studio download is a bit flaky and sometimes fails with

curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

but works eventually.

  • 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.

@amarshall amarshall changed the title davinci-resolve: 18.1.4 -> 18.6; add studio variant; various improvements davinci-resolve: 18.5.1 -> 18.6; add studio variant; various improvements Sep 17, 2023
@ofborg ofborg bot requested a review from jshcmpbll September 17, 2023 03:26
Copy link
Contributor

@stelcodes stelcodes left a comment

Choose a reason for hiding this comment

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

A couple comments

pkgs/applications/video/davinci-resolve/default.nix Outdated Show resolved Hide resolved
pkgs/applications/video/davinci-resolve/default.nix Outdated Show resolved Hide resolved
@amarshall amarshall force-pushed the davinci-resolve branch 2 times, most recently from 3e7393d to 6363075 Compare September 30, 2023 18:53
@amarshall
Copy link
Member Author

@stelcodes Thanks for the review! Addressed both.

@PAI5REECHO
Copy link

PAI5REECHO commented Sep 30, 2023

This PR doesn't launch the app for me when I run it on my machine:

$ mkdir -p ~/.local/share/DaVinciResolve/license/
$ env NIXPKGS_ALLOW_UNFREE=1 nix run --impure 'github:NixOS/nixpkgs?ref=pull/255577/head#davinci-resolve-studio'
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.
18.6.0.0009 Linux/Clang x86_64
Main thread starts: 8E48D100
log4cxx: setFile(./logs/rollinglog.txt,true) call failed.
log4cxx: IO Exception : status code = 30
0x7f8f8e48d100 | Undefined            | INFO  | 2023-09-30 23:47:18,496 | --------------------------------------------------------------------------------
log4cxx: No output stream or file set for the appender named [RollLogAppender].
0x7f8f8e48d100 | Undefined            | INFO  | 2023-09-30 23:47:18,496 | Loaded log config from /home/me/.local/share/DaVinciResolve/configs/log-conf.xml
0x7f8f8e48d100 | Undefined            | INFO  | 2023-09-30 23:47:18,496 | --------------------------------------------------------------------------------

@amarshall
Copy link
Member Author

@PAI5REECHO Does the non-studio from this PR work? Also, anything seemingly-relevant in ~/.local/share/DaVinciResolve/logs/ResolveDebug.txt?

@PAI5REECHO
Copy link

PAI5REECHO commented Oct 1, 2023

@amarshall

0x7f4423c36100 | Main                 | INFO  | 2023-10-01 01:08:59,417 | Running DaVinci Resolve v18.6.0.0009 (Linux/Clang x86_64)
0x7f4423c36100 | Main                 | INFO  | 2023-10-01 01:08:59,417 | BMD_BUILD_UUID 445d7d93-25e8-4e6d-a54e-1bb3ee745c58
0x7f4423c36100 | Main                 | INFO  | 2023-10-01 01:08:59,417 | BMD_GIT_COMMIT 2541dac8b8ea4bd08de600b58edcb7d95aa657bc
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,418 | Starting GPUDetect 1.2_5-a6
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,458 | Done in 40 ms.
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,458 | Detected System:
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,458 |   - OS: Linux NixOS 23.11 (Tapir)
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 |   - NVIDIA GPU Driver: 530.41, supports CUDA 12.1
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 | Detected 1 GPUs:
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 |   - "NVIDIA GeForce GTX 970" (gpu:.) <- Main Display GPU
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 |     Discrete, 1001 MiB used of 3.8 GiB VRAM, PCI:1:0.0
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 |     Matches: CUDA, NVML, OpenCL, XOrg
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 | Detected 1 monitors:
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 |   - "Monitor" <- Main Monitor
0x7f4423c36100 | GPUDetect            | INFO  | 2023-10-01 01:08:59,459 |     1920x1080, connected to "NVIDIA GeForce GTX 970" (gpu:.)
0x7f4423c36100 | Main.GPUConfig       | INFO  | 2023-10-01 01:08:59,459 | Compute API set to automatic, defaulting to CUDA.
0x7f4423c36100 | Main.GPUConfig       | INFO  | 2023-10-01 01:08:59,459 | Selected compute API: CUDA
0x7f4423c36100 | Main.GPUConfig       | INFO  | 2023-10-01 01:08:59,459 | Automatic GPU Selection:
0x7f4423c36100 | Main.GPUConfig       | INFO  | 2023-10-01 01:08:59,459 |   - "NVIDIA GeForce GTX 970" (gpu:.)
0x7f4423c36100 | IO                   | INFO  | 2023-10-01 01:08:59,459 | RED InitializeSdk with library path at /nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs
0x7f4423c36100 | IO                   | INFO  | 2023-10-01 01:08:59,544 | R3DAPI 8.4.0-53216 (20230817 Lx64S) R3DSDK 8.4.0-53216 (20230817 Lx64D C3B1) RED CUDA 8.4.0-53119 (20230817) [/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/] init is successful
0x7f4423c36100 | Main                 | INFO  | 2023-10-01 01:08:59,544 | 0 RED rocket cards available
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
0x7f4423c36100 | Main                 | INFO  | 2023-10-01 01:08:59,544 | Decklink model name: '', version: ''
0x7f4423c36100 | DVIP                 | INFO  | 2023-10-01 01:08:59,545 | DVIP release/18.6 build 55 (09e427705030d24eec0372de1481ce0665aea4ed). Release, version 18.6.0.
0x7f43d1fe9680 | IO                   | INFO  | 2023-10-01 01:08:59,545 | Using DNxHR library v2.7.3.27r
0x7f43d0bff680 | SyManager            | ERROR | 2023-10-01 01:08:59,699 | GetProjectLibraries() - Access token is empty
0x7f43d27ea680 | Fusion               | INFO  | 2023-10-01 01:08:59,842 | Fusion Build: c63e6e87_0032 (Sep 14 2023 12:30:53)
0x7f43d1fe9680 | IO                   | INFO  | 2023-10-01 01:08:59,843 | NVDEC is using upto (504) MB
0x7f43b27ff680 | Fusion               | INFO  | 2023-10-01 01:08:59,845 | fusionsystem: = "/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/Fusion/libfusionsystem.so"
0x7f43b27ff680 | Fusion               | INFO  | 2023-10-01 01:08:59,848 | FusionLibs: = "/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/Fusion/"
0x7f43b27ff680 | Fusion               | INFO  | 2023-10-01 01:08:59,848 | UserData:   = "/home/me/.local/share/DaVinciResolve/Fusion"
0x7f43b27ff680 | Fusion               | INFO  | 2023-10-01 01:08:59,848 | Profiles:   = "UserData:Profiles/"
0x7f43d1fe9680 | IO                   | ERROR | 2023-10-01 01:08:59,853 | The selected Nvidia GPU has no decode capability
0x7f43d1fe9680 | IO                   | INFO  | 2023-10-01 01:08:59,864 | Nvidia GPU (0) is initialised as decoding and encoding device.
0x7f43d1fe9680 | IO                   | INFO  | 2023-10-01 01:08:59,866 | IO codec library load completed in 321 ms.
Cannot mix incompatible Qt library (5.15.10) with this library (5.15.2)


==========[CRASH DUMP]==========
#TIME Sun Oct  1 01:08:59 2023 - Uptime 00:00:00 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v18.6.0.0009 (Linux/Clang x86_64)
#BMD_ARCHITECTURE x86_64
#BMD_BUILD_UUID 445d7d93-25e8-4e6d-a54e-1bb3ee745c58
#BMD_GIT_COMMIT 2541dac8b8ea4bd08de600b58edcb7d95aa657bc
#BMD_UTIL_VERSION 18.6.0.0009
#OS Linux

/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/bin/resolve() [0x48069c9]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/bin/resolve() [0x4805db0]
/usr/lib/libc.so.6(+0x38d30) [0x7f4426052d30]
/usr/lib/libc.so.6(+0x87a8c) [0x7f44260a1a8c]
/usr/lib/libc.so.6(gsignal+0x16) [0x7f4426052c86]
/usr/lib/libc.so.6(abort+0xd7) [0x7f442603c8ba]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Core.so.5(+0xa7bd6) [0x7f44128a7bd6]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Core.so.5(_ZNK14QMessageLogger5fatalEPKcz+0xbd) [0x7f44128a90e1]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Core.so.5(+0x2bd23a) [0x7f4412abd23a]
/nix/store/1rk1vm7bh9gwcmjqds1sbkki0dd24g4i-qtstyleplugins-unstable-2017-03-11/lib/qt-5.15.10/plugins/styles/libqgtk2style.so(+0x2706e) [0x7f441d83406e]
/nix/store/1rk1vm7bh9gwcmjqds1sbkki0dd24g4i-qtstyleplugins-unstable-2017-03-11/lib/qt-5.15.10/plugins/styles/libqgtk2style.so(+0x1585e) [0x7f441d82285e]
/nix/store/1rk1vm7bh9gwcmjqds1sbkki0dd24g4i-qtstyleplugins-unstable-2017-03-11/lib/qt-5.15.10/plugins/styles/libqgtk2style.so(+0x2972d) [0x7f441d83672d]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Widgets.so.5(_ZN13QStyleFactory6createERK7QString+0xee) [0x7f443a5d97de]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Widgets.so.5(_ZN19QApplicationPrivate10initializeEv+0xa5) [0x7f443a565a35]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Widgets.so.5(_ZN19QApplicationPrivate4initEv+0x65) [0x7f443a564f65]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/libs/libQt5Widgets.so.5(_ZN12QApplicationC2ERiPPci+0xa9) [0x7f443a564ec9]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/bin/resolve() [0x251ca58]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/bin/resolve() [0x24c6ed4]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/bin/resolve() [0x24c15fe]
/usr/lib/libc.so.6(+0x23ace) [0x7f442603dace]
/usr/lib/libc.so.6(__libc_start_main+0x89) [0x7f442603db89]
/nix/store/2f5q1993fbmi52015xids2mkfpzi5220-davinci-resolve-18.6/bin/resolve() [0x24c024b]
Signal Number = 6

================================
0x7f4423c36100 | CrashReport          | ERROR | 2023-10-01 01:09:00,432 | Compress() : Failed to add file:/home/me/.local/share/DaVinciResolve/configs/UI.preset to archive.
0x7f4423c36100 | CrashReport          | ERROR | 2023-10-01 01:09:00,432 | Compress() : Failed to add file:/home/me/.local/share/DaVinciResolve/configs/config.user.xml to archive.
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

@amarshall
Copy link
Member Author

@PAI5REECHO The “Cannot mix incompatible Qt library (5.15.10) with this library (5.15.2)” is surprising since I don’t get that at all. Can you try:

  • Removing (or moving out of the way) the whole ~/.local/share/DaVinciResolve dir? Perhaps it has some bad state Resolve has internally.
  • If you’re running NixOS 23.05, try cherry-picking all the commits (or otherwise applying) onto 23.05 (or really whatever your current nixpkgs commit is) and building atop that instead? Perhaps there is an issue with the semi-impure GPU drivers in /run/opengl-driver.

@amarshall amarshall changed the title davinci-resolve: 18.5.1 -> 18.6; add studio variant; various improvements davinci-resolve: 18.5.1 -> 18.6.1; add studio variant; various improvements Oct 9, 2023
@amarshall amarshall changed the title davinci-resolve: 18.5.1 -> 18.6.1; add studio variant; various improvements davinci-resolve: 18.5.1 -> 18.6.2; add studio variant; various improvements Oct 23, 2023
Without libXt, shows popup on launch:

> Unable to load plugin: USD.plugin
>
> libXt.so.6: cannot open shared object file: No such file or directory

ultimately launches okay without it, but some feature would probably be
broken.
Otherwise getting it is…non-trivial.
`appimage-run` fails silently if the file does not exist. This made it
easy to have mismatches that lead to non-obvious build errors.
Resolve wants to write the license to `./.license` in the drv store
path. This obviously fails as it is read-only. Conveniently this is a
Bubblewrap-based FHS env, so we can bind-mount a reasonable dir from
$HOME to this path instead. Unfortunately, the dir needs to exist before
launching, so it must be manually created presently e.g.

    mkdir -p ~/.local/share/DaVinciResolve/license

At least the error is fairly obvious:

> bwrap: Can't find source path /home/user/.local/share/DaVinciResolve/license: No such file or directory

Without making the license writable, license activation will always give
a generic error—the actual problem was found with strace.
The downloads.json also includes metadata for older versions, so this
should be durable unless upstream breaks things. Some older downloads
appear to not include the “Update” suffix in the name, so match with or
without it.
See NixOS#265476

This is a hack that effectively undoes
NixOS#263201 for just this derivation.
Really we should probably be doing a ton of autoPatchelf or something to
patch in our libs. Alas, this is “good enough” to un-break for now, I
think.
@pbsds
Copy link
Contributor

pbsds commented Dec 2, 2023

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

2 packages built:
  • davinci-resolve
  • davinci-resolve-studio

Works for me, did not try the studio version due to lack of license.

@pbsds pbsds merged commit 669b964 into NixOS:master Dec 2, 2023
22 checks passed
@xvrqt
Copy link

xvrqt commented Dec 9, 2023

I bought a license to try studio version; it builds fine, but upon running it complains that it can't copy the license file into the read-only /nix/store path (makes sense).

It seems like a recreation of an older issue: #94032 (comment) where davinci-resolve reverts to its /nix/store location no matter where it is run from. This was seeming solved by wrapping it in a FHS location built for davinci using https://github.com/NixOS/nixpkgs/blob/bcd452a5544131d486eac0493002d2341b3af022/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix.

The issue was brought up again in #152113 (comment) where the work around was to use extraBwrapArgs to bind the license file to a writeable location in the FHS. However this is failing for me :[

I am installing it via a standalone home-manager installation, and pulling nixpkgs-unstable via a flake.
Installing it as a systemPackages on my NixOS configuration produces the same error.

bwrap: Can't create file at /nix/store/kxy0cl1p0f9nr6gf46gzc1jx42f48kzw-davinci-resolve-studio-18.6.3/.license: Is a directory

I'm pretty green to NixOS so I'm trying to understand buildFHSEnv better to see why davinci isn't running from there, but would appreciated if someone more knowledgeable would take a look.

@xvrqt
Copy link

xvrqt commented Dec 9, 2023

Seems related: #239017

Yet, we're clearly using --bind in the extraBwrapArgs so idk what's up :[

@amarshall amarshall deleted the davinci-resolve branch December 11, 2023 05:43
@amarshall
Copy link
Member Author

@xvrqt Most likely ~/.local/share/DaVinciResolve/license exists but is a file instead of a directory—it must be a directory. If fixing that doesn’t resolve, please open a new issue.

Copy link
Contributor

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/davinci-resolve-studio-install-issues/37699/5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants