Bambu-studio: any working method?

I’m trying to get Bambu Studio running on a new system. I haven’t run it on NixOS before. So far, I’ve tried the version in nixpkgs unstable, which crashes when logging in (this seems to be related to the network plugin as the backtrace goes through there, see bambu-studio: failed to install network library · Issue #391622 · NixOS/nixpkgs · GitHub for some more info). I’ve also tried the version in flatpak on flathub, which is a newer version of Bambu Studio. This one lets me log in, and can see my printer, but it doesn’t actually render anything in the preview, whether loading a .3mf from their online models or a local STL.

Actually, the nixpkgs one doesn’t render stuff either. It’s worth noting that I’m on Wayland, in Niri specifically, using xwayland-satellite.

Anyone have a working setup for this program on NixOS, or for using the bambu printers over the network with some other slicer?

It works on my laptop with nixos 24.11. I haven’t updated in a while and it’s on nixpkgs revision 11415c7ae8539d6292f2928317ee7a8410b28bb9

Not at home right now so I can’t do more to help right now.

I got the Flatpak version running, with some munging of env vars via Flatseal. Reading through No 3D view · Issue #4669 · bambulab/BambuStudio · GitHub may be helpful if you’re having the same issue.

I’d still love to get the one from nixpkgs to run, though. It’s clearly a different issue, though it wouldn’t surprise me if it also has the same 3D rendering issues.

1 Like

Yeah, installing the flatpak worked for me too.

Same here. I’ve tried to rollback to about 2 weeks ago, but rerunning everything still leads to the same error message:

loading network module at /home/andy/.config/BambuStudio/plugins/libbambu_networking.so
after dlopen, network_module is 0xd69b1a0
free(): invalid pointer
Aborted (core dumped)

I’ve removed the plugin directory under ~/.config and it simply redownloads leading to the same result.

Do you know if there is a cached pacakge I could install from Hydra? When searching for bambu-studio I only get 10 results and none is older that 6 days :confused:

Can you share a hash of your libbambu_networking.so. I want to see if mine if different when I’m back home.

Sure!

$: sha256sum ~/.config/BambuStudio/plugins/libbambu_networking.so 
95a7e04aa833f1ae8889dd2d0631aaa5cb755748ff6ed70eabacc0dc22656b3f

$: sha512sum ~/.config/BambuStudio/plugins/libbambu_networking.so 
a5a12d58929b6e5fb911f39d7ea23bc2fc44e93a0188cb9f873bbb59ef78995b8a06542aca5f1b2a171db3929629cd9d82fc8d75b4c7cb9de9544903fc9e6b78

Ohno, they have a creative interpretation of the AGPL…

How come? I’m not sure I follow.

Does that mean we have no way to fix it from Nix?
Would it be possible to run with someone else’s plugin (.so file)?

Here a copy of the libraries which work on my system libbambu directory listing

There is some years old problem that BambuStudio is a for of PrusaSlider and that BambuLab doesn’t really respect the license terms. I didn’t really know that before and found out googling for this question.

Thanks for sharing. Sadly, it did not seem to work for me. Replacing my *.so files with yours leads to Bambu-Studio opening (the GUI opens fine), redownloading network_plugin, and then crashing again.

I ended up using a local overlay with some success:

bambu-studio = prev.bambu-studio.overrideAttrs (oldAttrs: {
version = “01.00.01.50”;
src = prev.fetchFromGitHub {
owner = “bambulab”;
repo = “BambuStudio”;
rev = “v01.00.01.50”;
hash = “sha256-7mkrPl2CQSfc1lRjl1ilwxdYcK5iRU//QGKmdCicK30=”;
};
});

I ended up doing an aggressive clean up as well so I’m not sure if the overlay alone is sufficient. The cleanup did cause me to lose some history and logged me out of Bambu Studio.

rm -rf ~/.cache/bambu-studio
rm ~/.local/share/bambu-studio
rm -rf ~/.config/BambuStudioBlockquote

1 Like

Just for noobs like me, you need to put that block into this kind of thing:

{ config, pkgs, ... }:
let
...
in
{
  nixpkgs.config = {
    # HERE
  };
  environment.systemPackages = with pkgs; [
	bambu-studio
        ...
  ];
};
...
}

Using home-manager, my config looks like shown below. I’m compiling “01.00.01.50” locally right now. Let’s see if that helps

{
  config,
  lib,
  pkgs,
  inputs,
  pkgs-unstable,
  ...
}:
{
  home.packages = with pkgs; [
    (bambu-studio.overrideAttrs (previousAttrs: {
      version = "01.00.01.50";
      src = fetchFromGitHub {
        owner = "bambulab";
        repo = "BambuStudio";
        rev = "v01.00.01.50";
        hash = "sha256-7mkrPl2CQSfc1lRjl1ilwxdYcK5iRU//QGKmdCicK30=";
      };
    }))

  ];
}

I’ve also tried to compile v2 locally to create a PR on the repo, but compilation fails and is SUPER slow - it always starts from a clean make, which makes trying to fix it a nightmare. I wish there was a way to resume a failed build using whatever the valid objects from the previous compilation attempt

I was getting the network plugin now to.
Switched to the BambuStudio flatpak. Not really something I wanted to do but it seems to work so far.

For anyone having the issue with nvidia drivers (and yes, weirdly enough, that includes the network plugin failing to install / crashing as @smolwaffle expected ), I solved my issue with an overlay, inspired by all the answers and clues given above :

  nixpkgs.overlays = [
    (final: prev: {
      bambu-studio = prev.bambu-studio.overrideAttrs (oldAttrs: {
        buildInputs = oldAttrs.buildInputs or [ ] ++ [ pkgs.makeWrapper ];
        postInstall = oldAttrs.postInstall or "" + ''
          wrapProgram $out/bin/bambu-studio \
             --set __GLX_VENDOR_LIBRARY_NAME mesa \
            --set __EGL_VENDOR_LIBRARY_FILENAMES "${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json" \
            --set MESA_LOADER_DRIVER_OVERRIDE zink \
            --set GALLIUM_DRIVER zink \
            --set WEBKIT_DISABLE_DMABUF_RENDERER 1
        '';
      });
    })
  ];

Be aware that implies recompiling the bambu-studio package and that takes quite some time ! (you should probably go get a coffee… or two… maybe more…)

I switched to OrcaSlicer. Not really what I wanted since I was happy with Bambu Studio but I gave it a go and it seems to work quite well. Same workflow, same presets, transition went without a hitch. Not really noticing any difference in ease of use or features.

Ahh, interesting - so that’s taking the same env vars that I’ve seen suggested (and that I’m currently using) for the flatpak, but passing them via a shell wrapper instead. I don’t fully understand the driver layering here.

To avoid rebuilding, it should be possible to take the outputs of the bambu-studio and either symlink or copy them into a new derivation, then wrap that. pkgs.symlinkJoin would allow it.

That said, I wonder if the changed derivation with those env vars would work on any system? If so, it might be a good thing to upstream in nixpkgs. Worth posting on bambu-studio: failed to install network library · Issue #391622 · NixOS/nixpkgs · GitHub as well.

Interestingly, my fix worked once but doesn’t anymore. Maybe I got lucky. My fix is not a fix, sorry for the misleading post.

Ah that explains it – just tried it. Thanks anyway, I now know it’s possible to modify a package without copying the package with overlays, so time well spent anyway.

Also @smolwaffle I forgot about OrcaSlicer. I think that’s the better option here anyway. Cheers for the prompt!