ubuntu / WSL

Ubuntu WSL image build and launcher code.
MIT License
145 stars 43 forks source link

Using DaVinci Resolve 18.6.6 on Ubutntu Preview WSL will cause GLib incompatibility #451

Closed linghengqian closed 3 months ago

linghengqian commented 7 months ago

cmd /c ver

Microsoft Windows [版本 10.0.22631.3296]

wsl --status

默认分发: Ubuntu-22.04 默认版本: 2

Did the problem occur during installation?

What happened?

cd /tmp/ wget https://swr.cloud.blackmagicdesign.com/DaVinciResolve/v18.6.6/DaVinci_Resolve_18.6.6_Linux.zip?verify=1711345991-koLpOfRkrZVQWYam%2BYGYcCYaEY9VEEdF0FRcQSJSvCY%3D -O ./DaVinci_Resolve_Linux.zip sudo apt install unzip -y unzip ./DaVinci_Resolve_Linux.zip chmod +x ./DaVinci_Resolve_18.6.6_Linux.run

DaVinci_Resolve_18.6.6_Linux.run is an AppImage.

sudo apt install libfuse2 -y sudo apt install libapr1 libaprutil1 libasound2 libglu1-mesa libgomp1 libice6 libnuma1 libsm6 libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-shape0 libxcb-util1 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxkbcommon-x11-0 ocl-icd-libopencl1 -y

You need to always select 'y' during the installation process

sudo ./DaVinci_Resolve_18.6.6_Linux.run -i

rm -rf /tmp/DaVinci_Resolve_18.6.6_Linux.run rm -rf /tmp/Linux_Installation_Instructions.pdf

/opt/resolve/bin/resolve

- Executing `/opt/resolve/bin/resolve` will result in the following error, making it impossible to open `DaVinci Resolve`. From the Log, it can be seen that the GLib version is incompatible. **Is there any potential solution?**

```shell
$ /opt/resolve/bin/resolve
/opt/resolve/bin/resolve: symbol lookup error: /lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: g_string_free_and_steal

What was expected?

Steps to reproduce

cd /tmp/ wget https://swr.cloud.blackmagicdesign.com/DaVinciResolve/v18.6.6/DaVinci_Resolve_18.6.6_Linux.zip?verify=1711345991-koLpOfRkrZVQWYam%2BYGYcCYaEY9VEEdF0FRcQSJSvCY%3D -O ./DaVinci_Resolve_Linux.zip sudo apt install unzip -y unzip ./DaVinci_Resolve_Linux.zip chmod +x ./DaVinci_Resolve_18.6.6_Linux.run

DaVinci_Resolve_18.6.6_Linux.run is an AppImage.

sudo apt install libfuse2 -y sudo apt install libapr1 libaprutil1 libasound2 libglu1-mesa libgomp1 libice6 libnuma1 libsm6 libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-shape0 libxcb-util1 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxkbcommon-x11-0 ocl-icd-libopencl1 -y

You need to always select 'y' during the installation process

sudo ./DaVinci_Resolve_18.6.6_Linux.run -i

rm -rf /tmp/DaVinci_Resolve_18.6.6_Linux.run rm -rf /tmp/Linux_Installation_Instructions.pdf

/opt/resolve/bin/resolve



### Additional information

- Null.
CarlosNihelton commented 7 months ago

Unfortunately I cannot download the app from the provided URL to confirm, but being an appimage I'd expect it to bundle GLib and an appropriate version of it. Doing some research about the missing symbol, it was introduced in GLib v2.75 and Ubuntu Preview (which is currently 24.04 dev branch) ships GLib v2.79 so we should be OK.

Can you confirm which version of GLib the binary is linked to?

ldd -r -d /opt/resolve/bin/resolve

If GLib is not /lib/x86_64-linux-gnu/libglib-2.0.so.0, could you try preloading it following the instruction below?

LD_PRELOAD=/lib/x86_64-linux-gnu/libglib-2.0.so.0 /opt/resolve/bin/resolve

In case that works, and if the /opt/resolve/libs/ directory exists, consider adding a symbolic link (or maybe copying) the library from the distro into that directory.

linghengqian commented 7 months ago

Unfortunately I cannot download the app from the provided URL to confirm, but being an appimage I'd expect it to bundle GLib and an appropriate version of it.

Can you confirm which version of GLib the binary is linked to?

lingh@DESKTOP-LK088AH:~$ LD_PRELOAD=/lib/x86_64-linux-gnu/libglib-2.0.so.0 /opt/resolve/bin/resolve
/opt/resolve/bin/resolve: symbol lookup error: /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0: undefined symbol: g_task_set_static_name
CarlosNihelton commented 7 months ago

There are lots of system libraries interleaved with the libraries provided by the app image, which can cause all sorts of issues. I see there is an older version of GLib inside /opt/resolve/libs, which is fine. The issue is that libpango is not provided, thus the loader links against the system provided, which in turn relies on newer GLib. the LD_PRELOAD fixed one missing symbol, the other (g_task_set_static_name) will likely be resolved by additionally preloading /lib/x86_64-linux-gnu/libgio-2.0.so.0. So, in theory you can copy the system's gio and glib over what's inside ´/opt/resolve/libs`.

Those workarounds sound brittle to me. That should be reported to the app vendor, so they can provide the correct libraries inside the appimage to avoid such issues. Also, did you try running that version of DaVinci Resolve in Ubuntu 22.04? Since the libraries provided by the distro are of older versions, is likely that it will just work transparently without you even noticing the dependency leaks.

CarlosNihelton commented 7 months ago

Just to confirm, can you try LD_PRELOAD="/lib/x86_64-linux-gnu/libglib-2.0.so.0 /lib/x86_64-linux-gnu/libgio-2.0.so.0" /opt/resolve/bin/resolve?

linghengqian commented 7 months ago

Just to confirm, can you try LD_PRELOAD="/lib/x86_64-linux-gnu/libglib-2.0.so.0 /lib/x86_64-linux-gnu/libgio-2.0.so.0" /opt/resolve/bin/resolve?

linghengqian commented 7 months ago

Also, did you try running that version of DaVinci Resolve in Ubuntu 22.04? Since the libraries provided by the distro are of older versions, is likely that it will just work transparently without you even noticing the dependency leaks.

linghengqian commented 7 months ago
linghengqian commented 3 months ago

DaVinci_Resolve_18.6.6_Linux.run is an AppImage.

sudo apt install libfuse2 -y

sudo apt install fontconfig libapr1 libaprutil1 libasound2 libfreetype6 libglu1-mesa libglvnd0 libgomp1 libice6 libsm6 libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxcursor1 libxfixes3 libxi6 libxinerama1 libxkbcommon-x11-0 libxkbcommon0 libxrandr2 libxrender1 libxtst6 libxxf86vm1 ocl-icd-libopencl1 -y

Install some Gnome applications to include more GUI related system libraries.

sudo apt install gnome-text-editor gimp vlc nautilus x11-apps -y

You need to always select 'y' during the installation process

sudo ./DaVinci_Resolve_18.6.6_Linux.run -i

rm -rf /tmp/DaVinci_Resolve_18.6.6_Linux.run rm -rf /tmp/Linux_Installation_Instructions.pdf rm -rf /tmp/DaVinci_Resolve_Linux.zip

/opt/resolve/bin/resolve

- However, on Ubuntu WSL 22.04, opening DaVinci Resolve for the first time will result in a white screen.
- ![image](https://github.com/ubuntu/WSL/assets/20187731/77be7698-5c7d-4122-8b24-4b5e39f408b3)
- ![2](https://github.com/ubuntu/WSL/assets/20187731/124cff19-2995-424a-a500-79763015e386)
- The log is as follows.
```bash
$ /opt/resolve/bin/resolve
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
QSocketNotifier: Can only be used with threads started with QThread
New connection received.
CarlosNihelton commented 3 months ago

Well, since that's a proprietary software there is no much we can do. I find particularly interesting you willing to run such kind of software on a WSL instance (which requires additional setup) when you could just run on the Windows host (and get GPU support and other things out of the box without additional setups). Would you mind sharing your motivation for this?

Otherwise, feel free to close the issue as the upstream app provider stated there is no support for running on WSL as of now. In the future, if they change their minds, we could perharps offer guidance on how to make the application work.

linghengqian commented 3 months ago

Would you mind sharing your motivation for this?

Otherwise, feel free to close the issue as the upstream app provider stated there is no support for running on WSL as of now.