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

🐧 Build for Linux #12

Closed
probonopd opened this issue Jul 16, 2022 · 392 comments
Closed

🐧 Build for Linux #12

probonopd opened this issue Jul 16, 2022 · 392 comments
Assignees
Labels
feature New feature or request

Comments

@probonopd
Copy link

probonopd commented Jul 16, 2022

Since BambuStudio is based on PrusaSlicer, could it be built for Linux (and FreeBSD) like PrusaSlicer can?

https://github.com/bambulab/BambuStudio/blob/master/doc/How%20to%20build%20-%20Linux%20et%20al.md

Maybe we could use https://github.com/supermerill/SuperSlicer/blob/master/BuildLinux.sh to build AppImage files for Linux?

@tapir
Copy link

tapir commented Jul 16, 2022

This is kinda deal breaker. There are lots of linux users in the maker space. Could we at least get a roadmap or official plan on linux support?

@probonopd
Copy link
Author

probonopd commented Jul 17, 2022

Getting src/nlohmann/detail/conversions/from_json.hpp:23:14: fatal error: filesystem: No such file or directory.

What am I doing wrong?

[ 14%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/ArcFitter.cpp.o
[ 14%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/BoundingBox.cpp.o
[ 15%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/BridgeDetector.cpp.o
[ 15%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/FaceDetector.cpp.o
[ 15%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/Brim.cpp.o
In file included from /home/runner/work/BambuStudio/BambuStudio/src/nlohmann/adl_serializer.hpp:6:0,
                 from /home/runner/work/BambuStudio/BambuStudio/src/nlohmann/json.hpp:51,
                 from /home/runner/work/BambuStudio/BambuStudio/src/libslic3r/Format/../GCode/ThumbnailData.hpp:6,
                 from /home/runner/work/BambuStudio/BambuStudio/src/libslic3r/Format/bbs_3mf.hpp:4,
                 from /home/runner/work/BambuStudio/BambuStudio/src/libslic3r/Model.hpp:18,
                 from /home/runner/work/BambuStudio/BambuStudio/src/libslic3r/FaceDetector.cpp:4:
/home/runner/work/BambuStudio/BambuStudio/src/nlohmann/detail/conversions/from_json.hpp:23:14: fatal error: filesystem: No such file or directory
     #include <filesystem>
              ^~~~~~~~~~~~

Full build log:
https://github.com/probonopd/BambuStudio/runs/7379382060?check_suite_focus=true#step:8:43411

Workflow (based on SuperSlicer):
https://github.com/probonopd/BambuStudio/blob/master/.github/workflows/ccpp_ubuntu.yml

Related?

Any help appreciated.

@Waffull
Copy link

Waffull commented Jul 18, 2022

Having no Linux build is pretty bad. Worse yet, no road map for one. A piece of software based on code that runs on a Linux, shouldn't be that hard to engineer.

@probonopd probonopd changed the title Build for Linux 🐧 Build for Linux Jul 18, 2022
@wuyifanfancy wuyifanfancy added the feature New feature or request label Jul 26, 2022
@Waffull
Copy link

Waffull commented Aug 9, 2022

Any update? This is a pretty huge bug, leaving Linux users out. Sitting here with a very expensive paperweight at this point!

@deftdawg
Copy link
Contributor

deftdawg commented Aug 9, 2022

I had a go at building, but got stuck at wxWidgets trying to link against -dep-name-NOTFOUND... Might be possible to get past that problem by bumping from v3.1.5 to v3.1.7 or v3.2.0...

Since building bambu-studio seems to require building virtually all the dependencies from source in the deps folder and that takes a long while on my laptop, I'm going to see how functional the Windows build runs under wine. It installs and starts at least.

image

Under wine (GE-proton7-28):

  • Blank Splash: you'll get the macOS known issue "setup wizard/splash screen blank on first run" from the previous version's release notes, close and reopen bambu-studio fixes the splash.
  • Webcam says FIXME: WMP on a Red background
  • Home screen is blank - either white or black depending on which tab you switch to it from

@deftdawg
Copy link
Contributor

deftdawg commented Aug 12, 2022

Under Wine doesn't work... Can't get past the issues I saw before, no option to login, nor does it detect the printer.

I spent a LOT of time the past two days and finally got bambuStudio to compile and link, unfortunately it core dumps immediately after the first dialog box. 😞

image

~/source/BambuStudio/build/package/bin$ ./bambu-studio --debug 5
[2022-08-12 00:33:26.041983] [0x00007f099043c940] [trace]   Initializing StaticPrintConfigs
[2022-08-12 00:33:26.049592] [0x00007f099043c940] [info]    finished setup params, argc=3

[2022-08-12 00:33:26.049639] [0x00007f099043c940] [info]    no action, start gui directly

[2022-08-12 00:33:26.049650] [0x00007f099043c940] [info]    run, normal mode, input_files size = 0
[2022-08-12 00:33:26.049653] [0x00007f099043c940] [info]    begin to launch BambuStudio GUI soon
Segmentation fault (core dumped)

@deftdawg
Copy link
Contributor

deftdawg commented Aug 13, 2022

The build work is now basically done with my PR.

We need someone with access to the bambu labs private repo to build and integrate the bambu_networking plugin which is missing from this repo. Maybe @YifanWuBambu, @lanewei120 or @StoneLiBambulab can assist in making that happen?

Without it we'll be stuck unable to communicate with the printer...

[2022-08-13 11:45:24.198648] [0x00007ff1ab318940] [trace]   Initializing StaticPrintConfigs
loading network module at /home/deftdawg/.BambuStudio/plugins/libbambu_networking.so
error, dlerror is /home/deftdawg/.BambuStudio/plugins/libbambu_networking.so: cannot open shared object file: No such file or directory
after dlopen, network_module is (nil)
Segmentation fault (core dumped)

@lhwei120
Copy link

The build work is now basically done with my PR.

We need someone with access to the bambu labs private repo to build and integrate the bambu_networking plugin which is missing from this repo. Maybe @YifanWuBambu, @lanewei120 or @StoneLiBambulab can assist in making that happen?

Without it we'll be stuck unable to communicate with the printer...

[2022-08-13 11:45:24.198648] [0x00007ff1ab318940] [trace]   Initializing StaticPrintConfigs
loading network module at /home/deftdawg/.BambuStudio/plugins/libbambu_networking.so
error, dlerror is /home/deftdawg/.BambuStudio/plugins/libbambu_networking.so: cannot open shared object file: No such file or directory
after dlopen, network_module is (nil)
Segmentation fault (core dumped)

great
we will build the linux plugins soon

anyway, without the plugins, the software should work except the networking operations

@tapir
Copy link

tapir commented Aug 14, 2022

@lhwei120 above error message suggests otherwise. It might be a good idea to have libbambu_networking.so as optional to be able to still use the slicer

@deftdawg
Copy link
Contributor

@lhwei120 above error message suggests otherwise. It might be a good idea to have libbambu_networking.so as optional to be able to still use the slicer

No I think he's right... I think it's seg faulting after that, like when it's trying to paint the UI or something... Gdb said in combobox::setfont and somewhere else when I commented out that function...

I didn't do a debug-symbol build and I'd need to figure out how to get VS Code to step a C++ program.

Unfortunately, I have some happy IRL stuff to deal with for a couple of days. I'll try to push up a podman Containerfile (basically same as a Dockerfile), so anyone who wants to have a go building would be able to give it a try.

@uncjgh
Copy link

uncjgh commented Aug 19, 2022

Not having a Linux build, preferably as an applimage to be distribution agnostic, is in my opinion criminal as it ignores the fact that there are hundreds if not thousands of Linux users in the maker space. And without access to a usable Linux build of the Studio software makes the X1 little more than a very expensive paperweight!

Bambu Lab should at least provide access to any missing deps so someone in the community could successfully create a Linux build of the Bambu Studio software.

@tapir
Copy link

tapir commented Aug 20, 2022

@deftdawg any chance we get a docker image to build it?

@deftdawg
Copy link
Contributor

deftdawg commented Aug 20, 2022

There is now a podman Containerfile (might also work as a Dockerfile if you rename it) in my branch, it can build the binary but packaging to AppImage fails due to wanting a kernel module that I don't think can be loaded inside a podman container (libfuse -- error see bottom). @probonopd I saw you're on some AppImage threads about the libfuse thing, if you have a solution for inside podman, please let me know.

sudo podman build . -t bambu-studio # This will build, but app image creation fails on libfuse

If we can resolve the AppImage fuse problem and complete the build, we should be able to get the appImage off the podman container with something like this:

sudo podman run --rm localhost/bambu-studio /bin/bash \
  -c 'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv

Alternatively, if you run the commands listed inside the Containerfile locally on an Ubuntu or Debian based-OS you should get an appImage file.

The AppImage file produced will crash (at least it does on my system) when trying to render UI stuff, hopefully someone (@tapir? @gihad ?) can figure out how to get things to build with debug symbols, then run with GDB to see where the crashes are occurring in the rendering pipeline and troubleshoot it.

Unfortunately, I don't have any more time to work on this a bit because of IRL stuff.


libfuse errror (fails same spot if libfuse is installed through apt with modprobe fuse error)

Dappimagetool-x86_64.AppImage&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.  HTTP request sent, awaiting response... 200 OK
Length: 2172096 (2.1M) [application/octet-stream]       Saving to: '../appimagetool.AppImage'                                                                           ../appimageto 100%   2.07M  8.76MB/s    in 0.2s
2022-08-20 13:08:59 (8.76 MB/s) - '../appimagetool.AppImage' saved [2172096/2172096]

 dlopen(): error loading libfuse.so.2

AppImages require FUSE to run.
You might still be able to extract the contents of this AppImage if you run it with the --appimage-extract option.       
See https://github.com/AppImage/AppImageKit/wiki/FUSE   for more information                                    

mv: cannot stat 'BambuStudio-x86_64.AppImage': No such file or directory
chmod: cannot access 'BambuStudio_ubu64.AppImage': No such file or directory                                    
/BambuStudio/build                                      
mv: cannot stat 'package/BambuStudio_ubu64.AppImage': No such file or directory

@probonopd
Copy link
Author

probonopd commented Aug 21, 2022

Use ../appimagetool.AppImage --appimage-extract-and-run when you want to run it inside Podman.

But it would be nice if a GitHub Actions workflow could be made that would generate the AppImage there, intead of relying on additional locally running tools like Podman.

Reference:

@deftdawg
Copy link
Contributor

deftdawg commented Aug 21, 2022

Thanks @probonopd, I added some tweaks to the build_image.sh script to make it run with that arg under podman, worked.

Here's how to build it with Podman:

# clone my branch and go into the dir
rm -rf build; sudo podman build . -t bambu-studio  && \
sudo podman run --rm localhost/bambu-studio /bin/bash -c \
'tar -c $(find build | grep ubu64.AppImage | head -1)' | tar -xv

It will put the AppImage into build subdirectory on the host's source directory as the last step.

As for GitHub actions, I'm open to using it, but not sure if will work on forks.

@probonopd
Copy link
Author

As for GitHub actions, I'm open to using it, but not sure if will work on forks.

Yes, it does work on forks.

This might get you started:
https://github.com/probonopd/BambuStudio/blob/master/.github/workflows/ccpp_ubuntu.yml

@deftdawg
Copy link
Contributor

deftdawg commented Aug 22, 2022

Looks like I also need to figure out how to make AppImageKit bundle the following libraries to make it runable on a SteamDeck (Arch fork):

(deck@steamdeck bin)$ ldd bambu-studio  | grep not
        libwebkit2gtk-4.0.so.37 => not found
        libjavascriptcoregtk-4.0.so.18 => not found

Update Extended list:

for f in $(cat app-check.txt); do if [ ! -e ${f} ]; then echo ${f} is missing; fi ; done
/usr/lib/libharfbuzz-icu.so.0 is missing
/usr/lib/libhyphen.so.0 is missing
/usr/lib/libjavascriptcoregtk-4.0.so.18 is missing
/usr/lib/libmanette-0.2.so.0 is missing
/usr/lib/libwebkit2gtk-4.0.so.37 is missing
/usr/lib/libwoff2common.so.1.0.2 is missing
/usr/lib/libwoff2dec.so.1.0.2 is missing
/usr/lib/libwpe-1.0.so.1 is missing
/usr/lib/libWPEBackend-fdo-1.0.so.1 is missing

Update #2:
I extracted the AppImage on the steamdeck, copied over all the missing libs from the Kubuntu box and injected $(pwd)/usr/lib into LD_LIBRARY_PATH...

Crashes the same as on Kubuntu, at least I can rule out the issue being related to the intel GPU on my laptop (steamdeck has an AMD APU).

@probonopd
Copy link
Author

probonopd commented Aug 25, 2022

All the missing libraries should be bundled from the system on which the BambuStudio AppImage is made. In fact, all required libraries except those blacklisted in https://github.com/AppImage/pkg2appimage/blob/master/excludelist should be bundled.

@deftdawg
Copy link
Contributor

Eh? So I'm supposed to bundle everything in /usr/lib except stuff on that list?

I feel like there should be a flag to have AppImageKit do that automatically without me needing to sort through all the system libs and cross reference them manually in a random 3rd app (we're not using pkg2appimage here)... It seems like pain that everyone who builds an appimage could avoid with a little additional code upstream.

@deftdawg
Copy link
Contributor

image

Here's a basic setup to at least be able to use print models using multi-colours via the SD card from Linux... It sucks but it should at least let you get stuff printed.

It leverages Steam to avoid needing to deal with wine directly and because it's what's available on a Steam Deck (where the root FS is read-only):

  • Install Steam Client

  • Install ProtonUp-Qt

  • Open Steam

    • Add Non-steam game
      • Change filter to all files
      • Navigate to Downloads
      • Select bambu_studio_win_latest.exe
    • find bambu_studio_win_latest.exe in steam library and alternate click Properties
    • Under Compatibility tab select Force the use of a specific Steam Play compatibility tool
    • Choose GE-Proton7-28 (you may need to install this via ProtonUp-Qt)
    • close the Properties settings dialog
    • Launch bambu_studio_win_latest.exe
      • this will run the installer
      • complete the install
    • find bambu_studio_win_latest.exe in steam library and alternate click Properties
    • Under the Shortcut tab
      • Rename to Bambu Studio
      • Change Target to "C:\Program Files\Bambu Studio\bambu-studio.exe"
    • Change start location to "C:\Program Files\Bambu Studio"
    • close the Properties settings dialog
    • find Bambu Studio in steam library and launch; wait for any updates to download and apply. If there are no updates Bambu Studio should start within 30 seconds, if it does not relaunch it (sometimes it takes more then one attempt before it starts up)

Under Proton/Wine the hosts file system is mapped as a network drive under Z:\

You can load stl and 3mf files from Z:\
Export them to Z: and then copy them to SD cards

@probonopd
Copy link
Author

Eh? So I'm supposed to bundle everything in /usr/lib except stuff on that list?

Of course only the ones which the application actually uses, and the ones they depend on, and so on (recursively).

I feel like there should be a flag to have AppImageKit do that automatically without me needing to sort through all the system libs and cross reference them manually

There are various tools like the ones on
https://github.com/AppImage/awesome-appimage/blob/main/README.md#appimage-developer-tools
that can bundle the required dependencies into AppDirs and/or AppImages.
But I guess BuildLinuxImage.sh in SuperSlicer is doing things "by hand" rather than using one of those, presumably to have a finer control over what exactly gets deployed. So if BambuStudio introduced new dependencies in addition to those in SuperSlicer, then their dependencies need to be deployed as well into the AppDir.
Hope this makes sense; let me know if I should elaborate.

@fsnuxer
Copy link

fsnuxer commented Sep 22, 2022

Any news from Bambulab for an approximate release date for linux ?
( with network plugin )

@lanewei120
Copy link
Collaborator

Hello

we have started the work of linux version
currently network plugin is not the key issue
lots of other issues needs to be solved(GUI/liveview...)

we will submit the patches as soon as we finished.
I am afraid currently we can not give a clear date here

@lanewei120
Copy link
Collaborator

lanewei120 commented Sep 29, 2022

we have submited the codes which support linux basic functions.
linux_screenshot

there are still some known issues:

  1. a random crash when software launch(we can ignore it and retry until success)
  2. the liveview is not working

to build the linux version, I just use following commands:
`#download codes into /home/user.name/codes/bamboo_slicer, build deps into /home/user.name/codes/dep_linux

build deps
cd /home/user.name/codes/bamboo_slicer/deps
mkdir build;cd build
cmake ../ -DDESTDIR="/home/user.name/codes/dep_linux" -DCMAKE_BUILD_TYPE=Release -DDEP_WX_GTK3=1
make -j6

build studio
cd /home/user.name/codes/bamboo_slicer
mkdir build
mkdir install_dir
cd build
cmake .. -DSLIC3R_STATIC=ON -DSLIC3R_GTK=3 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="/home/user.name/codes/dep_linux/usr/local" -DCMAKE_INSTALL_PREFIX="../install_dir" -DCMAKE_BUILD_TYPE=Release
cmake --build . --target install --config Release -j4`

if using the scripts submitted by deftdawg before
please make sure to set '-DBBL_RELEASE_TO_PUBLIC=1'


Here are the software lists installed before building for reference
#install cmake
sudo apt-get install cmake

#install git
sudo apt-get install git
git config --global user.name
git config --global user.email

#install g++
sudo apt-get install g++

#install opengl
sudo apt-get install build-essential libgl1-mesa-dev

#install m4
sudo apt-get install m4

#install wayland
#check 'XDG_SESSION_TYPE' whether is wayland
sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules

#install pkgconf
sudo apt-get install pkgconf

#install glu
sudo apt-get install libglu1-mesa-dev

##install cairo
sudo apt-get install libcairo2-dev

##install gtk-3-dev
sudo apt-get install libgtk-3-dev

##install libsoup
sudo apt-get install libsoup2.4-dev

##install webkit
sudo apt-get install libwebkit2gtk-4.0-dev

##install gstreamer
sudo apt-get install libgstreamer1.0-dev
sudo apt-get install libgstreamer-plugins-good1.0-dev
sudo apt-get install libgstreamer-plugins-base1.0-dev

#osmesa
sudo apt-get install libosmesa6-dev

@micwin
Copy link

micwin commented Nov 9, 2023

Hey @raupulus , thank you for the fast answer :-)

I tried libopenh264-6 (-7 or above isnt available) but to no avail.

After also installing libopenh264-cisco6 (now having the codec three times on my machine), the error still persists, but doesnt go into an endless loop any more :-) so, at least, I can close my files properly.

@micwin
Copy link

micwin commented Nov 9, 2023

installing gstreamer1.0-plugins-bad did the trick. Someone knows what '-bad' means in this context?

@raupulus
Copy link

installing gstreamer1.0-plugins-bad did the trick. Someone knows what '-bad' means in this context?

Don't worry, I actually use those and they haven't given me any problems in years. GStreamer Bad is a set of plugins that are not properly reviewed. They may be close to being good quality, but they're missing something, whether it's a good code review, some documentation, a test suite, an actual live maintainer, or some actual broad usage.
You shouldn't have any problems.

@UndeadKernel
Copy link

UndeadKernel commented Nov 10, 2023 via email

@tak-21
Copy link

tak-21 commented Nov 14, 2023

Hi, I am running the Bambu Studio 1.7.7.89 appimage on Linux Mint 21.2 and seem to have a problem with the client-side decoration. As you can see in the picture, I have the buttons from the Bambo Studio app and then the buttons from the theme. Can I disable "the outer" buttons somehow? 20231026-122214

I found a (temporary?) solution: I installed the extension Cinnamon Maximus and added .*bambu.* in the list Auto-Entfernliste

@JoeleJB
Copy link

JoeleJB commented Nov 21, 2023

Wanted to try out the app before committing to buying P1P printer...

On MX Linux 23 (Debian based) I get the SSL_CERT_FILE error as reported above, but clicking OK just crashes and can't even start the (ubuntu) app image..

If I run from command line this is the output

[2023-11-21 23:52:26.297758] [0x00007fe9c75c5d40] [trace] Initializing StaticPrintConfigs
add font of HarmonyOS_Sans_SC_Bold returns 1
add font of HarmonyOS_Sans_SC_Regular returns 1
loading network module at /home/joel/.config/BambuStudio/plugins/libbambu_networking.so
error, dlerror is /home/joel/.config/BambuStudio/plugins/libbambu_networking.so: cannot open shared object file: No such file or directory
after dlopen, network_module is (nil)

(bambu-studio:503870): GLib-GObject-WARNING **: 23:52:27.944: invalid cast from 'wxPizza' to 'GtkCellLayout'

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:27.944: gtk_cell_layout_get_cells: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(bambu-studio:503870): GLib-GObject-WARNING **: 23:52:27.945: invalid cast from 'wxPizza' to 'GtkCellLayout'

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:27.945: gtk_cell_layout_get_cells: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(bambu-studio:503870): GLib-GObject-WARNING **: 23:52:27.946: invalid cast from 'wxPizza' to 'GtkCellLayout'

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:27.946: gtk_cell_layout_get_cells: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(bambu-studio:503870): GLib-GObject-WARNING **: 23:52:27.946: invalid cast from 'wxPizza' to 'GtkCellLayout'

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:27.946: gtk_cell_layout_get_cells: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(bambu-studio:503870): GLib-GObject-WARNING **: 23:52:27.951: invalid cast from 'wxPizza' to 'GtkCellLayout'

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:27.951: gtk_cell_layout_get_cells: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(bambu-studio:503870): GLib-GObject-WARNING **: 23:52:27.952: invalid cast from 'wxPizza' to 'GtkCellLayout'

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:27.952: gtk_cell_layout_get_cells: assertion 'GTK_IS_CELL_LAYOUT (cell_layout)' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.040: gtk_window_resize: assertion 'height > 0' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.042: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.043: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.048: gtk_window_resize: assertion 'height > 0' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.049: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.049: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.144: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.144: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.152: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.152: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.157: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.157: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.162: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.162: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.167: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.167: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.173: gtk_widget_set_size_request: assertion 'width >= -1' failed

(bambu-studio:503870): Gtk-CRITICAL **: 23:52:28.173: gtk_widget_set_size_request: assertion 'width >= -1' failed
Segmentation fault

@Szu-Szu
Copy link

Szu-Szu commented Nov 23, 2023

I'm getting the same issue as @JoeleJB here. I pretty much only use linux unless I'm absolutely forced to. I'd rather not run this ins a windows VM but it seems like that is my only option. I get gtk errors with the app images and I get compiler errors when I do it myself.

@lanewei120
Copy link
Collaborator

lanewei120 commented Nov 24, 2023

I'm getting the same issue as @JoeleJB here. I pretty much only use linux unless I'm absolutely forced to. I'd rather not run this ins a windows VM but it seems like that is my only option. I get gtk errors with the app images and I get compiler errors when I do it myself.

what is your linux version? @Szu-Szu

@Szu-Szu
Copy link

Szu-Szu commented Nov 24, 2023

I'm getting the same issue as @JoeleJB here. I pretty much only use linux unless I'm absolutely forced to. I'd rather not run this ins a windows VM but it seems like that is my only option. I get gtk errors with the app images and I get compiler errors when I do it myself.

what is your linux version? @Szu-Szu

I'm using rhino Linux which is just a fork of Ubuntu. I did try Ubuntu proper though. Same issue.

@ikabod
Copy link

ikabod commented Dec 7, 2023

I would like to have a Linux version of Bambu Studio too.

@norpol
Copy link

norpol commented Dec 7, 2023

@ikabod The issue is closed because it's done. You can find the Linux executable .AppImage at the official release page.

https://github.com/bambulab/BambuStudio/releases

https://itsfoss.com/use-appimage-linux/#step-1-download-the-appimage-package

@BloodyIron
Copy link

@ikabod The issue is closed because it's done. You can find the Linux executable .AppImage at the official release page.

https://github.com/bambulab/BambuStudio/releases

https://itsfoss.com/use-appimage-linux/#step-1-download-the-appimage-package

Yay!

@probonopd
Copy link
Author

Makes me wonder why there is a version for Ubuntu and one for Fedora. Is "Linux" splintered so badly nowadays that it's not possible to make one version that can run on both? I'd be interested to hear about the concrete technical challenges there.

@SR-G
Copy link

SR-G commented Dec 8, 2023

The AppImage are only half-containing the libraries needed by the software - some libraries (like libc) are still retrieved from the operating system.

So at a given point in time, you may have / need some AppImage for various systems, depending of the current state of installation of some of the low level libraries.

Regarding Bambu Lab :

  • At some point in time, there were only one, working on all systems (it was for example also working on my ArchLinux system)
  • Due to that kind of issues, the Fedora image has appeared (here only the Fedora image was working on my Arch)
  • Now there are still two, but on my side, both are working on Arch at this time

And yes, AppImage is a bad solution (personal opinion), there are tons of issues with them over time, and everything related to distributing images is just a mess in linux (there are way too many packages managers & distribution mechanizms (at OS level - apk, apt, pacman, ...) or through (supposedely) "packaged application" (AppImage, Snap, ...).

@probonopd
Copy link
Author

Well, the whole idea behind AppImage is that application developers don't have to deal with the various package managers, and that by making one AppImage (usually for the oldest still-supported Linux distribution LTS release), that AppImage should run on all still-supported releases of Linux distributions. I was just curious what is the technical reason for the Ubuntu version of BambuStudio not running on Fedora.

@c2h5oh
Copy link
Contributor

c2h5oh commented Dec 8, 2023

Well, the whole idea behind AppImage is that application developers don't have to deal with the various package managers

That would be fine if BambuStudio AppImage was actually tested & was fixed to work on majority of distros, which it isn't. It seems to work quite well on distros that are more conservative, but on one that are faster to adopt new versions of software, like Arch or Fedora, wheels fall off on pretty much every major release with app failing to start, crashing or missing features (with camera video being the most commonly broken).

Very often it's not even possible to build BambuStudio on the distro you are using and because of AppImage excuse nobody at Bambu Labs is trying to so it goes undetected and unfixed until community does that. I would know - I've fixed building with GCC13 when Fedora and Arch switched to that version. I'm sure Bambu would have eventually fixed that, but it would have remained broken for 4+ months - until release of Ubuntu 23.10 forced their hand to look at this.

@probonopd
Copy link
Author

Well, my question is, why wouldn't the binary built on an older Ubuntu run on the latest Fedora? I am looking for the technical reason.

@SR-G
Copy link

SR-G commented Dec 8, 2023

Alrerady answered (and after that i'll stop answering to you) : because not all libraries are included in AppImage and some are coming from the OS itself.

@probonopd
Copy link
Author

probonopd commented Dec 8, 2023

That doesn't answer what the actual problem is. (Many AppImages don't ship all libraries, especially not those that can reasonably expected to be part of all commonly used desktop Linux distributions. While authors can ship all libraries, down to and including libc, some people would consider that as "bloated" and choose to only privately bundle those libraries that cannot reasonably be expected to be part of all commonly used desktop Linux distributions. If Fedora doesn't somehow break binary compatibility, then an AppImage made on Ubuntu should still work nicely on Fedora.)

And why is someone downvoting my questions? As the original inventor of the AppImage file format, I'd like to help where I can but that doesn't make me feel welcome here...

@c2h5oh
Copy link
Contributor

c2h5oh commented Dec 8, 2023

@probonopd This is more of a BambuStudio problem than AppImage problem. When AppImage made on Ubuntu fails to work on e.g. Arch it pretty much always either segfaults on start or shortly after - when interacting with Bambu network lib.

The problem is that vendored/pinned dependencies are often quite out of date and explode in a spectacular way when interacting with never versions of libs. This is why Arch and Fedora are most often broken - both distros update things faster than Ubuntu.

@JoeleJB
Copy link

JoeleJB commented Dec 10, 2023

Got my printer (p1p) and yeah same issues I posted above, cannot start Bambu Studio, though I have prusar slicer working perfectly (no tweaking required, through flatpak).

Sucks having to use windows VM to print, hope they can sort this out, I have never had issues with app images not working, before discovering Bambu Studio...

@astrolemonade
Copy link
Contributor

The camera feature is broken on Linux!

@JoeleJB
Copy link

JoeleJB commented Jan 15, 2024

OK Could never get this working, but if you are also having issues check out the flatpak now available from a kind fellow user.. Works without issue regardless of which distro you are using, like a packaged app should... ;-)

https://flathub.org/apps/com.bambulab.BambuStudio

@mdimitrovg
Copy link

I have the following errors:

root@root:/workspace/Bambu_appimage/squashfs-root/bin# ./bambu-studio --debug 2 --export-3mf /workspace/output.3mf /workspace/input.3mf 
[2024-02-09 13:54:08.090597] [0x00007efee7902c80] [trace]   Initializing StaticPrintConfigs
[2024-02-09 13:54:08.098421] [0x00007efee7902c80] [warning] cli mode, Current BambuStudio Version 01.08.02.56
[2024-02-09 13:54:08.182574] [0x00007efee7902c80] [warning] no filament colors found in projects
[2024-02-09 13:54:08.183172] [0x00007efee7902c80] [error]   calc_exclude_triangles:Unable to create exclude triangles

error: XDG_RUNTIME_DIR not set in the environment.
[2024-02-09 13:54:08.186340] [0x00007efee7902c80] [error]   error_code 65544, description: Wayland: Failed to connect to display

[2024-02-09 13:54:08.186357] [0x00007efee7902c80] [error]   glfwInit return error, code 65544

[2024-02-09 13:54:08.186390] [0x00007efee7902c80] [error]   Unable to init glew library
[2024-02-09 13:54:08.186398] [0x00007efee7902c80] [error]   init opengl failed! skip thumbnail generating

It's on Ubuntu 22.04 headless, so the gui related errors I assume are normal. I have installed 'xvfb'
I tried both compiling and the appimage from release 20240117 and it's the same. The output file is generated but would like to know if these errors are relevant, specially the " calc_exclude_triangles:Unable to create exclude triangles"

@norpol
Copy link

norpol commented Feb 9, 2024

@mdimitrovg

[2024-02-09 13:54:08.186340] [0x00007efee7902c80] [error] error_code 65544, description: Wayland: Failed to connect to display

wayland and xvfb are not compatible with each other, ensure bambu-studio is starting in X11 mode. (unset WAYLAND_DISPLAY && unset DISPLAY) before running xvfb-run.

Concerning the opengl error, for me on NixOS it also shows the opengl error., but no glfwInit error message.

I'm able to receive an output file, with DISPLAY/WAYLAND_DISPLAY set, without and also with xvfb.

Also make sure you have a working ~/.config/BambuStudio, I could imagine it might try to download the plugins even in this mode?

Did you consider using https://github.com/linuxserver/docker-bambustudio/? They've bundled the AppImage in a docker image with the necessary dependencies.

@mdimitrovg

docker run --rm -it \
  --name=bambustudio \
  -e LC_ALL=C \
  -e TZ=Etc/UTC \
  --entrypoint="" \
  lscr.io/linuxserver/bambustudio:latest /bin/bash -l

and then /opt/bambustudio/bin/bambu-studio --export-3mf output.3mf input.3mf works for me.

@mdimitrovg
Copy link

@norpol Same thing, I get the output file, the errors are still there with all the solutions I tried. I wanted to make sure that regardless of the errors, the result is correct and it appears that way. Thank you so much

@norpol
Copy link

norpol commented Feb 12, 2024

Linux is officially working


@mdimitrovg Open another issue if you're encountering problems.

@lanewei120 Please lock this ticket, there are 64 participants and potentially many of them will receive an e-mail on comments here.

@bambulab bambulab locked as resolved and limited conversation to collaborators Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests