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

Package DaVinci Resolve #94032

Closed
davidak opened this issue Jul 27, 2020 · 57 comments · Fixed by #152113
Closed

Package DaVinci Resolve #94032

davidak opened this issue Jul 27, 2020 · 57 comments · Fixed by #152113

Comments

@davidak
Copy link
Member

davidak commented Jul 27, 2020

Project description
DaVinci Resolve 16 is the world’s only solution that combines professional 8K video editing, color correction, visual effects and audio post production all in one software tool!

It is known to be hard to setup and currently only AUR has packaged it, so we can really solve a problem for many people and show the power of Nix.

https://repology.org/projects/?search=davinci-resolve&maintainer=&category=&inrepo=&notinrepo=&repos=&families=&repos_newest=&families_newest=

Metadata

@p4block
Copy link

p4block commented Jul 28, 2020

This is (the slightly more involved than usual) approach taken by the AUR package to download the program without user intervention.

@irigone
Copy link

irigone commented Nov 12, 2020

Yes!

@lambdadog
Copy link
Contributor

lambdadog commented Nov 25, 2020

Is anyone aware of whose phone number that is in the AUR package? Should we just copy the info there blindly, or?

@lambdadog
Copy link
Contributor

I've got a working src for the same version that's in the AUR (with everything copied over), if anyone's willing to take over. I'm honestly not too terribly familiar with packaging proprietary, pre-compiled software, although I'm sure I can figure it out if no one's free.

{ pkgs ? import <nixpkgs> {} }:

with pkgs;

stdenv.mkDerivation rec {
  pname = "davinci-resolve";
  version = "16.2.7-1";

  # TODO: implement
  
  src = runCommandLocal "${pname}-src" rec {
    outputHashMode = "recursive";
    outputHashAlgo = "sha256";
    outputHash = "1bbj7ahz5gzcj5sh1a57a5xajbzyq6q71rahi49w3vwpk46bq3sw";

    impureEnvVars = lib.fetchers.proxyImpureEnvVars;
    
    nativeBuildInputs = [ curl gnused unzip ];

    # ENV VARS
    SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

    DOWNLOADID = "9b15a70f5ce1418686be3479612f1134";
    REFERID = "b86a2a4c7a3b4ebfafcc6765f7e3d3a5";
    SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";

    USERAGENT = builtins.concatStringsSep " " [
      "User-Agent: Mozilla/5.0 (X11; Linux ${targetPlatform.platform.kernelArch})"
                  "AppleWebKit/537.36 (KHTML, like Gecko)"
                  "Chrome/77.0.3865.75"
                  "Safari/537.36"
    ];

    REQJSON = builtins.concatStringsSep "" [
      ''{'' 
      ''   "firstname": "Arch", ''
      ''   "lastname": "Linux", ''
      ''   "email": "someone@archlinux.org", ''
      ''   "phone": "202-555-0194", ''
      ''   "country": "us", ''
      ''   "state": "New York", ''
      ''   "city": "AUR", ''
      ''   "product": "DaVinci Resolve" ''
      ''}''
    ];
    
  } ''
    REQJSON="$(  printf '%s' "$REQJSON"   | sed 's/[[:space:]]\+/ /g')"
    USERAGENT="$(printf '%s' "$USERAGENT" | sed 's/[[:space:]]\+/ /g')"

    RESOLVEURL=$(curl \
         -s \
         -H 'Host: www.blackmagicdesign.com' \
         -H 'Accept: application/json, text/plain, */*' \
         -H 'Origin: https://www.blackmagicdesign.com' \
         -H "$USERAGENT" \
         -H 'Content-Type: application/json;charset=UTF-8' \
         -H "Referer: https://www.blackmagicdesign.com/support/download/$REFERID/Linux" \
         -H 'Accept-Encoding: gzip, deflate, br' \
         -H 'Accept-Language: en-US,en;q=0.9' \
         -H 'Authority: www.blackmagicdesign.com' \
         -H 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
         --data-ascii "$REQJSON" \
         --compressed \
         "$SITEURL")
    
    curl \
         --retry 3 --retry-delay 3 \
         -H "Host: sw.blackmagicdesign.com" \
         -H "Upgrade-Insecure-Requests: 1" \
         -H "$USERAGENT" \
         -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" \
         -H "Accept-Language: en-US,en;q=0.9" \
         --compressed \
         "$RESOLVEURL" \
         > resolve.zip

    mkdir -p $out
    unzip resolve.zip -d $out
  '';
}

@alexanderwatanabe
Copy link
Contributor

nothing to add, just could really use this!

@s-ol
Copy link
Contributor

s-ol commented Dec 9, 2020

Is anyone aware of whose phone number that is in the AUR package?

@lambdadog a quick search brings up this: https://fakenumber.org/generator-us/202-555-0194

202 555 0194 is a fake telephone number. Avoid unintentionally using real phone numbers by selecting from our range of fictitious telephone numbers. You can find other random phone numbers in the list below. Please note that all numbers generated by Fake Number, including 202 555 0194, are fake so won't work for phone number verification.
...
Fake Number's phone numbers are recommended for drama use, such as those involving TV shows and radio entertainment, however you can also use our random phone numbers when providing documented examples on websites or in printed literature. In addition, you'll probably find 202 555 0194 handy if you ever want to withhold private contact details when completing test surveys and registration forms.
...
Our data is provided to us by industry regulators, communications providers, and local authorities. Fake phone numbers randomly generated by Fake Number, such as 202 555 0194, are unallocated numbers that telephony companies cannot assign to customers under current legislation. This is to protect residents against the potential influx of phone calls that they may receive should their telephone numbers appear in a movie or film.

@sweber83
Copy link
Contributor

Had a go at patching the installer binary.
When patching the rpath, I don't get any more errors about missing libraries but the installer just quits with the following message:
Cannot open /tmp/.mount_mLFRH1/.DirIcon

What's also strange is, that ldd says, the file is not a dynamic executable but file says something different:
DaVinci_Resolve_16.2.7_Linux.run: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=9a300ab6a9914c96c3934a9edda2e3826d3dc5ee, stripped

The file command was run on the unpatched file.

Does anyone have an idea what's still going wrong?

Here's the derivation I'm building:

{ stdenv
, lib
, cacert
, curl
, fuse
, glib
, glibc
, gnused
, runCommandLocal
, targetPlatform
, unzip
, zlib
}:


stdenv.mkDerivation rec {
  pname = "davinci-resolve";
  version = "16.2.7-1";

  src = runCommandLocal "${pname}-src"
    rec {
      outputHashMode = "recursive";
      outputHashAlgo = "sha256";
      outputHash = "1bbj7ahz5gzcj5sh1a57a5xajbzyq6q71rahi49w3vwpk46bq3sw";

      impureEnvVars = lib.fetchers.proxyImpureEnvVars;

      nativeBuildInputs = [ curl gnused unzip ];

      # ENV VARS
      SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

      DOWNLOADID = "9b15a70f5ce1418686be3479612f1134";
      REFERID = "b86a2a4c7a3b4ebfafcc6765f7e3d3a5";
      SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";

      USERAGENT = builtins.concatStringsSep " " [
        "User-Agent: Mozilla/5.0 (X11; Linux ${targetPlatform.platform.kernelArch})"
        "AppleWebKit/537.36 (KHTML, like Gecko)"
        "Chrome/77.0.3865.75"
        "Safari/537.36"
      ];

      REQJSON = builtins.concatStringsSep "" [
        ''{''
        ''   "firstname": "Arch", ''
        ''   "lastname": "Linux", ''
        ''   "email": "someone@archlinux.org", ''
        ''   "phone": "202-555-0194", ''
        ''   "country": "us", ''
        ''   "state": "New York", ''
        ''   "city": "AUR", ''
        ''   "product": "DaVinci Resolve" ''
        ''}''
      ];

    } ''
    REQJSON="$(  printf '%s' "$REQJSON"   | sed 's/[[:space:]]\+/ /g')"
    USERAGENT="$(printf '%s' "$USERAGENT" | sed 's/[[:space:]]\+/ /g')"

    RESOLVEURL=$(curl \
         -s \
         -H 'Host: www.blackmagicdesign.com' \
         -H 'Accept: application/json, text/plain, */*' \
         -H 'Origin: https://www.blackmagicdesign.com' \
         -H "$USERAGENT" \
         -H 'Content-Type: application/json;charset=UTF-8' \
         -H "Referer: https://www.blackmagicdesign.com/support/download/$REFERID/Linux" \
         -H 'Accept-Encoding: gzip, deflate, br' \
         -H 'Accept-Language: en-US,en;q=0.9' \
         -H 'Authority: www.blackmagicdesign.com' \
         -H 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
         --data-ascii "$REQJSON" \
         --compressed \
         "$SITEURL")
    
    curl \
         --retry 3 --retry-delay 3 \
         -H "Host: sw.blackmagicdesign.com" \
         -H "Upgrade-Insecure-Requests: 1" \
         -H "$USERAGENT" \
         -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" \
         -H "Accept-Language: en-US,en;q=0.9" \
         --compressed \
         "$RESOLVEURL" \
         > resolve.zip

    mkdir -p $out
    unzip resolve.zip -d $out
  '';

  dontStrip = true;

  rpath = (lib.makeLibraryPath [ fuse glib glibc zlib ]);

  installPhase = ''
    mkdir -p $out/bin
    cp DaVinci_Resolve_16.2.7_Linux.run $out/bin
    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/DaVinci_Resolve_16.2.7_Linux.run
    patchelf --set-rpath ${rpath} $out/bin/DaVinci_Resolve_16.2.7_Linux.run
  '';
}

@timothee-haudebourg
Copy link
Contributor

Same problem here: the installer quits with Cannot open /tmp/.mount_XXXXXX/.DirIcon where XXXXXX is a random string.

@timothee-haudebourg
Copy link
Contributor

timothee-haudebourg commented Feb 2, 2021

The AUR package seems to extract the files directly from the installer instead of executing it:

bsdtar x -f ${_installer_binary} -C "${pkgdir}/opt/${_pkgname}"

...but I'm not sure how that's supposed to work, since it is not an archive file? when I do it on my side a get an expected:

bsdtar: Error opening archive: Unrecognized archive format

I think I'm missing something here...

@timothee-haudebourg
Copy link
Contributor

Nevermind, bsdtar works on the unpatched installer.

@timothee-haudebourg
Copy link
Contributor

Now I'm able to start resolve, but it crashes right away:

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.
16.2.4 (#016) Linux/Clang
Main thread starts: FA63A5C0
resolve: AppConfig.cpp:180: void AppConfig::LoadAllSiteInfo(): Assertion `m_SiteEnabledIdx > 0' failed.


==========[CRASH DUMP]==========
Please send this to support:

#TIME Wed Feb  3 00:38:42 2021 - Uptime 00:00:00 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v16.2.4.016 (Linux/Clang)

DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x54c7689]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f8be43]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libpthread.so.0(+0x12ee0) [0x7f14fe0a3ee0]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(gsignal+0xca) [0x7f14fb95f08a]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(abort+0x114) [0x7f14fb949528]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(+0x2240f) [0x7f14fb94940f]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(+0x30a02) [0x7f14fb957a02]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f75f47]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f7451f]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f73dc8]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x2b03fe0]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x24c7a69]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x24c796e]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f89fcd]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f6fbad]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(__libc_start_main+0xed) [0x7f14fb94ac7d]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f6ee0d]
Signal Number = 6

================================
resolve: AppConfig.cpp:180: void AppConfig::LoadAllSiteInfo(): Assertion `m_SiteEnabledIdx > 0' failed.


==========[CRASH DUMP]==========
Please send this to support:

#TIME Wed Feb  3 00:38:42 2021 - Uptime 00:00:00 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v16.2.4.016 (Linux/Clang)

DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x54c7689]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f8be43]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libpthread.so.0(+0x12ee0) [0x7f14fe0a3ee0]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(gsignal+0xca) [0x7f14fb95f08a]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(abort+0x114) [0x7f14fb949528]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(+0x2240f) [0x7f14fb94940f]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(+0x30a02) [0x7f14fb957a02]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f75f47]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f7451f]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f73dc8]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1fadc1e]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f8c08e]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libpthread.so.0(+0x12ee0) [0x7f14fe0a3ee0]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(gsignal+0xca) [0x7f14fb95f08a]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(abort+0x114) [0x7f14fb949528]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(+0x2240f) [0x7f14fb94940f]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(+0x30a02) [0x7f14fb957a02]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f75f47]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f7451f]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f73dc8]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x2b03fe0]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x24c7a69]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x24c796e]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f89fcd]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f6fbad]
/nix/store/aqq6367snc1zh3fs1pc4j4zm5h80vkkz-glibc-2.31/lib/libc.so.6(__libc_start_main+0xed) [0x7f14fb94ac7d]
DaVinci_Resolve_16.2.4_Linux/opt/bin/resolve() [0x1f6ee0d]
Signal Number = 6

@timothee-haudebourg
Copy link
Contributor

Seems like it is a curl related bug for some reason: https://bbs.archlinux.org/viewtopic.php?id=261752

@jshcmpbll
Copy link
Member

jshcmpbll commented Feb 2, 2021

Can you post your nix file? Just curious what you did to get it to work(ish) @timothee-haudebourg

@timothee-haudebourg
Copy link
Contributor

Unfortunately I'm fairly new to NixOS so I don't know how to write a package. For now I'm doing it "by hand". I just have a nix file to setup a shell with all the dependencies:

{ pkgs ? import <nixpkgs> {} }:

with pkgs; mkShell {
	buildInputs = [
		libGLU
		libGL
		xorg.libXxf86vm
		xorg.libSM
		xorg.libXext
		xorg.libICE
		xorg.libX11
		xorg.xkeyboardconfig
		freetype
		libxml2
		librsvg
		libuuid
		expat
		alsaLib
		libtool
		bzip2
		ocl-icd
		stdenv.cc.cc.lib
	];
	
	QT_XKB_CONFIG_ROOT="${xorg.xkeyboardconfig}/share/X11/xkb";
}

I also use the result of the following expression to configure the RPATH (I'm not patching, I'm using the LD_LIBRARY_PATH variable):

with pkgs; lib.makeLibraryPath [ libGLU libGL xorg.libXxf86vm xorg.libSM xorg.libXext xorg.libICE xorg.libX11 freetype libxml2 librsvg libuuid expat alsaLib libtool bzip2 ocl-icd stdenv.cc.cc.lib ]

This gives my an environment in which I can patch and execute resolve after extracting it from the .run file using bsdtar (which is provided by the libarchive package).

@timothee-haudebourg
Copy link
Contributor

I tried with the latest DaVinci Resolve 16, and there is still the curl issue. Now that DR 17 is out I don't think it will be patched. As for DR 17, the bsdtar trick on the installer doesn't work anymore, and I've been unable to run the installer:

execv error: No such file or directory

@alexanderwatanabe
Copy link
Contributor

random thought here, but maybe it would be easier to package .deb version resolve rather than the original davinci release? https://www.danieltufvesson.com/makeresolvedeb

@lambdadog
Copy link
Contributor

@alexanderwatanabe I'd be surprised if that didn't use the same functionality of being able to unpack the installer using bsdtar that we've seen in the arch build (and as such would be broken on DR17), but if it works it might definitely be worth investigation.

@alexanderwatanabe
Copy link
Contributor

alexanderwatanabe commented Mar 4, 2021

Looking at the bash script they use to turn the blackmagic download into a .deb, it looks like since ver15 the file has been a self-extracting archive? Only version 15 uses "xorriso" to extract the package?

edit: sorry I think I confused the installer for the file you download from blackmagic. leaving this up in case that's not the case >_<

@lambdadog
Copy link
Contributor

lambdadog commented Mar 9, 2021

re: the bsdtar issues, it looks like the updated version of the AUR package is just running the installer binary with some flags. Obviously this becomes more difficult using Nix, but definitely shouldn't be impossible if we setup LD_LIBRARY_PATH correctly (or use patchelf).

As a result don't think not being able to use bsdtar should be much of an issue for further progress.

@jue89
Copy link
Contributor

jue89 commented Jun 15, 2021

As proposed I started to create a derivation using the installer of Davinci Resolve. But I got stuck because patchelf is complaining about a library Davinci is shipped with:

setting RPATH to: /nix/store/qk7d0b379cac7nik2shvhjx5isxs02x0-davinci-resolve-17.2.1/libs:/nix/store/54klr10i53jdfgn7322mzgza6wsai0q8-gcc-10.3.0-lib/lib/../lib64
patchelf: maximum file size exceeded
Command failed: patchelf --set-rpath /nix/store/qk7d0b379cac7nik2shvhjx5isxs02x0-davinci-resolve-17.2.1/libs:/nix/store/54klr10i53jdfgn7322mzgza6wsai0q8-gcc-10.3.0-lib/lib/../lib64 /nix/store/qk7d0b379cac7nik2shvhjx5isxs02x0-davinci-resolve-17.2.1/libs/libcudnn_cnn_infer.so.8
builder for '/nix/store/7x8039igzsvjvrrn68055g2wyp19d1gi-davinci-resolve-17.2.1.drv' failed with exit code 1
error: build of '/nix/store/7x8039igzsvjvrrn68055g2wyp19d1gi-davinci-resolve-17.2.1.drv' failed

Has anyone an idea how to fix this?

My current state:

davinci-resolve/default.nix
{ stdenv
, lib
, cacert
, curl
, runCommandLocal
, targetPlatform
, unzip
, appimage-run
, autoPatchelfHook
, addOpenGLRunpath
, libGLU
, alsaLib
, xlibs
}:

stdenv.mkDerivation rec {
  pname = "davinci-resolve";
  version = "17.2.1";

  nativeBuildInputs = [ unzip appimage-run autoPatchelfHook addOpenGLRunpath ];

  # Pretty sure, there are missing dependencies ...
  buildInputs = [ alsaLib libGLU xlibs.libXxf86vm ];

  src = runCommandLocal "${pname}-src.zip"
    rec {
      outputHashMode = "recursive";
      outputHashAlgo = "sha256";
      outputHash = "1wp45g21h76fymsw9qygqmaqbqpnzfb79b4sk5g5nsriyns09qz8";

      impureEnvVars = lib.fetchers.proxyImpureEnvVars;

      nativeBuildInputs = [ curl ];

      # ENV VARS
      SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

      DOWNLOADID = "3256e3339ca7410bae00f875716512b5";
      REFERID = "7bdd5d639e6b408ea98ac17504ff94f7";
      SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";

      USERAGENT = builtins.concatStringsSep " " [
        "User-Agent: Mozilla/5.0 (X11; Linux ${targetPlatform.linuxArch})"
        "AppleWebKit/537.36 (KHTML, like Gecko)"
        "Chrome/77.0.3865.75"
        "Safari/537.36"
      ];

      REQJSON = ''
        {
          "firstname": "Arch",
          "lastname": "Linux",
          "email": "someone@archlinux.org",
          "phone": "202-555-0194",
          "country": "us",
          "state": "New York",
          "city": "AUR",
          "product": "DaVinci Resolve"
        }
      '';

    } ''
    RESOLVEURL=$(curl \
      -s \
      -H 'Host: www.blackmagicdesign.com' \
      -H 'Accept: application/json, text/plain, */*' \
      -H 'Origin: https://www.blackmagicdesign.com' \
      -H "$USERAGENT" \
      -H 'Content-Type: application/json;charset=UTF-8' \
      -H "Referer: https://www.blackmagicdesign.com/support/download/$REFERID/Linux" \
      -H 'Accept-Encoding: gzip, deflate, br' \
      -H 'Accept-Language: en-US,en;q=0.9' \
      -H 'Authority: www.blackmagicdesign.com' \
      -H 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
      --data-ascii "$REQJSON" \
      --compressed \
      "$SITEURL")

    curl \
      --retry 3 --retry-delay 3 \
      -H "Host: sw.blackmagicdesign.com" \
      -H "Upgrade-Insecure-Requests: 1" \
      -H "$USERAGENT" \
      -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" \
      -H "Accept-Language: en-US,en;q=0.9" \
      --compressed \
      "$RESOLVEURL" \
      > $out
  '';

  # The unpack phase won't generate a directory
  setSourceRoot = ''
    sourceRoot=$PWD
  '';

  installPhase = ''
    runHook preInstall

    export HOME=$PWD/home
    mkdir -p $HOME

    mkdir -p $out
    appimage-run ./DaVinci_Resolve_${version}_Linux.run -i -y -n -C $out

    runHook postInstall
  '';

  dontStrip = true;

  postFixup = ''
    for program in $out/bin/*; do
      isELF "$program" || continue
      addOpenGLRunpath "$program"
    done
  ''
}

@hyperfekt
Copy link
Contributor

That problem has been encountered before and seems to be a known issue with patchelf: NixOS/patchelf#62 (comment)

@jue89
Copy link
Contributor

jue89 commented Jun 15, 2021

That problem has been encountered before and seems to be a known issue with patchelf: NixOS/patchelf#62 (comment)

So, waiting for a working patchelf is the only possibility to make things working?

Sry for dumb questions but I'm very new to nix.

@tobiasBora
Copy link
Contributor

There are at least two possible workarounds : using buildFHS or similar to fake a FHS distribution (no more patchelf), this post apparently had a working solution back then https://discourse.nixos.org/t/fixup-phase-cant-find-libcuda-so-1-build-abort-how-to-provide-dummy-libcuda-so-1/9541/8

The second solution is maybe to use a patched patchelf that keeps more space using the values provided here NixOS/patchelf#62 (comment)

@flexagoon
Copy link
Contributor

flexagoon commented Sep 13, 2021

@jue89 the patchelf issue seems to be fixed. Can you try that again?

@InternetUnexplorer
Copy link
Contributor

Is anyone aware of whose phone number that is in the AUR package? Should we just copy the info there blindly, or?

According to fakenumber.org it's a fake phone number, so I think you could probably copy it (or another number from that site) without any problems. I could be wrong, though!

@stuebinm
Copy link
Contributor

stuebinm commented Sep 17, 2021

Just gave this a try. Using @jue89's derivation without the auto-patchelf hook together with buildFHSUserenv (and a wrapper to manually add davinci-resolve itself to LD_LIBRARY_PATH – not sure if there's a better way, I'm new to the whole wrapping applications thing) I am able to run resolve and it even creates a window, but then crashes immediately afterwards. Output:

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.
17.2.1.0012 Linux/Clang x86_64
Main thread starts: 80EEA680
log4cxx: setFile(./logs/rollinglog.txt,true) call failed.
log4cxx: IO Exception : status code = 2
0x7f6a80eea680 | Undefined            | INFO  | 2021-09-17 16:32:13,070 | --------------------------------------------------------------------------------
log4cxx: No output stream or file set for the appender named [RollLogAppender].
0x7f6a80eea680 | Undefined            | INFO  | 2021-09-17 16:32:13,070 | Loaded log config from /home/stuebinm/.local/share/DaVinciResolve/configs/log-conf.xml
0x7f6a80eea680 | Undefined            | INFO  | 2021-09-17 16:32:13,070 | --------------------------------------------------------------------------------

Looks as if it either can't open or create a file that it expects to be present, though I'm not sure why – it should have write permissions, but then I'm not very familiar with any of these c++ libs. Maybe it needs to be executed in some pre-defined directory?

As for patchelf: I wanted to try using it with the version from patchelf master (by just overriding the src on patchelf in nixpkgs master, since that appears to not yet be updated), but that just failed to build and I'm not really sure how to fix it.

My current state:

{ stdenv
, lib
, cacert
, curl
, runCommandLocal
, targetPlatform
, unzip
, appimage-run
, autoPatchelfHook
, addOpenGLRunpath
, libGLU
, alsaLib
, xlibs
, buildFHSUserEnv
, bash
, writeText
}:
let davinci = ();# jue89's derivation goes here; I cut it to keep things short(ish)
in
buildFHSUserEnv {
  name = "davinci-resolve";
  targetPkgs = pkgs: with pkgs; [
    librsvg libGLU libGL xlibs.libICE xlibs.libSM xlibs.libXxf86vm
    udev opencl-headers alsa-lib
    xlibs.libX11 xlibs.libXext expat
    zlib libuuid bzip2 libtool ocl-icd 
  ];

  runScript = "${bash}/bin/bash ${
    writeText "davinci-wrapper" 
    ''cd /tmp; echo $PWD; LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${davinci}/libs ${davinci}/bin/resolve''
  }";
}

@s-ol
Copy link
Contributor

s-ol commented Sep 17, 2021

Looks as if it either can't open or create a file that it expects to be present, though I'm not sure why – it should have write permissions, but then I'm not very familiar with any of these c++ libs. Maybe it needs to be executed in some pre-defined directory?

your crashlog mentions a relative path ./logs/rollinglog.txt. It seems likely that the call involving it would fail if there is no directory logs in the CWD when starting resolve.

Here's the desktop file from ArchLinux:

[Desktop Entry]
Version=1.0
Type=Application
Name=DaVinci Resolve
GenericName=DaVinci Resolve
Comment=Revolutionary new tools for editing, visual effects, color correction and professional audio post production, all in a single application!
Path=/opt/resolve/
Exec=/opt/resolve/bin/resolve %U
Terminal=false
MimeType=application/x-resolveproj;
Icon=/opt/resolve/graphics/DV_Resolve.png
StartupNotify=true
Name[en_US]=DaVinci Resolve
StartupWMClass=resolve

indeed it specifies /opt/resolve/, which has a logs subdirectory:

ls /opt/resolve/
 AppRun                  'DaVinci Resolve Panels Setup'   filelist.txt    libs        'Resolve Disk Database'
 bin                      Developer                       Fusion          logs         scripts
 BlackmagicRAWPlayer      docs                            GPUCache        LUT          share
 BlackmagicRAWSpeedTest   DolbyVision                     graphics        Media       'Technical Documentation'
 configs                  easyDCP                         installer       Onboarding   UI_Resource
 Control                  Fairlight                       installer.dat   plugins

However on ArchLinux, I can actually just run /opt/resolve/bin/resolve from anywhere, and it seems like it will change the working directory to /opt/resolve itself. In Nix the derivation output is read-only though, so that may also be where things are going wrong?

@tobiasBora
Copy link
Contributor

tobiasBora commented Sep 17, 2021 via email

@tfmoraes
Copy link
Contributor

tfmoraes commented Nov 7, 2021

I have some progress in davinci resolve:

{ stdenv
, lib
, cacert
, curl
, runCommandLocal
, targetPlatform
, unzip
, appimage-run
, addOpenGLRunpath
, libGLU
, alsaLib
, xlibs
, buildFHSUserEnv
, bash
, writeText
, ocl-icd
, xkeyboard_config
, glib
, libarchive
}:
let
  davinci = (
    stdenv.mkDerivation rec {
      pname = "davinci-resolve";
      version = "17.4.1";

      nativeBuildInputs = [ unzip appimage-run addOpenGLRunpath ];

      # Pretty sure, there are missing dependencies ...
      buildInputs = [ alsaLib libGLU xlibs.libXxf86vm ];

      src = runCommandLocal "${pname}-src.zip"
        rec {
          outputHashMode = "recursive";
          outputHashAlgo = "sha256";
          outputHash = "sha256-FLGX9/FW3SU9kTSYsiwSb4KvzJOlkc6qPswAHqZ9Wz8=";

          impureEnvVars = lib.fetchers.proxyImpureEnvVars;

          nativeBuildInputs = [ curl ];

          # ENV VARS
          SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";

          DOWNLOADID = "46b47253f7974ba0a0e5ba7bc66786f2";
          REFERID = "7421f21592e34ea3ab84b448ab51a666";
          SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";

          USERAGENT = builtins.concatStringsSep " " [
            "User-Agent: Mozilla/5.0 (X11; Linux ${targetPlatform.linuxArch})"
            "AppleWebKit/537.36 (KHTML, like Gecko)"
            "Chrome/77.0.3865.75"
            "Safari/537.36"
          ];

          REQJSON = ''
            {
              "firstname": "Arch",
              "lastname": "Linux",
              "email": "someone@archlinux.org",
              "phone": "202-555-0194",
              "country": "us",
              "state": "New York",
              "city": "AUR",
              "product": "DaVinci Resolve"
            }
          '';

        } ''
        RESOLVEURL=$(curl \
          -s \
          -H 'Host: www.blackmagicdesign.com' \
          -H 'Accept: application/json, text/plain, */*' \
          -H 'Origin: https://www.blackmagicdesign.com' \
          -H "$USERAGENT" \
          -H 'Content-Type: application/json;charset=UTF-8' \
          -H "Referer: https://www.blackmagicdesign.com/support/download/$REFERID/Linux" \
          -H 'Accept-Encoding: gzip, deflate, br' \
          -H 'Accept-Language: en-US,en;q=0.9' \
          -H 'Authority: www.blackmagicdesign.com' \
          -H 'Cookie: _ga=GA1.2.1849503966.1518103294; _gid=GA1.2.953840595.1518103294' \
          --data-ascii "$REQJSON" \
          --compressed \
          "$SITEURL")

        curl \
          --retry 3 --retry-delay 3 \
          -H "Host: sw.blackmagicdesign.com" \
          -H "Upgrade-Insecure-Requests: 1" \
          -H "$USERAGENT" \
          -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" \
          -H "Accept-Language: en-US,en;q=0.9" \
          --compressed \
          "$RESOLVEURL" \
          > $out
      '';

      # The unpack phase won't generate a directory
      setSourceRoot = ''
        sourceRoot=$PWD
      '';

      installPhase = ''
        runHook preInstall

        export HOME=$PWD/home
        mkdir -p $HOME

        mkdir -p $out
        appimage-run ./DaVinci_Resolve_${version}_Linux.run -i -y -n -C $out

        mkdir -p $out/{configs,DolbyVision,easyDCP,Fairlight,GPUCache,logs,Media,"Resolve Disk Database",.crashreport,.license,.LUT}
        runHook postInstall
      '';

      dontStrip = true;

      postFixup = ''
              for program in $out/bin/*; do
                isELF "$program" || continue
                addOpenGLRunpath "$program"
              done

              for program in $out/libs/*; do
                isELF "$program" || continue
                if [[ "$program" != *"libcudnn_cnn_infer"* ]];then
                  echo $program
                  addOpenGLRunpath "$program"
                fi
              done
      '';
    }
  );
in
buildFHSUserEnv {
  name = "davinci-resolve";
  targetPkgs = pkgs: with pkgs; [
    librsvg
    libGLU
    libGL
    xlibs.libICE
    xlibs.libSM
    xlibs.libXxf86vm
    udev
    opencl-headers
    alsa-lib
    xlibs.libX11
    xlibs.libXext
    expat
    zlib
    libuuid
    bzip2
    libtool
    ocl-icd
    glib
    libarchive
  ];

  runScript = "${bash}/bin/bash ${
    writeText "davinci-wrapper"
    ''
    export QT_XKB_CONFIG_ROOT="${xkeyboard_config}/share/X11/xkb"
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${davinci}/libs
    ${davinci}/bin/resolve
    ''
  }";
}

@garrett-hopper
Copy link

The package @tfmoraes shared seems to work well with Davinci opening and displaying the project select screen, however it crashes soon after that with the following appearing in ~/.local/share/DaVinciResolve/crash_archive.txt

#TIME Sat Dec  4 16:58:40 2021 - Uptime 00:00:02 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v17.4.1.0004 (Linux/Clang x86_64)
#BMD_ARCHITECTURE x86_64
#BMD_BUILD_UUID 254c9474-fc7e-4bd1-8cc2-2eda11ec6601
#BMD_GIT_COMMIT 89abac8875e8bcbb2c29a852b2599b31b4ec544f
#BMD_UTIL_VERSION 17.4.1.0004
#OS Linux

/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/bin/resolve() [0x410aea9]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/bin/resolve() [0x410a30b]
/usr/lib/libpthread.so.0(+0x12ef0) [0x7fc34ed37ef0]
/usr/lib/libGLX.so.0(+0xa435) [0x7fc32733c435]
/usr/lib/libGLX.so.0(glXQueryExtensionsString+0x12) [0x7fc3273356b2]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(+0xe24c5f) [0x7fc2bd95cc5f]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(_ZN6Fusion9GLTools3D4InitEPNS_9FusionDocE+0x10d) [0x7fc2bd975c6d]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(+0xac90ae) [0x7fc2bd6010ae]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(_ZN6Fusion3Job3RunEiRNS_7TagListE+0x15d) [0x7fc2bd70c8ad]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(_ZN6Fusion10JobManager6DoWorkEbb+0x189) [0x7fc2bd70bc89]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(+0xbd3999) [0x7fc2bd70b999]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/bin/../libs/Fusion/fusionscript.so(+0x1c6650) [0x7fc34cd17650]
/nix/store/mf3a2mnilgkmvac8jj1g84jipgjfqxaw-davinci-resolve-17.4.1/bin/../libs/Fusion/fusionscript.so(+0x1f10b5) [0x7fc34cd420b5]
/usr/lib/libpthread.so.0(+0x8d3e) [0x7fc34ed2dd3e]
/usr/lib/libc.so.6(clone+0x3f) [0x7fc3332a043f]
Signal Number = 11

I haven't had much luck debugging the segfault so far. Any guidance is appreciated. 🙂

@TheSirC
Copy link

TheSirC commented Dec 17, 2021

I can confirm the findings of @garrett-hopper ! Exactly the same behavior. At least it is reproducible 😉

@jshcmpbll
Copy link
Member

jshcmpbll commented Dec 22, 2021

Also seeing the same but in ~/.local/share/DaVinciResolve/logs/ResolveDebug.txt I see the following errors:

cat ResolveDebug.txt | grep ERROR
0x7f2d23a826c0 | GPUDetect            | ERROR | 2021-12-22 12:44:04,229 | X11 logs not found.
0x7f2d23a826c0 | GPUDetect            | ERROR | 2021-12-22 12:44:04,238 | No Main Display GPU found and no monitors found to match, defaulting to gpu:3f233b50.1d30eeab.
0x7f2cc97fe640 | IO                   | ERROR | 2021-12-22 12:44:04,535 | The selected Nvidia GPU has no decode capability
0x7f2c902a7640 | SyManager            | ERROR | 2021-12-22 12:44:04,612 | Failed to connect to panel socket
0x7f2c902a7640 | SyManager            | ERROR | 2021-12-22 12:44:04,612 | DRIVER: open /var/tmp/davinci_socket failed
0x7f2c902a7640 | SyManager            | ERROR | 2021-12-22 12:44:06,314 | Failed to connect to panel socket
0x7f2c664d2640 | UI                   | ERROR | 2021-12-22 12:44:08,273 | UiAutoUpdateController: Failed to get response from server (responseCode:2) (httpStatus:-1) (response:)
0x7f2d23a826c0 | UI                   | ERROR | 2021-12-22 12:44:09,641 | Failed to find text 'Apple ProRes' in combo-box
0x7f2d23a826c0 | UI                   | ERROR | 2021-12-22 12:44:09,649 | Failed to find text 'Apple ProRes' in combo-box
0x7f2d23a826c0 | UI                   | ERROR | 2021-12-22 12:44:09,649 | Failed to find text 'Apple ProRes' in combo-box
0x7f2d23a826c0 | UI                   | ERROR | 2021-12-22 12:44:09,650 | Failed to find text 'Apple ProRes' in combo-box
0x7f2cad5ae640 | CrashReport          | ERROR | 2021-12-22 12:44:09,991 | Compress() : Failed to add file:/home/*********/.local/share/DaVinciResolve/configs/UI.preset to archive.

Im assuming panel socket is in reference to the physical panel one can get from Blackmagic. I see some udev stuff sprinkled throughout the AUR PKGBUILD such as this:

prepare()
{
        # Remove udev rules (The official installer does not remove these files. This leads to the conflict "exists in the file system".)
        confiles=$(find /usr/lib/udev/rules.d -name 75-davincipanel.rules -o -name 75-sdx.rules 2> /dev/null | awk -F/ '{print $NF}'
               find /opt/resolve/configs -name log-conf.xml -o -name config.dat 2> /dev/null | awk -F/ '{print $NF}'
               )
        if [ "${confiles}" ]; then
                echo -e "\033[1m==> The file(s) $(echo ${confiles} | xargs | sed 's/ /, /g') already exist in your filesystem.\033[0m"
                echo -e "\033[1m==> This can lead to a conflict and the installation will fail.\033[0m"
                echo -e "\033[1m==> Please restart the installation with the --overwrite option.\033[0m"
        fi
}

@davidak
Copy link
Member Author

davidak commented Dec 23, 2021

@tfmoraes can you create a draft PR to make testing easier?

Has anyone tested it with AMD GPU?

@s-ol
Copy link
Contributor

s-ol commented Dec 23, 2021

@davidak I have no experience testing nixpkgs versions/branches and overall little Nix knowledge, but if someone can give me a step-by-step I'm happy to give it a try on my recent AMD Thinkpad with its comparatively powerful integrated graphics.

@jshcmpbll
Copy link
Member

jshcmpbll commented Dec 25, 2021

@s-ol Here is an example init PR for a new application/package - func init

I recommend taking a look at the files changed as that covers the basic requirements. Make sure you add the package into the nixpkgs/pkgs/top-level/all-packages.nix in alphabetical order and place the default.nix in nixpkgs/pkgs/applications/video.. Not sure what we would call the pkgs directory. Probably just davinci-resolve but thats up to you.

In your PR I would recommend giving credit to those that posted most the code here ( e.g. tfmoraes ) and including a link to this issue so to connect it to the PR for visibility.

Highly recommend reviewing the Contributing Guide

Lastly, this meta block is required as you will see in the contributing guide.
You will need to add yourself to the maintainers list since you haven't maintained a package yet. Same deal as the all-packages.nix, alphabetical order and instructions can be found commented out at the top of the file.

To test building the application in your PR you would simply go to the root of the repository and run nix-build -A $package_name. $package_name should align with whatever you call it in all-packages.nix

Feel free to correct anything I missed @davidak

Edit: Also, if you just want to do this to test on a AMD GPU then ignore the maintainer/meta block instructions I added. I made the assumption you were asking how to contribute but then I realized you might have just been asking for instructions on how to build the package locally..

@davidak
Copy link
Member Author

davidak commented Dec 25, 2021

I can reproduce the crash. The project selection was shown, but when i create a new project it hangs and i see the crash in logs.

==========[CRASH DUMP]==========
#TIME Sat Dec 25 17:25:12 2021 - Uptime 00:00:11 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v17.4.1.0004 (Linux/Clang x86_64)
#BMD_ARCHITECTURE x86_64
#BMD_BUILD_UUID 254c9474-fc7e-4bd1-8cc2-2eda11ec6601
#BMD_GIT_COMMIT 89abac8875e8bcbb2c29a852b2599b31b4ec544f
#BMD_UTIL_VERSION 17.4.1.0004
#OS Linux

/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x410aea9]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x410a30b]
/usr/lib/libpthread.so.0(+0x12ef0) [0x7ff77c642ef0]
/usr/lib/libGLX.so.0(+0xa435) [0x7ff754c47435]
/usr/lib/libGLX.so.0(glXQueryExtensionsString+0x12) [0x7ff754c406b2]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(+0xe24c5f) [0x7ff7261adc5f]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(_ZN6Fusion9GLTools3D4InitEPNS_9FusionDocE+0x10d) [0x7ff7261c6c6d]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(+0xac90ae) [0x7ff725e520ae]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(_ZN6Fusion3Job3RunEiRNS_7TagListE+0x15d) [0x7ff725f5d8ad]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(_ZN6Fusion10JobManager6DoWorkEbb+0x189) [0x7ff725f5cc89]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so(+0xbd3999) [0x7ff725f5c999]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/../libs/Fusion/fusionscript.so(+0x1c6650) [0x7ff77a622650]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/../libs/Fusion/fusionscript.so(+0x1f10b5) [0x7ff77a64d0b5]
/usr/lib/libpthread.so.0(+0x8d3e) [0x7ff77c638d3e]
/usr/lib/libc.so.6(clone+0x3f) [0x7ff760bab43f]
Signal Number = 11

================================

Here is the full ResolveDebug.txt

Maybe this is relevant?

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, xcb.

I added xorg.libxcb to the chroot and now the program opens. I updated the PR. Please test if it works.

Screenshot from 2021-12-25 18-19-06

@davidak
Copy link
Member Author

davidak commented Dec 25, 2021

Screenshot from 2021-12-25 18-50-19

It says the video files have "No Video" and MKV or OGV files are not even detected. Maybe all codecs are missing?
It also does not play any audio.

@jshcmpbll
Copy link
Member

Im seeing waveforms and getting audio for some of my MOV h264 videos. MKV is commonly H264 and reading up some on Davinci for linux I see there is a lack of support for H264 in the free version, only in the studio version. Is that the codec your videos are using? @davidak

@tfmoraes
Copy link
Contributor

@davidak thanks for submitting the PR to add Davince Resolve!

@jshcmpbll
Copy link
Member

jshcmpbll commented Dec 25, 2021

Screen Shot 2021-12-25 at 1 54 28 PM

Seems to be working as expected for me. Nvidia GPU. Had to transcode my h264 videos to DNxHD -

ffmpeg -y -i A001_004_20211217.MOV -f mov -vcodec dnxhd -vf "scale=1920:1080,fps=30" -profile:v dnxhr_hq 004_dnxhd.MOV

I cant speak for performance as I'm remotely accessing my nix machine but it seems pretty good. Also, using gausian blur effect to hide the video content so.. I can confirm thats working as well 😄

Hats off you two and the amazing work! @tfmoraes @davidak

Edit: another note, I was seeing online that AAC isnt supported for Linux so that might be why you weren't getting audio. Might need to transcode it.

Also, the Linux port does not support AAC audio. You will need to separate that out into an independent AIFF or WAVE file in order to use it in Resolve.
https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=78058

@flexagoon
Copy link
Contributor

@jshcmpbll oh wow, that's great! Although I guess it can't be considered fully ready since h264 doesnt work

@jshcmpbll
Copy link
Member

@flexagoon Unfortunately thats expected for the free version 😞 I guess paid studio ships with support for h264.. Im guessing its something to do with licensing and MIGHT be fixed in the future but thats just speculation (and a little hope) from me..

Something to note, H264 is a terrible codec for video editing anyways and it would be better to work off mezzanine codecs but that workflow isn't the easiest for those wanting to quickly get videos from their cameras native codec to the editor..

@flexagoon
Copy link
Contributor

@jshcmpbll oh wait, I didn't see that it's a limitation of the free version and not a NixOS issue. Does this mean that the packaging is finally complete and the PR can be submitted now?

@jshcmpbll
Copy link
Member

@flexagoon I think it's pretty close. The open PR right now will need a maintainer added and maybe some other tweaks needed for AMD support.. not sure but hopefully @s-ol can test it out with their AMD GPU and give us an update after the holidays. 🤞

I'll do some further testing on Monday with it to see if there are any issues to report

@InternetUnexplorer
Copy link
Contributor

Using Resolve with an AMD GPU on Linux is… complicated at the moment. ROCm currently does not work with it and has not for a while; one needs to use the AMDGPU-PRO driver for OpenCL, which (last I checked) isn't in Nixpkgs. Fortunately the recent release seems to have made packaging it easier if someone wants to do that in the future, but I don't think it's worth holding up this PR for.

FWIW, I did try to run the PR myself (I have an RX 6800). The program did not start unfortunately.

(very incomplete) NixOS configuration (nixos-unstable)
{ config, lib, pkgs, ... }: {
  boot.kernelPackages = pkgs.linuxPkgs_zen;
  boot.initrd.kernelModules = [ "amdgpu" ];

  services.xserver.enable = true;
  services.xserver.desktopManager.plasma5.enable = true;

  hardware.opengl = {
    enable = true;
    setLdLibraryPath = true;
    driSupport32Bit = true;
  };

  hardware.opengl.extraPackages = with pkgs; [
    rocm-opencl-icd
    rocm-opencl-runtime
  ];

  # ...
}
Output of clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP (3305.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback 
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     gfx1030
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 2.0 
  Driver Version                                  3305.0 (HSA1.1,LC)
  Device OpenCL C Version                         OpenCL C 2.0 
  Device Type                                     GPU
  Device Board Name (AMD)                         Device 73bf
  Device PCI-e ID (AMD)                           0x73bf
  Device Topology (AMD)                           PCI-E, 0000:0b:00.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               30
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                32
  SIMD instruction width (AMD)                    1
  Max clock frequency                             2475MHz
  Graphics IP (AMD)                               10.3
  Device Partition                                (core)
    Max number of sub-devices                     30
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Preferred work group size (AMD)                 256
  Max work group size (AMD)                       1024
  Preferred work group size multiple (kernel)     32
  Wavefront width (AMD)                           32
  Preferred / native vector sizes                 
    char                                                 4 / 4       
    short                                                2 / 2       
    int                                                  1 / 1       
    long                                                 1 / 1       
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 1       
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             No
    Round to nearest                              No
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              17163091968 (15.98GiB)
  Global free memory (AMD)                        16760832 (15.98GiB) 16760832 (15.98GiB)
  Global memory channels (AMD)                    8
  Global memory banks per channel (AMD)           4
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           14588628168 (13.59GiB)
  Unified memory for Host and Device              No
  Shared Virtual Memory (SVM) capabilities        (core)
    Coarse-grained buffer sharing                 Yes
    Fine-grained buffer sharing                   Yes
    Fine-grained system sharing                   No
    Atomics                                       No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Preferred alignment for atomics                 
    SVM                                           0 bytes
    Global                                        0 bytes
    Local                                         0 bytes
  Max size for global variable                    14588628168 (13.59GiB)
  Preferred total size of global vars             17163091968 (15.98GiB)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             29631
    Max size for 1D images from buffer            134217728 pixels
    Max 1D or 2D image array size                 8192 images
    Base address alignment for 2D image buffers   256 bytes
    Pitch alignment for 2D image buffers          256 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             16384x16384x8192 pixels
    Max number of read image args                 128
    Max number of write image args                8
    Max number of read/write image args           64
  Max number of pipe args                         16
  Max active pipe reservations                    16
  Max pipe packet size                            1703726280 (1.587GiB)
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Local memory size per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max number of constant args                     8
  Max constant buffer size                        14588628168 (13.59GiB)
  Preferred constant buffer size (AMD)            16384 (16KiB)
  Max size of kernel argument                     1024
  Queue properties (on host)                      
    Out-of-order execution                        No
    Profiling                                     Yes
  Queue properties (on device)                    
    Out-of-order execution                        Yes
    Profiling                                     Yes
    Preferred size                                262144 (256KiB)
    Max size                                      8388608 (8MiB)
  Max queues on device                            1
  Max events on device                            1024
  Prefer user sync for interop                    Yes
  Number of P2P devices (AMD)                     0
  Profiling timer resolution                      1ns
  Profiling timer offset since Epoch (AMD)        0ns (Wed Dec 31 16:00:00 1969)
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  No
    Number of async queues (AMD)                  8
    Max real-time compute queues (AMD)            8
    Max real-time compute units (AMD)             30
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_image2d_from_buffer cl_khr_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p cl_amd_assembly_program 

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx1030
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx1030
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx1030
ResolveDebug.txt
0x7fc6e47816c0 | Main                 | INFO  | 2021-12-25 16:47:57,075 | Running DaVinci Resolve v17.4.1.0004 (Linux/Clang x86_64)
0x7fc6e47816c0 | Main                 | INFO  | 2021-12-25 16:47:57,075 | BMD_BUILD_UUID 254c9474-fc7e-4bd1-8cc2-2eda11ec6601
0x7fc6e47816c0 | Main                 | INFO  | 2021-12-25 16:47:57,075 | BMD_GIT_COMMIT 89abac8875e8bcbb2c29a852b2599b31b4ec544f
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,075 | Starting GPUDetect 1.2-a3
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 | Done in 106 ms.
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 | Detected System:
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |   - OS: Linux NixOS 22.05 (Quokka)
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |   - Model: ASUSTeK ROG STRIX X470-I GAMING
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |   - System ID: 54af30b5cd5d4360bc085ca6bcffc99a
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |   - CPU: AMD Ryzen 7 2700X Eight-Core, 16 threads, x86-64
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |   - RAM: 7.3 GiB used of 62.8 GiB
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 | Detected 1 GPUs:
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |   - "AMD Device 73bf" (gpu:79134433.44ad5459) <- Main Display GPU
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |     Discrete, 383 MiB used of 16.0 GiB VRAM, PCI:11:0.0
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 |     Matches: OpenCL, XOrg
0x7fc6e47816c0 | GPUDetect            | INFO  | 2021-12-25 16:47:57,182 | Detected 1 monitors:
0x7fc6e47816c0 | Main.GPUConfig       | INFO  | 2021-12-25 16:47:57,182 | Compute API set to automatic, defaulting to OpenCL.
0x7fc6e47816c0 | Main.GPUConfig       | INFO  | 2021-12-25 16:47:57,182 | Selected compute API: OpenCL
0x7fc6e47816c0 | Main.GPUConfig       | INFO  | 2021-12-25 16:47:57,182 | Automatic GPU Selection:
0x7fc6e47816c0 | Main.GPUConfig       | INFO  | 2021-12-25 16:47:57,182 |   - "AMD Device 73bf" (gpu:79134433.44ad5459)
0x7fc6e47816c0 | IO                   | INFO  | 2021-12-25 16:47:57,182 | RED InitializeSdk with library path at /nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs
0x7fc6e47816c0 | IO                   | INFO  | 2021-12-25 16:47:57,210 | R3DAPI 8.0.4-52A07 (20210708 Lx64S) R3DSDK 8.0.4-52A07 (20210708 Lx64D C3B1) RED OPENCL 8.0.4-50959 (20210708) [/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/] init is successful
0x7fc6e47816c0 | Main                 | INFO  | 2021-12-25 16:47:57,210 | 0 RED rocket cards available
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
0x7fc6e47816c0 | Main                 | INFO  | 2021-12-25 16:47:57,210 | Decklink model name: '', version: ''
0x7fc6e47816c0 | DVIP                 | INFO  | 2021-12-25 16:47:57,210 | DVIP release/17.4.1 build 6 (18220cf89913c0157b01513791bf5b2454d6aa75). Release, version 17.4.1.
0x7fc5beffd640 | IO                   | INFO  | 2021-12-25 16:47:57,211 | Using DNxHR library v2.7.0.10r
0x7fc5bf7fe640 | Fusion               | INFO  | 2021-12-25 16:47:57,379 | Fusion Build: 6ed4fd1d_0007 (Oct 28 2021 15:53:36)
0x7fc5beffd640 | IO                   | INFO  | 2021-12-25 16:47:57,382 | IO codec library load completed in 171 ms.
0x7fc5a6577640 | Fusion               | INFO  | 2021-12-25 16:47:57,382 | fusionsystem: = "/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so"
0x7fc5a6577640 | Fusion               | INFO  | 2021-12-25 16:47:57,385 | FusionLibs: = "/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/"
0x7fc5a6577640 | Fusion               | INFO  | 2021-12-25 16:47:57,386 | UserData:   = "/home/alex/.local/share/DaVinciResolve/Fusion"
0x7fc5a6577640 | Fusion               | INFO  | 2021-12-25 16:47:57,386 | Profiles:   = "UserData:Profiles/"
Cannot find libdbus-1 in your system to resolve symbol 'dbus_get_local_machine_id'.


==========[CRASH DUMP]==========
#TIME Sat Dec 25 16:47:57 2021 - Uptime 00:00:00 (hh:mm:ss)
#PROGRAM_NAME DaVinci Resolve v17.4.1.0004 (Linux/Clang x86_64)
#BMD_ARCHITECTURE x86_64
#BMD_BUILD_UUID 254c9474-fc7e-4bd1-8cc2-2eda11ec6601
#BMD_GIT_COMMIT 89abac8875e8bcbb2c29a852b2599b31b4ec544f
#BMD_UTIL_VERSION 17.4.1.0004
#OS Linux

/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x410aea9]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x410a30b]
/usr/lib/libpthread.so.0(+0x12ef0) [0x7fc70c890ef0]
/usr/lib/libc.so.6(gsignal+0xca) [0x7fc6f0d60baa]
/usr/lib/libc.so.6(abort+0xff) [0x7fc6f0d4b523]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Core.so.5(+0xa80d6) [0x7fc6f30d30d6]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Core.so.5(_ZNK14QMessageLogger5fatalEPKcz+0xbd) [0x7fc6f30d45e1]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5DBus.so.5(+0x6425e) [0x7fc700e9125e]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5DBus.so.5(_ZN15QDBusConnection14localMachineIdEv+0x1f) [0x7fc700e4381f]
/nix/store/mrv5kzyvdkb7nl9ccdm8jr91r5qfhrmp-qtbase-5.15.3-bin/lib/qt-5.15.3/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so(+0xb2a2) [0x7fc6c757c2a2]
/nix/store/mrv5kzyvdkb7nl9ccdm8jr91r5qfhrmp-qtbase-5.15.3-bin/lib/qt-5.15.3/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so(+0xef4a) [0x7fc6c757ff4a]
/nix/store/mrv5kzyvdkb7nl9ccdm8jr91r5qfhrmp-qtbase-5.15.3-bin/lib/qt-5.15.3/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so(+0xf78e) [0x7fc6c758078e]
/nix/store/mrv5kzyvdkb7nl9ccdm8jr91r5qfhrmp-qtbase-5.15.3-bin/lib/qt-5.15.3/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so(+0xf9e4) [0x7fc6c75809e4]
/nix/store/mrv5kzyvdkb7nl9ccdm8jr91r5qfhrmp-qtbase-5.15.3-bin/lib/qt-5.15.3/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so(+0x1505a) [0x7fc6c758605a]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Gui.so.5(_ZN28QPlatformInputContextFactory6createERK7QString+0x166) [0x7fc6f3a79516]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5XcbQpa.so.5(_ZN15QXcbIntegration10initializeEv+0x39) [0x7fc5ad3d61c9]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Gui.so.5(_ZN22QGuiApplicationPrivate20eventDispatcherReadyEv+0x24) [0x7fc6f3a8a794]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Core.so.5(_ZN23QCoreApplicationPrivate4initEv+0x6bd) [0x7fc6f32bea6d]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Gui.so.5(_ZN22QGuiApplicationPrivate4initEv+0x19) [0x7fc6f3a84359]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/libQt5Widgets.so.5(_ZN19QApplicationPrivate4initEv+0x9) [0x7fc6f28306b9]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x21818b8]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x2144cd8]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x214184f]
/usr/lib/libc.so.6(__libc_start_main+0xd0) [0x7fc6f0d4c780]
/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve() [0x2140d3b]
Signal Number = 6

================================
0x7fc6e47816c0 | CrashReport          | ERROR | 2021-12-25 16:47:57,757 | Compress() : Failed to add file:/home/alex/.local/share/DaVinciResolve/configs/UI.preset to archive.
0x7fc6e47816c0 | CrashReport          | ERROR | 2021-12-25 16:47:57,757 | Compress() : Failed to add file:/home/alex/.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

I would be happy to continue testing stuff though, please let me know if there's anything else you'd like me to try.

P.S. @s-ol, Resolve is highly demanding and so I'd be really surprised if you manage to get it working with integrated graphics, but don't let me discourage you from trying if you want to give it a go! (I could be wrong after all!)

@peti
Copy link
Member

peti commented Dec 26, 2021

@flexagoon Unfortunately thats expected for the free version 😞 I guess paid studio ships with support for h264.

The free version supports H.264 just fine. It's H.265 support that requires the Studio version. If H.264 does not work out of the box, then this is definitely a problem with the way Resolve is packaged.

@InternetUnexplorer
Copy link
Contributor

The supported codec list for Resolve 16 (I can't seem to find a supported codec list for version 17 for some reason) lists H.264 as Studio only, and I remember this being a limitation back when I used it on Arch. Was this changed in version 17?

@jshcmpbll
Copy link
Member

jshcmpbll commented Dec 26, 2021

Yeah, I would LOVE to be wrong but I haven't seen anything online saying it supports h264 - this article also says it is not supported Now that I'm posting the link to it I see the original title was for 15 and it was just updated.. maybe the writer was unaware of the change too?

Hoping @peti has personal experience with it because that would be awesome

@InternetUnexplorer
Copy link
Contributor

Yeah, the H.264 limitation is Linux only for some reason.

@peti
Copy link
Member

peti commented Dec 26, 2021

I found out what's going on. According to https://beginnersapproach.com/davinci-resolve-frequently-asked-questions/#DaVinci-Resolve-Use-MP4, the free version of Resolve supports H.264, like I thought, but only on MacOS and Windows! The Linux version does not support h.264, indeed.

@s-ol
Copy link
Contributor

s-ol commented Dec 26, 2021

Thanks @davidak for the PR, that made it quite easy to test. It builds and launches fine, but once the loading popup reaches "ready" it glitched out the GPU somehow, here's dmesg from when it started:

[97980.234821] process 'store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/bin/resolve' started with execu
table stack
[98007.406956] amdgpu: qcm fence wait loop timeout expired
[98007.406962] amdgpu: The cp might be in an unrecoverable state due to an unsuccessful queues preemption
[98007.406964] amdgpu: Failed to evict process queues
[98007.406965] amdgpu: Failed to quiesce KFD
[98007.406973] amdgpu 0000:07:00.0: amdgpu: GPU reset begin!
[98007.490827] [drm] free PSP TMR buffer
[98007.519035] amdgpu 0000:07:00.0: amdgpu: MODE2 reset
[98007.519108] amdgpu 0000:07:00.0: amdgpu: GPU reset succeeded, trying to resume
[98007.519238] [drm] PCIE GART of 1024M enabled.
[98007.519241] [drm] PTB located at 0x000000F400900000
[98007.519257] [drm] VRAM is lost due to GPU reset!
[98007.519480] [drm] PSP is resuming...
[98007.539524] [drm] reserve 0x400000 from 0xf41f800000 for PSP TMR
[98007.625826] amdgpu 0000:07:00.0: amdgpu: RAS: optional ras ta ucode is not available
[98007.634852] amdgpu 0000:07:00.0: amdgpu: RAP: optional rap ta ucode is not available
[98007.634858] amdgpu 0000:07:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
[98007.634862] amdgpu 0000:07:00.0: amdgpu: SMU is resuming...
[98007.635289] amdgpu 0000:07:00.0: amdgpu: SMU is resumed successfully!
[98007.841210] [drm] kiq ring mec 2 pipe 1 q 0
[98007.841867] [drm] DMUB hardware initialized: version=0x01010019
[98008.087137] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[98008.087193] [drm] JPEG decode initialized successfully.
[98008.087198] amdgpu 0000:07:00.0: amdgpu: ring gfx uses VM inv eng 0 on hub 0
[98008.087200] amdgpu 0000:07:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[98008.087201] amdgpu 0000:07:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[98008.087202] amdgpu 0000:07:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
[98008.087203] amdgpu 0000:07:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
[98008.087204] amdgpu 0000:07:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
[98008.087205] amdgpu 0000:07:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
[98008.087206] amdgpu 0000:07:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
[98008.087207] amdgpu 0000:07:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
[98008.087208] amdgpu 0000:07:00.0: amdgpu: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
[98008.087209] amdgpu 0000:07:00.0: amdgpu: ring sdma0 uses VM inv eng 0 on hub 1
[98008.087209] amdgpu 0000:07:00.0: amdgpu: ring vcn_dec uses VM inv eng 1 on hub 1
[98008.087210] amdgpu 0000:07:00.0: amdgpu: ring vcn_enc0 uses VM inv eng 4 on hub 1
[98008.087211] amdgpu 0000:07:00.0: amdgpu: ring vcn_enc1 uses VM inv eng 5 on hub 1
[98008.087212] amdgpu 0000:07:00.0: amdgpu: ring jpeg_dec uses VM inv eng 6 on hub 1
[98008.089331] amdgpu 0000:07:00.0: amdgpu: recover vram bo from shadow start
[98008.089334] amdgpu 0000:07:00.0: amdgpu: recover vram bo from shadow done
[98008.089348] amdgpu 0000:07:00.0: amdgpu: GPU reset(1) succeeded!
[98008.089374] [drm] Skip scheduling IBs!
[98008.089394] [drm] Skip scheduling IBs!
[98008.089403] [drm] Skip scheduling IBs!
[98008.089418] [drm] Skip scheduling IBs!
[98008.089422] [drm] Skip scheduling IBs!
[98008.089439] [drm] Skip scheduling IBs!

[98008.089460] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98008.100157] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98008.101004] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98008.116833] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98008.245337] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98008.245695] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98009.075922] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98009.076235] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98009.076859] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98009.083089] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98017.089954] amdgpu: qcm fence wait loop timeout expired
[98017.089959] amdgpu: The cp might be in an unrecoverable state due to an unsuccessful queues preemption
[98017.090523] amdgpu 0000:07:00.0: amdgpu: GPU reset begin!
[98017.171928] [drm] free PSP TMR buffer
[98017.200019] amdgpu 0000:07:00.0: amdgpu: MODE2 reset
[98017.200346] amdgpu 0000:07:00.0: amdgpu: GPU reset succeeded, trying to resume
[98017.200467] [drm] PCIE GART of 1024M enabled.
[98017.200470] [drm] PTB located at 0x000000F400900000
[98017.200839] [drm] PSP is resuming...
[98017.220872] [drm] reserve 0x400000 from 0xf41f800000 for PSP TMR
[98017.299172] amdgpu 0000:07:00.0: amdgpu: RAS: optional ras ta ucode is not available
[98017.307610] amdgpu 0000:07:00.0: amdgpu: RAP: optional rap ta ucode is not available
[98017.307612] amdgpu 0000:07:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
[98017.307615] amdgpu 0000:07:00.0: amdgpu: SMU is resuming...
[98017.307845] amdgpu 0000:07:00.0: amdgpu: SMU is resumed successfully!
[98017.513825] [drm] kiq ring mec 2 pipe 1 q 0
[98017.514417] [drm] DMUB hardware initialized: version=0x01010019
[98017.759535] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[98017.759584] [drm] JPEG decode initialized successfully.
[98017.759588] amdgpu 0000:07:00.0: amdgpu: ring gfx uses VM inv eng 0 on hub 0
[98017.759590] amdgpu 0000:07:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[98017.759592] amdgpu 0000:07:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[98017.759593] amdgpu 0000:07:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
[98017.759594] amdgpu 0000:07:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
[98017.759595] amdgpu 0000:07:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
[98017.759596] amdgpu 0000:07:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
[98017.759597] amdgpu 0000:07:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
[98017.759597] amdgpu 0000:07:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
[98017.759599] amdgpu 0000:07:00.0: amdgpu: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
[98017.759600] amdgpu 0000:07:00.0: amdgpu: ring sdma0 uses VM inv eng 0 on hub 1
[98017.759601] amdgpu 0000:07:00.0: amdgpu: ring vcn_dec uses VM inv eng 1 on hub 1
[98017.759602] amdgpu 0000:07:00.0: amdgpu: ring vcn_enc0 uses VM inv eng 4 on hub 1
[98017.759602] amdgpu 0000:07:00.0: amdgpu: ring vcn_enc1 uses VM inv eng 5 on hub 1
[98017.759603] amdgpu 0000:07:00.0: amdgpu: ring jpeg_dec uses VM inv eng 6 on hub 1
[98017.761713] amdgpu 0000:07:00.0: amdgpu: recover vram bo from shadow start
[98017.761716] amdgpu 0000:07:00.0: amdgpu: recover vram bo from shadow done
[98017.761730] amdgpu 0000:07:00.0: amdgpu: GPU reset(2) succeeded!

At this point my sway/wayland session was also mostly unresponsive. I switched to a different virtual console. I noticed that there it would now also periodically spit out these messages (as in dmesg), number of "callbacks surpressed" and lines varying:

[98099.628256] amdgpu_cs_ioctl: 1717 callbacks suppressed
[98099.628260] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.631175] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.634180] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.637359] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.640424] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.643853] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.647539] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.650553] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.653748] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!
[98099.657031] [drm:amdgpu_cs_ioctl [amdgpu]] *ERROR* Failed to initialize parser -125!

Once I killed resolve I could leave the wayland session via the sway UI, but until I did so the screen was covered with many visual glitches (this started to happen after re-rentering from vconsole).

@s-ol
Copy link
Contributor

s-ol commented Dec 26, 2021

Huh, I just started it again to capture the resolve output log, and this time it launched right away without problems.

Before I even imported any clips, I got a "GPU Memory full" message - that's integrated graphics for you I guess.

Start of DebugLog.txt

0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,210 | Running DaVinci Resolve v17.4.1.0004 (Linux/Clang x86_64)
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,210 | BMD_BUILD_UUID 254c9474-fc7e-4bd1-8cc2-2eda11ec6601
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,210 | BMD_GIT_COMMIT 89abac8875e8bcbb2c29a852b2599b31b4ec544f
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,210 | Starting GPUDetect 1.2-a3
0x7ffbad2026c0 | GPUDetect            | ERROR | 2021-12-26 14:58:49,480 | X11 logs not found.
0x7ffbad2026c0 | GPUDetect            | ERROR | 2021-12-26 14:58:49,481 | No Main Display GPU found and no monitors found to match, defaulting to gpu:e28b6a0b.7a43db71.
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 | Done in 270 ms.
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 | Detected System:
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |   - OS: Linux NixOS 21.11 (Porcupine)
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |   - Model: LENOVO 20UES00L00
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |   - System ID: 60d1c5ee91124ff1907c74f4dff52994
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |   - CPU: AMD Ryzen 7 PRO 4750U with Radeon Graphics, 16 threads, x86-64
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |   - RAM: 2.5 GiB used of 30.7 GiB
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 | Detected 1 GPUs:
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |   - "AMD Device 1636" (gpu:e28b6a0b.7a43db71) <- Main Display GPU
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |     Discrete, 12 MiB used of 512 MiB VRAM, PCI:7:0
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 |     Matches: OpenCL
0x7ffbad2026c0 | GPUDetect            | INFO  | 2021-12-26 14:58:49,481 | Detected 1 monitors:
0x7ffbad2026c0 | Main.GPUConfig       | INFO  | 2021-12-26 14:58:49,481 | Compute API set to automatic, defaulting to OpenCL.
0x7ffbad2026c0 | Main.GPUConfig       | INFO  | 2021-12-26 14:58:49,481 | Selected compute API: OpenCL
0x7ffbad2026c0 | Main.GPUConfig       | INFO  | 2021-12-26 14:58:49,481 | Automatic GPU Selection:
0x7ffbad2026c0 | Main.GPUConfig       | INFO  | 2021-12-26 14:58:49,481 |   - "AMD Device 1636" (gpu:e28b6a0b.7a43db71)
0x7ffbad2026c0 | IO                   | INFO  | 2021-12-26 14:58:49,481 | RED InitializeSdk with library path at /nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs
0x7ffbad2026c0 | IO                   | INFO  | 2021-12-26 14:58:49,526 | R3DAPI 8.0.4-52A07 (20210708 Lx64S) R3DSDK 8.0.4-52A07 (20210708 Lx64D C3B1) RED OPENCL 8.0.4-50959 (20210708) [/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/] init is successful
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,526 | 0 RED rocket cards available
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,526 | Decklink model name: '', version: ''
0x7ffbad2026c0 | DVIP                 | INFO  | 2021-12-26 14:58:49,526 | DVIP release/17.4.1 build 6 (18220cf89913c0157b01513791bf5b2454d6aa75). Release, version 17.4.1.
0x7ffb87b79640 | IO                   | INFO  | 2021-12-26 14:58:49,527 | Using DNxHR library v2.7.0.10r
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
0x7ffb8837a640 | Fusion               | INFO  | 2021-12-26 14:58:49,836 | Fusion Build: 6ed4fd1d_0007 (Oct 28 2021 15:53:36)
0x7ffb87b79640 | IO                   | INFO  | 2021-12-26 14:58:49,836 | IO codec library load completed in 309 ms.
0x7ffa709fb640 | Fusion               | INFO  | 2021-12-26 14:58:49,839 | fusionsystem: = "/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/libfusionsystem.so"
0x7ffa709fb640 | Fusion               | INFO  | 2021-12-26 14:58:49,844 | FusionLibs: = "/nix/store/2akb5vgiiacsincfq2k43y0m6i398vl4-davinci-resolve-17.4.1/libs/Fusion/"
0x7ffa709fb640 | Fusion               | INFO  | 2021-12-26 14:58:49,844 | UserData:   = "/home/s-ol/.local/share/DaVinciResolve/Fusion"
0x7ffa709fb640 | Fusion               | INFO  | 2021-12-26 14:58:49,844 | Profiles:   = "UserData:Profiles/"
Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,892 | Finished loading Application style sheet
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,914 | Show splash screen
0x7ffbad2026c0 | Main                 | INFO  | 2021-12-26 14:58:49,914 | Show splash screen message: Starting Up
ldconfig: Can't open cache file /nix/store/563528481rvhc5kxwipjmg6rqrl95mdx-glibc-2.33-56/etc/ld.so.cache
: No such file or directory
ldconfig: Can't open cache file /nix/store/563528481rvhc5kxwipjmg6rqrl95mdx-glibc-2.33-56/etc/ld.so.cache
: No such file or directory
Local.Speed.Debug switched OFF - ''
0x7ffa4dce1640 | LeManager            | INFO  | 2021-12-26 14:58:50,134 | 521, 29
0x7ffbad2026c0 | BtCommon             | INFO  | 2021-12-26 14:58:50,134 | Memory config: reserved=6000M pinned=4000M log=0
0x7ffbad2026c0 | BtCommon             | INFO  | 2021-12-26 14:58:50,135 | Using default pooled memory manager
0x7ffa4d4e0640 | BtCommon             | INFO  | 2021-12-26 14:58:50,135 | BtResourceManager Process Thread Started
0x7ffbad2026c0 | SyManager            | INFO  | 2021-12-26 14:58:50,145 | Total: 20, NumDtThreads: 8, NumComms: 0, NumSites: 1

0x7ffbad2026c0 | SyManager | INFO | 2021-12-26 14:58:50,145 | Lookaheads -> playback = 20, record = 20, stop = 2

later part that repeats often

0x7ffa1f47c640 | GPU.SingleBoardMgr   | INFO  | 2021-12-26 15:13:12,861 | Flushing GPU memory...
0x7ffa1f47c640 | UI.GLTexPool         | INFO  | 2021-12-26 15:13:12,861 | Released 31 MiB in 2 unused textures.
0x7ffa1f47c640 | DVIP                 | ERROR | 2021-12-26 15:13:12,869 | Failed to register OpenGL object for OpenCL interop: CL_MEM_OBJECT_ALLOCATION_FAILURE.
0x7ffa1f47c640 | UI.GLTexPool         | ERROR | 2021-12-26 15:13:12,869 | Failed to register OpenGL texture to compute API.
0x7ffa1f47c640 | UI.GLInterop         | ERROR | 2021-12-26 15:13:12,869 | MainPlayer: Failed to un-map texture, Handle62 is unknown.
0x7ffa1f47c640 | GPU.SingleBoardMgr   | ERROR | 2021-12-26 15:13:12,869 | Out-of-memory exception caught, purging memory: Packer OpenGL interop failed.
0x7ffa1f47c640 | GPU.SingleBoardMgr   | INFO  | 2021-12-26 15:13:12,869 | Flushing GPU memory...
0x7ffa1f47c640 | UI.GLTexPool         | INFO  | 2021-12-26 15:13:12,869 | Released 0 MiB in 0 unused textures.
0x7ffa1f47c640 | DVIP                 | ERROR | 2021-12-26 15:13:12,874 | Failed to register OpenGL object for OpenCL interop: CL_MEM_OBJECT_ALLOCATION_FAILURE.
0x7ffa1f47c640 | UI.GLTexPool         | ERROR | 2021-12-26 15:13:12,874 | Failed to register OpenGL texture to compute API.
0x7ffa1f47c640 | UI.GLInterop         | ERROR | 2021-12-26 15:13:12,874 | MainPlayer: Failed to un-map texture, Handle62 is unknown.
0x7ffa1f47c640 | GPU.SingleBoardMgr   | ERROR | 2021-12-26 15:13:12,874 | Out-of-memory exception caught, purging memory: Packer OpenGL interop failed.
0x7ffa1f47c640 | GPU.SingleBoardMgr   | INFO  | 2021-12-26 15:13:12,894 | Flushing GPU memory...
0x7ffa1f47c640 | UI.GLTexPool         | INFO  | 2021-12-26 15:13:12,894 | Released 15 MiB in 1 unused textures.
0x7ffa1f47c640 | DVIP                 | ERROR | 2021-12-26 15:13:12,900 | Failed to register OpenGL object for OpenCL interop: CL_MEM_OBJECT_ALLOCATION_FAILURE.
0x7ffa1f47c640 | UI.GLTexPool         | ERROR | 2021-12-26 15:13:12,900 | Failed to register OpenGL texture to compute API.
0x7ffa1f47c640 | UI.GLInterop         | ERROR | 2021-12-26 15:13:12,900 | MainPlayer: Failed to un-map texture, Handle63 is unknown.
0x7ffa1f47c640 | GPU.SingleBoardMgr   | ERROR | 2021-12-26 15:13:12,900 | Out-of-memory exception caught, purging memory: Packer OpenGL interop failed.
0x7ffa1f47c640 | GPU.SingleBoardMgr   | INFO  | 2021-12-26 15:13:12,900 | Flushing GPU memory...
0x7ffa1f47c640 | UI.GLTexPool         | INFO  | 2021-12-26 15:13:12,900 | Released 0 MiB in 0 unused textures.
0x7ffa1f47c640 | DVIP                 | ERROR | 2021-12-26 15:13:12,904 | Failed to register OpenGL object for OpenCL interop: CL_MEM_OBJECT_ALLOCATION_FAILURE.
0x7ffa1f47c640 | UI.GLTexPool         | ERROR | 2021-12-26 15:13:12,904 | Failed to register OpenGL texture to compute API.
0x7ffbad2026c0 | UI.GLInterop         | ERROR | 2021-12-26 15:13:12,904 | MainPlayer: Failed to get texture, Handle61 is unknown.
0x7ffbad2026c0 | UI                   | ERROR | 2021-12-26 15:13:12,904 | Invalid handle, and failed to get previous texture.
0x7ffa1f47c640 | UI.GLInterop         | ERROR | 2021-12-26 15:13:12,904 | MainPlayer: Failed to un-map texture, Handle63 is unknown.
0x7ffbad2026c0 | UI                   | WARN  | 2021-12-26 15:13:12,904 | Unable to submit frame to GPU scopes, legacy OpenGL uploads not supported (Player Model).

As for video decoding, I'm not sure how to check whether hardware acceleration is working properly. On some starts it does decode a DNxHD video, but then crash shortly after seeking around in it (bad crash - screen freezes, have to reboot computer).
On another start instead it would not decode the video at all, it just remained gray and playback would be stopped (red play icon) both in the media and in the timeline view.

@davidak
Copy link
Member Author

davidak commented Dec 26, 2021

I have updated the PR to the latest version 17.4.3! The issues for me are still the same.

I tested with ProRes 422 videos recorded with Atomos Ninja V and i just see a still frame with glitched colors. I also get the "Your GPU memory is full." error. My GPU has 8 GB VRAM.

Screenshot from 2021-12-26 19-33-07

Screenshot from 2021-12-26 19-33-44

That issue might be related to the open source amdgpu driver.

one needs to use the AMDGPU-PRO driver for OpenCL, which (last I checked) isn't in Nixpkgs

There is a PR that needs testers #151019

I opened a document to get some structure into the testing results: https://pad.nixnet.services/5sPJSxnyTm65W9dtku1sfg
Please add your test results there with hardware/software combinations.

When the package works as expected, we should also package the studio version in a modular way. Maybe we can get a license key and dongle for free for the maintainers to test it.

Also, the license is quiet cheap for what you get. Totally worth it if you regularly use it or use it professionally. There are licenses on ebay for about 200 euro and 265 euro is the cheapest offer from online stores (https://geizhals.de/blackmagic-design-davinci-resolve-studio-17-deutsch-pc-a2440969.html). At some point this year it was at 200 euro! There is also the bundle with the SPEED EDITOR controller https://www.toneart-shop.de/blackmagic-design-davinci-resolve-speed-editor.html?utm_source=geizhals&utm_medium=cpc&utm_campaign=geizhals. I might buy a license when i decide to use it.

@lambdadog
Copy link
Contributor

This discussion should be moved to #152113.

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

Successfully merging a pull request may close this issue.