Game Development on Linux

I am looking to move my primary game development PC off Windows and onto a Linux distro this Winter. What is y’all’s experiences doing game development on Linux?

Exo (if you see this), I already know you’re devving on Linux so I’d love your insight.

Background

I historically have preferred UNIX-inspired OS, I grew up on Mac and various flavors of Linux. I decided to use Windows on my primary game development/gaming PC for compatibility and convenience. However, neither compatibility nor convenience is a concern these days since Linux compatibility has vastly improved and Windows really does not live up to the convenience promise. In the worst case, my hardware is now capable enough where I feel comfortable running Windows in a VM with little performance compromise.

Context

I’m not tied to the Microsoft ecosystem at all whatsoever. I already use FOSS tooling for a majority of my work and everything most definitely has Linux support. I am mostly looking for advice on building a reliable workflow in Linux and common problems I might run into. I am a programmer by trade and I am looking to do more 2D/3D art as well.

Another concern of mine is whether to go for an Atomic OS (e.g, the Fedora Atomic-based Bazzite DX/GDX) or a more traditional mutable OS (e.g, Fedora-based Nobara). In theory, my preferred workflow meshes well with an Atomic OS, lots of containers, sandboxed environments, preference over stability and reliability over all. However, I have absolutely no context on what the game dev experience is like on an Atomic OS. In particular, I develop mainly with Godot for personal projects and commonly Unity for projects I contract for.

1 Like

I use Arch, which is a mutable OS. I didn’t know Bazzite was an atomic one, but a similar operating system called NixOS has many of the properties you want with a preference of stability and reliability due to its immutable and deterministic nature. However, I’ve heard that running a desktop PC entirely on NixOS is not a great experience. But, you can always run Nix on any Linux computer so you could still use it anyway and it might be worth looking into for your work.

I would say that development on Linux is pretty straightforward; it’s one of Linux’s stronger points. However, if you’re not terribly familiar with Linux already, Linux can seem rather intimidating. I usually make the following recommendations:

  • If you want to have an easy time getting set up, use a popular, well-known and well-supported operating system like Ubuntu or Fedora.
  • If you’re okay with less support and more tinkering, pick whatever suits your fancy ^^
  • If you want to jump into the deep end and learn the ins and outs of Linux, with the understanding that your system might break or that you might end up with frustrating issues, use Arch.

If you decide to go with Arch, feel free to ask me any questions as I’ve been using it as my main OS for several years now. Also, even if you don’t use Arch, you might find that the Arch Linux wiki is a great resource for resolving many issues on Linux.

I would expect most of the trouble you may run into with Linux will be related to configuring boot correctly and graphics card drivers being… well, lets just say I prefer AMD over NVIDIA. I would expect UnityHub and Godot to work well on most, if not all, Linux distributions.

VR can work, if you want to do that kind of thing, but I still maintain a Windows machine to do VR stuff because it’s a massive pain on Linux still, due to the aforementioned graphics support.

3 Likes

Since you mentioned considering using an atomic OS I figure I’ll give a few thoughts on running NixOS (no it’s not immutable, but it’s a related idea with similar consequences) as my main desktop OS and Game Dev (with occasional non-game dev) setup for just under 1 year now.

First off, as general advise, I wouldn’t recommend getting into desktop linux with NixOS at all. For someone who already knows how to code and/or knows a lot about software/operating systems already, wants the kind of advantages it provides, and wants to put in a bit of extra effort up-front to learn the slightly harder way then I can actually recommend it. Otherwise, I think one would have a much better time going debian-ish, arch, fedora, or something like that first.

Everything about game dev on linux in general applies, which for me is great, slightly better than windows even (I use godot and mostly open source tools, art programs, etc). As for the differences in using a non-traditional linux system, I don’t think I have any that are game dev specific. So the rest of this is mostly power user/I can build stuff myself related things.
I occasionally run things using proton mostly by going through the steam launcher just because it’s already there and works fine. The one thing I’m still reserving opinions on is whether or not VR gaming/dev is up to par on linux yet, I have a standalone headset that I haven’t used recently and probably will try some gamedev on eventually, but I’ve only ever used it standalone or with windows so far.

For me specifically, it’s been a slow and gradual process of learning to understand and get the most out of a declarative way of defining the software on my system, as well as all the quirks of Nix and NixOS specifically but it’s been really fun and rewarding and I can’t see myself going back to a more traditional linux system as a main PC any time soon. My reasons for switching were many and had as much to do with forcing myself to try it because I wanted to use it my homelab server, as it did with wanting it as my main desktop/gamedev setup. What I have learned though, is that it’s sometimes a pain and a little extra work but also comes with advantages that I really like.

Very abbreviated thoughts on advantages:

  • central location for declarative system and program configuration makes it so I’m never wondering what I did to set up some specific thing. And is somewhat self-documenting for future me.
    • this is a very short version of my thoughts on this, I feel very strongly that this is the way I want to go, I’m tired of doing so much work to set things up that the computer should be able to do for me and I’m tired of re-learning how to do things I only do once every 3+ months
  • nix-run or nix-shell style running things without installing for testing/evaluation/just a one time thing keeps my system so much tidier.
  • fearless system updates and reboots are a nice change of pace.
  • once I set something up on one system I can expect to be able to use that same configuration to instantly have it up and running the same way on another system with nix on it, in a very similar way to if it was set up as a container, but without extra layers of virtualization of a container (which I can also add if i want)

And disadvantages/things that need some workarounds or adjustment:

  • Most immediately obvious pain point for NixOS specifically, but probably true to some lesser extent in all similar setups:
    • can’t “just run” most prebuilt linux binaries, or just follow the README.md to build a lot of open source things.
      • being able to just run prebuilt things for me is mostly solved by the existence of the steam runtime and the handy steam-run utility from nixpkgs (works great for pre-release godot editor builds, games, and other random tools which come pre-built)
      • for getting a dev environment to build some software or just even run some python scripts is something I have started doing via creating dev shell definitions for them (assuming they don’t come with one which some actually do). This is a more involved process and I’ve had to learn a lot in order to start doing this but on the upside it keeps everything like dependencies or specific tooling very nicely contained
      • I haven’t yet tried distrobox or devenv/devshell or other tools for making contained dev environments but they seem like they should be good ways to deal with this also, so far I’ve been able to get by with just a shell.nix or a flake but these are probably quicker to learn and more applicable outside of NixOS specifically.
  • the next biggest disadvantage is just that I spend more time and mental effort when building/setting up/installing niche things which are not provided as a package/module already.
  • specifically nix, but it’s one more language I have to know how to use lol, with it’s own oddities and gotchas.
  • It can lead to overthinking and overoptimization/perfectionism in how I have my system set-up. Much more than a traditional linux setup where I also do that a bit but it always ends up being too big of a project so I never ended up having anything even mostly organized before lol

other things I’ve noticed:

  • most software works great but there’s definitely some things that are more write-happy whose nixpkgs implementations can sometimes have a few quirks or limitations
  • in my experience flatpaks and appimages work good once setup, including self-updating.
  • with great power can come great overthinking and perfectionism. my system is pretty jank still, but gradually improving. But when I do work on it I can sometimes get ahead of myself thinking or researching all the potential ways I could be doing it better.
  • It has irreversibly changed the way I think about managing software and the OS on my computers. So be careful, it’s not something you can easily un-know.

Hopefully some of my experience is relevant or useful!

4 Likes

I am so jazzed to try nix hopefully this year

Thanks for the rundown Cammy!

1 Like

I usually make the following recommendations…

It’s good you mention those points. I am entirely comfortable with tinkering and fixing things myself. I would say I’m fairly comfortable with Linux and I’ve run it as a daily driver in the past. However, this was well before I got deeper into game dev and playing games entirely on the PC.

well, lets just say I prefer AMD over NVIDIA

This is actually why I mentioned dumping the NVIDIA GPU for an AMD one. I’m aware of the massive gap in support between the two on Linux. I also don’t think NVIDIA is the best choice for my workload anyways.

VR can work, if you want to do that kind of thing, but I still maintain a Windows machine to do VR stuff because it’s a massive pain on Linux still, due to the aforementioned graphics support.

That is going to be a big concern. I still play VR games from time to time and I would love to continue developing a few VR experiences. I would love to hear more about your experience with that.

1 Like

This is totally helpful

central location for declarative system and program configuration

This is one of the main reasons I am strongly considering an atomic OS. I’ve gotten tired of the go-around of chasing loose ends and tracking down config that I won’t ever have to think about until one day years from now.

once I set something up on one system I can expect to be able to use that same configuration to instantly have it up and running the same way on another system with nix on it

This is another thing I would love to have too. I want to be able to seamlessly work between my desktop and my laptop without much hassle. I want to spend my time actually developing and working and less time tinkering with the environment.

I haven’t yet tried distrobox or devenv/devshell or other tools for making contained dev environments but they seem like they should be good ways to deal with this…

I’ve been doing more reading into distrobox, although I haven’t looked much into devenv/devshell. I think this is probably the way I’ll go. That way I can have a dedicated game development environment that includes IDEs (mainly concerned with the debugger capability here), engines, and any other of these tightly coupled programs (for example, if I want to use godot’s blender tooling).

Thank you for the detailed breakdown of your NixOS experience. I’ve got a lot more to research now haha

1 Like

I ended up using ALVR to get VR working on Mint. It took some doing because the headset didn’t want to go into dev mode, but eventually it worked. After that it was smooth sailing, though I did intentionally set it up to work over USB instead of wireless, cause I wanted less latency (and I’m used to it being wired anyways).

You can see the issue I ran into here: [BUG] Direct Display Mode fails to acquire xlib display with vulkan-radeon · Issue #530 · ValveSoftware/SteamVR-for-Linux · GitHub

It was quite a while ago though, so I might not experience the same issue if I were to try again now.

You’re right; I looked into it more and I stand corrected.

used nixOS for a while, my experience has been that whatever complexity you solve with it you end up encountering in other ways because figuring out the configuration language is tough and the documentation isn’t great. that said, I do miss the declarative part of it

nvidia works - i worked on hand me down gpus for years that were all nvidia and they usually took config but they worked. the bazzites of the world promise to be config free for nvidia, which’d be fantatsic but I’ve never even thought of using them for gamedev. I’ve heard that amd gpus are much easier tho I never got a chance to try myself

I have a Valve Index as my main VR HMD so I’m hoping things are a bit smoother on that. I do have a Quest 2 that I used to use for Dev but I don’t plan on targeting that platform anytime soon.

1 Like

What are you using now for gamedev?

Yeah I’ve been able to get nvidia GPUs working on Linux in the past. I mainly indicated the AMD gpu because I was already considering switching to something with more VRAM anyways and AMD tends to do a lot better on that.