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

How I got Wayland, Vulkan, and hardware acceleration working with Figma on Fedora 39 #345

Closed
kentallenduke opened this issue Nov 5, 2023 · 8 comments

Comments

@kentallenduke
Copy link

kentallenduke commented Nov 5, 2023

After countless hours trying to get Figma Linux running optimally on my machines, I figured out how to get Wayland, Vulkan, and hardware acceleration working on Fedora 39 Workstation without using the web version of Figma.

figma-linux

I'm noticing a significant boost in performance, crisper text, and better power savings. The only shortcoming is that the window which Figma will run on will lose its shadow. This is due to a technical limitation with frameless windows on Linux.

I am writing this workaround because I know many of us have been struggling to get Figma working well on Linux. This guide uses minimal terminal commands and assumes you are on Fedora 39 Workstation (this will work on Fedora 38 Workstation). Here's how I did it.

Note: Nvidia users may run into long startup times with this.

Kudos to ChugunovRoman for making figma-linux possible!

1. Download and building the source code

Follow the instructions on Building from source.

  • Download the ZIP file by clicking the green "< > Code" button and clicking "Download ZIP." Make sure the branch is set to "dev."
  • Save the ZIP anywhere you choose. I put mine in my Downloads folder.
  • Launch nautilus. Navigate to the directory you saved your download. Extract the files, then open the folder you've unzipped.
  • Right click inside the folder, then click "Open Terminal."
  • Install Rust by copy-pasting the following into terminal:
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Install prerequesites from npm by copy-pasting the following into terminal:
    npm i
  • Build the app by copy-pasting the following into terminal: npm run build
  • Create the AppImage by copy-pasting the following into terminal:
  • npm run builder

If everything went well, you should have an AppImage file in your build/installers folder. In my case, it's ~/home/kentduke/Downloads/figma-linux-dev/build/installers/figma-linux_0.10.0_linux_x86_64.AppImage.

2. Setting up AppImage and Installing Figma

gearlever-figma

In this step, we are going to be using a handy tool called Gear Lever to install Figma and register it so that it appears on GNOME's launcher.

  • Install Gear Lever from GNOME Software or through terminal.
  • Open Gear Lever.
  • Install Figma either by dragging and dropping the AppImage onto Gear Lever or clicking "Open File" and navigating to the AppImage file.
  • A blue tooltip will appear asking to grant permission. Authenticate.

You should see "figma-linux" in GNOME's application launcher. Don't open it yet.

3. Enabling Wayland, hardware acceleration, and Vulkan

We're halfway there! Now that you've installed Figma, it's time to configure it. Thanks to the updates in Electron, we can now enable Wayland and hardware acceleration.

  • Go to your local applications folder. In my case, it's ~/home/kentduke/.local/share/applications.
  • Edit the Desktop file that Gear Lever created for figma. Mine is gearlever_figmalinux_6c9f53.desktop.
  • Go to the Exec line, then copy and paste this:
    sh -c "/home/kentduke/AppImages/gearlever_figmalinux_6c9f53.appimage --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-vulkan --enable-gpu-rasterization --enable-oop-rasterization --enable-gpu-compositing --enable-accelerated-2d-canvas --enable-zero-copy --canvas-oop-rasterization --disable-features=UseChromeOSDirectVideoDecoder --enable-accelerated-video-decode --enable-accelerated-video-encode --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiIgnoreDriverChecks,RawDraw,Vulkan --enable-hardware-overlays --enable-unsafe-webgpu"
    Replace "kentduke" with your username.

Screenshot from 2023-11-05 14-47-54

This is how my EXEC line looks like on my desktop file. Save your file and exit.

4. Signing into Figma

Assuming everything was set up correctly, you'll notice that Figma will look a lot more crisp when you launch it. However, we have one major hurdle to go over: signing into Figma. If you follow the instructions that Figma gives you, the external web browser can't hand off your credentials to Figma on Linux. Luckily, there's a simple workaround you can do to log in.

  • Click on the Figma logo at the top left of the window.
    Screenshot from 2023-11-05 15-02-29
  • Click the blue "Get started for free" on the right side of the window.
  • Log in with your Figma credentials.

5. Conclusion and installing custom fonts

That's it! Hopefully you should have Figma running with Wayland, Vulkan, and hardware acceleration enabled. If you need to load local fonts, download your font files first, then copy its folder over to /usr/share/fonts.

Let me know if that works!

@Anchor5178
Copy link

Great work. Would be nice if there was maintained a flatpak version though.

@ChugunovRoman
Copy link
Collaborator

ChugunovRoman commented Nov 9, 2023

@kentallenduke try this build. I ran it on fedora 34 with weyland and 3d acceleration worked fine.

@kentallenduke
Copy link
Author

@ChugunovRoman thanks. Do you mind building a flatpak version of this? By doing so, you may be able to get more testers to check this out. Right now, one or more of the command line flags is causing users with Nvidia GPUs to experience long launch times.

@ChugunovRoman
Copy link
Collaborator

@kentallenduke I've a flatpak repository, but latest release was not uploaded after CI error. Next release will be available on a flathub.

@kentallenduke
Copy link
Author

kentallenduke commented Nov 9, 2023

@ChugunovRoman I tried the build you linked via RPM. Hardware accelerated video encoding and Ozone platform are not enabled. I can't comment if software rendered video encoding impacts performance yet, but enabling Ozone platform will make the text and UI more crisp with fractional scaling. Here are the flags for both:

--enable-features=UseOzonePlatform --ozone-platform=wayland
--enable-accelerated-video-encode
--enable-features=VaapiVideoEncoder,VaapiIgnoreDriverChecks

@ChugunovRoman
Copy link
Collaborator

@kentallenduke
I tried enabling the --enable-features=UseOzonePlatform --ozone-platform=wayland flags, but for some reason the app crashed on Wayland.

@ChugunovRoman
Copy link
Collaborator

ChugunovRoman commented Nov 10, 2023

@kentallenduke I added the ability to set Chromium flags from the app settings. Now you can set any Chromium flags from the app. Even if the application does not start, flags can be added in the configuration file ~/.config/figma-linux/settings.json in the "commandSwitches" property.
build pipeline

screenshot_2023-11-10T20:29:49

@ChugunovRoman
Copy link
Collaborator

Everyone able to add any Chrome cli flags in the app config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants