cryinkfly / Autodesk-Fusion-360-for-Linux

This is a project, where I give you a way to use Autodesk Fusion 360 on Linux!
https://github.com/cryinkfly/Fusion-360---Linux-Wine-Version-/wiki
MIT License
1.79k stars 115 forks source link

Shedding some light on various problems #311

Open 9ary opened 1 year ago

9ary commented 1 year ago

Hi,

I've been messing with Fusion 360 in Wine for the past month or so. I've encountered this repository several times during my research, and I've noticed that there is a lot of confusion regarding the whole setup. From what I've seen in this repo, you aren't very knowledgeable on the technical aspects of it all, so I would like to present my findings and work so far. I hope you don't find my tone offensive here, I'm really just trying to help. :)

Installation

Let's get this out of the way first, the setup script is an overcomplicated mess and I would not want to run it on my computer. All you need to install Fusion is Wine itself (it needs to support both 32 and 64 bit, because the installer and most winetricks verbs are 32 bit, but Fusion itself is 64 bit).

Run the following command to set up dependencies: winetricks atmlib gdiplus msxml3 msxml6 vcrun2017 corefonts win10. That's it! I've yet to check whether this can be reduced even more, but this gets Fusion to actually "run and drive".

Then run the installer. It doesn't appear to require patching anymore, so that's good. Unfortunately, the progress indicator is broken, and the installer will not exit when it's done. This post explains how to check when it's done: find the installation log file at $WINEPREFIX/drive_c/users/$USER/AppData/Local/Autodesk/autodesk.webdeploy.streamer.log, and look for a line like this towards the end:

2021-10-28 21:00:02,885 - MainProcess(272) - InstallDriver - adsk.dls.streamer.process.process - INFO :: Process Complete in 195.00197 seconds

When you see this, the installer has finished and you can kill it with Ctrl+C. Running a silent install might help work around this, otherwise a simple wrapper script would be helpful.

Afterwards you can start Fusion 360 and log in. Then we get to the next problem.

Graphics drivers

First of all, unless your copy of Wine has the Vulkan child window rendering patch (see https://bugs.winehq.org/show_bug.cgi?id=45277), DXVK will not work, no matter your driver, and neither will the Vulkan renderer in WineD3D. With that patch, DXVK does work, and appears not to have any rendering bugs. However, there's still a problem where the work area will always be one frame behind, which is quite annoying (the visible effect is that everything you do won't show up on screen until you do something else).

For the rest, here are my test results. I have an Intel 8th gen laptop, and a desktop with an AMD RX580 GPU. I do not have any Nvidia hardware, so I can't really say anything about those.

Direct3D 11 is unfortunately broken. All I see in the work area is the Fusion 360 logo and nothing else. (Note that it works with DXVK, but I do not recommend using it due to the problems mentioned above).

OpenGL core profile works, but has some rendering issues with selections and highlights which make it annoying to use.

Now for the most interesting. Direct3D9 has rendering issues out of the box, but using Gallium Nine, I've yet to encounter any. Performance is pretty good. Note that Gallium Nine will not work on Nvidia's proprietary driver.

One last thing, the data panel is broken when using DXVK or Gallium Nine. You need to set a library override in winecfg for AdCefWebBrowser_dpiAware.exe so that it uses the builtin d3d9. This can easily be scripted using wine reg to set a registry key. Unfortunately this is currently broken with Nine, but I've got a pending PR for that: https://github.com/iXit/wine-nine-standalone/pull/155.

Windowing bugs

I've identified several windowing bugs. Here's a merge request to address those in Wine: https://gitlab.winehq.org/wine/wine/-/merge_requests/2343.

Additionally, the browser tree and some other things require XShape support to work properly. On X11 or in the virtual desktop, this should already work fine, but on Wayland this is up to the compositor. GNOME already supports it, KDE should work fine too, wlroots needs work that I plan on doing. For now it's a bit difficult to use the browser tree.

The freeze-on-exit bug

This is bug #214. Honestly I'm not sure why it's happening. What I've found that works is either:

It's also a good idea to set a DLL override for ADPClientService.exe to disabled. This should disable some telemetry and prevent that process from lingering in the background after quitting.

The Wine Wayland port

I've tested the Wayland port a little bit. It solves all the windowing issues listed above by working completely differently. The floaters are contained in subsurfaces of the main window, so they will never interfere with anything else. However, the data panel, which is a different process, will currently show up as a separate window. DXVK also works flawlessly with no additional patching.

The catch is that it's currently not very stable. It takes several attempts to get Fusion to start at all, and then it has a tendency to crash after a short while. Definitely not in usable shape yet, but very promising.

If you've made it this far, thanks for reading. I really hope this helps someone!

zakutin commented 1 year ago

... and then it has a tendency to crash after a short while.

Do you experience something like this?

9ary commented 1 year ago

No, the Wayland port is a different beast entirely. Fusion just suddenly exits.

cryinkfly commented 1 year ago

@9ary Thank you very much for your detailed feedback and the tips. :+1:

lorn10 commented 1 year ago

@9ary Thanks for your great testing and contribution to this matter here and Gallium Nine. :+1:

I want to note that the winetricks gdiplus argument should be no longer recommended in conjunction with Wine 8.x releases. At the moment winetricks installs a quite old Windows 7 gdiplus variant, build version 6.1.7601.17514. Instead, there should be used a more recent Windows 10 gdiplus file, like build version 10.0.17763.1.

At least in my testing environments, which doesn't includes Fusion 360, the mentioned native Windows 7 gdiplus variant which is installed by winetricks doesn't improve the situation. Instead, It does the opposite.

More information can be found at the corresponding winetricks issue report:
https://github.com/Winetricks/winetricks/issues/1840

9ary commented 1 year ago

Thanks for the tip on gdiplus, the verbs I'm suggesting are just what I currently know works and are based on the linked blog post and a Lutris script.

I intend to do more testing to figure out the bare minimum required verbs. I already suspect that vcrun2017 is not necessary, because the Fusion install already comes with some of those DLLs. corefonts is probably not needed either, and it'd be nice to get rid of that one because it's slow to install. At least one version of msxml is needed (most likely msxml6 considering it's the only native msxml in system32, msxml3 appears to be 32 bit only), and I don't know about atmlib yet.

lorn10 commented 1 year ago

Yeah, regarding the MS Visual C++ support in Wine the native MS files should be also avoided when ever possible. I can confirm this for Wine 7.x and newer in conjunction with the CXBX-R Xbox emulator. :wink:

I think as of 2023 it can be said that Wine's built-in Visual C++ support is good enough in most situations. This is true up to MS Visual C++ 2022.

However, sometimes there might exist some problems regarding not implemented MS Visual C++ features. The last stumbling block was in this regard the missing "C++20 Semaphore" support. The simple solution was to use just the corresponding MS Visual C++ 2022 dll. And finally, after the "C++20 Semaphore" support was added to the built-in Visual C++ implementation, also this tweak is no longer needed.

9ary commented 1 year ago

So I did a binary grep for atmlib in the fusion install directory, no results at all so it's probably not even using it.

I just did a test install in a clean prefix to confirm some things.

Unfortunately I was only able to start fusion once or twice, afterwards it seems the main UI refused to start anymore. The splash window disappears and the main window doesn't replace it, shortly followed by error spam in the terminal. I'll try again soon. I'm using Wine 8.4.

dzervas commented 1 year ago

@9ary about the installer, check out my open source installer (please report any bugs, it's still a baby) fusion360-streamer

9ary commented 1 year ago

@9ary about the installer, check out my open source installer (please report any bugs, it's still a baby) fusion360-streamer

Very cool, this will be great for version pinning especially on nixos. Thanks!

alextrical commented 1 year ago

Thank you for the information posted here, Ive been struggling with a few glitches on a Wayland desktop. I couldn't find a way to get a version of Wine with the 'Vulkan child window rendering patch' installed, but found that Glorious Eggroll's build for Lutris has it patched out of the box. and was pleasantly surprised to to see the installer loading bar working image I'm currently playing around with the verbs to see what is required, as just msxml6 win10 get to the login prompt screen, but doesn't respond to text input. Adding corefonts looks like it solved the login issue

lorn10 commented 1 year ago

@alextrical Maybe it would make sense to test also a newer gdiplus file (from Windows 10)?

Check the corresponding winetricks issue report.

Note, I cannot recommend to install the default gdiplus variant from winetricks, - it doesn't work stable for me (especially in newer Wine versions).

alextrical commented 1 year ago

@lorn10 by any chance do you know of a command to grab a specified MS KB file, and extract the gdiplus.dll file. Second to that is do you know where is best to put that DLL, to allow the override to function (im not familiar with overrides yet)

I was hoping to create a command line to get that setup

lorn10 commented 1 year ago

Get the first gdiplus.dll (10.0.17763.1) from here. Place it next to the Fusion360.exe and make an override in winecfg for gdiplus.dll. That should work. :wink:

Note, the mentioned source isn't perfect, - it cannot be used for winetricks. The best would be to find an original MS KB package. Unfortunately, most of the available links are dead. So it's quite tricky to find a good newer source with a full build of that file. Some MS KB updates may only contain the patch information for the gdiplus.dll file, - so they don't contain the full gdiplus.dll.

Edit (20.04.2023): In theory the gdiplus.dll could be extracted out of a corresponding Win 10 ISO file. Those are legally available for download. An example can be found here which is Win 10 build 22H2.

Yes, it is in some way a total overkill to download 5,7 GB of data just to get a 1.62 MB file.

marnas commented 5 months ago

@9ary Thank you for your work on wlroots, it seems to have fixed most of my issues.

I use Sway and the problem I'm facing now is the floating windows keeps getting moved to the center of the screen after each click of the mouse.

Do you know what could be causing this by any chance?

9ary commented 5 months ago

Do you know what could be causing this by any chance?

Yes, this is the third point under windowing bug. It requires fixes in wine, see the linked MR. I haven't actually tried this for a while though, and I've gone back to using a VM for now.

For what it's worth, winewayland.drv does improve things significantly and allows using dxvk so that should be the focus of efforts going forward.

lorn10 commented 5 months ago

@marnas For the case that you are testing the mentioned Wine MR "Collection of small fixes for Fusion 360" then please leave a feedback also on Wine's GitLab. (This could probably accelerate the merging of that MR.)

Yeah, I'm still convinced that those fixes may help also other applications. :+1: And while the future is Vulkan/Wayland it would be still nice to have a functional solution also for X11. :wink:

marnas commented 5 months ago

@9ary Sorry for my very limited knowledge on the matter, but considering that the same setup works correctly in gnome (both xorg and wayland) my first guess would be that Sway might not be handling windows in the right way?

@lorn10 Thank you for the advise, however I was referring to the wlroots changes that have actually already been merged. I will keep your advice in mind when I'll get round to testing Wine changes though.

9ary commented 5 months ago

Sorry for my very limited knowledge on the matter, but considering that the same setup works correctly in gnome (both xorg and wayland) my first guess would be that Sway might not be handling windows in the right way?

Yeah, sway/wlroots have some deficiencies in X11 window management due to being fairly new, best we can do is refine it over time. Gnome's Mutter is a lot more mature because it still uses its existing X11 code, which has over two decades of development behind it.

marnas commented 5 months ago

Just a side note, the issues I was facing don't show up in Hyprland which is also wlroots based, so they seem to be strictly related to Sway. I haven't tested it thoroughly yet, but Fusion 360 seemed to run pretty smoothly in hypland and I'm personally considering a switch.

9ary commented 5 months ago

Yes, some issues are specific to sway because it handles the X11 window stack incorrectly. I've already landed a fix in wlroots for this, but you'll have to wait for the next sway release to receive it.