r/NixOS 2d ago

Blender crashes when using hip

I installed the "pkgs.pkgsRocm.blender" package to get hip support for blender, but whenever i try to use hip on my gpu with cycles blender just crashes, ive tried both opengl and vulkan and both crash. Heres my dotfiles repo for anyonew who wants to take a look to try and help. https://github.com/mc-724634/NixDotfiles

4 Upvotes

3 comments sorted by

2

u/SomeRedTeapot 1d ago

I forgot where I found this workaround, but the "fix" is to set LD_PRELOAD to rocm-comgr. I have an overlay for this in my config:

nixpkgs.overlays = [
  (final: prev: {
    blender-rocm = prev.symlinkJoin {
      name = "blender-rocm";
      paths = [ prev.pkgsRocm.blender ];

      nativeBuildInputs = [ prev.makeWrapper ];

      postBuild = ''
        wrapProgram $out/bin/blender --set LD_PRELOAD "${prev.rocmPackages.rocm-comgr}/lib/libamd_comgr.so.3"
      '';
    };
  })
];

Edit: it was from this issue: https://github.com/NixOS/nixpkgs/issues/530702

1

u/Alarming-Waltz-8808 1d ago

That worked, thanks! But hiprt doesnt work, is there a fix for that too?

2

u/SomeRedTeapot 1d ago

Haven't tried HIPRT so I don't know