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

zwift no longer runs with GPU acceleration #166

Closed
waltervolkers opened this issue Oct 6, 2024 · 14 comments
Closed

zwift no longer runs with GPU acceleration #166

waltervolkers opened this issue Oct 6, 2024 · 14 comments
Assignees

Comments

@waltervolkers
Copy link

zwift no longer runs with GPU acceleration. Very unfortunate. After Nvidea reinstall drivers, no luck. updated as much as possible. Running under Ubuntu 22.04.5 LTS

@netbrain
Copy link
Owner

netbrain commented Oct 7, 2024

Maybe you are affected by same issue as #167 ?

@waltervolkers
Copy link
Author

Problem 167 talks about not being able to start zwift. My problem is that Zwift starts but with a CPU load of 100% and is unworkably slow. I run with X and no Wayland

@netbrain
Copy link
Owner

netbrain commented Oct 7, 2024

I'm actually in the middle of debugging my own system on an older pc running nixos.

Seems I have the same issue when running docker. All CPU and no GPU utilization.

However when I switched to podman, then the Nvidia container toolkit integration worked nicely.

Do you have a Nvidia GPU? Running docker or podman?

@waltervolkers
Copy link
Author

Nvidia and docker.

@netbrain
Copy link
Owner

netbrain commented Oct 7, 2024

Guess you have to test and see if you can get hw accel, by using other image (i.e image with glxgears) and see if you can get any hw accel that way. Can't really assist everyone that has trouble with installing container-toolkit unfortunately.

@wmnsk
Copy link

wmnsk commented Oct 8, 2024

I got (probably) the same issue with docker, and successfully made GPU work with podman instead. I don’t really know why, but here’s some more details for someone who just wants to make it work: https://wmnsk.com/posts/20241003-zwift-on-ubuntu/

@netbrain
Copy link
Owner

netbrain commented Oct 8, 2024

Yeah, i think it's been for some time now that nvidia has changed the way they integrate gpus into containers, (nvidia-ctk, cdi's and so on). But haven't really been active and following these changes. But I guess that might be some of the reasons why some are affected with no gpu acceleration, me included.

But yeah, for now I just wanted to get zwift running, so opted for podman, which seems to have better integration with nvidia, at least on my system which uses legacy drivers (390)

For anyone else running nixos, I have it working with the following setup:

  nixpkgs.config.nvidia.acceptLicense = true;
  
  virtualisation = {
    podman = {
      enable = true;
      enableNvidia = true;
    };
  };

  hardware.graphics.enable32Bit = true;
  hardware.nvidia.modesetting.enable = true;
  hardware.nvidia.nvidiaSettings = true;
  hardware.nvidia.powerManagement.enable = true; 
  hardware.nvidia-container-toolkit.enable = true;
  hardware.nvidia.open = false;
  hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_390; #omit if you have newer gfx

  services.xserver = {
    enable = true;
    videoDrivers = [ "nvidia" "nvidiaLegacy390" ]; #nvidia suffices for those with newer gfx cards.
  };

@waltervolkers
Copy link
Author

Thanks for looking into it. Unfortunately I don't have time to delve deeper into Podman. podman and Nvidia are now causing problems for which I cannot quickly find a solution. Just like others. Zwift should work now. Unfortunately I'm back to Windows :-(

@msmurphy
Copy link

msmurphy commented Oct 23, 2024

I think you had the same problem I did. With nvidia drivers 555 or older the container would run but it would peg the cpu at 100% and it wouldn't use the gpu. When I upgraded to v560 it just failed to launch which forced me to dive into this problem more. I was running pop os, which is based off ubuntu 22.04. The issue is that the nvidia container ubuntu packages for 22.04 are way out of date. You'll need to force the use of the newer ones. There are more details here #163 but this is the gist of it. In your case pop-default-settings will probably be an ubuntu specific file.

Add this entry in /etc/apt/preferences.d/pop-default-settings to prioritize the nvidia depot over the pop one. Went from version 1.12 to 1.16. My guess is 1.12 is incompatible with the latest nvidia driver.


Package: *
Pin: origin nvidia.github.io
Pin-Priority: 1002

@mayfield
Copy link

Same issue with Fedora host, docker, nvidia proprietary v560. I am able to run nvidia-smi within the zwift container and it looks fine to me. Doesn't this suggest my nv container toolkit is working properly?

@msmurphy
Copy link

msmurphy commented Oct 24, 2024

@mayfield nvida-smi would run through the container for me, but anything that tried to use the gpu to render something wouldn't work. Not a whole lot of error output. What version of the nvidia container toolkit are you using?

@mayfield
Copy link

Looks like the change from #147 fixes my platform. I assume that's not published to :latest yet as I had to manually run with -e NVIDIA_DRIVER_CAPABILITIES=all

@netbrain
Copy link
Owner

netbrain commented Oct 25, 2024

@mayfield you kind sir, have just pointed me to a bug or rather, a inconsistency in our build workflow.

The current zwift image doesn't contain the ENV NVIDIA_DRIVER_CAPABILITIES=all , which is due to a squashing behavior that I implemented in order to reduce zwift image size. Will fix and rebuild, after this, the container should work fine without the -e NVIDIA_DRIVER_CAPABILITIES=all


related to a1b44dc

@netbrain
Copy link
Owner

netbrain commented Oct 25, 2024

On every zwift update, files that has been deleted, changed or removed, is not actually removed. so cruft get's accumulated over time. This is the reason for the squashing of the image, this happens every 3 months i believe.

It's a good thing in terms of compatibility, if the zwift team introduces a breaking change, then we as a linux community can simply roll back to the previous version using VERSION=x.x.x zwift

Now however im simply building the image from scratch instead on that same schedule, in order to remove the buildup of cruft as time passes. This means that for every 3 months, a full download of the zwift image is required.

I am tho a bit conflicted if this is the best course of action, maybe the zwift image should not contain anything other than the zwift installer, and upon first load, it should install everything to a named volume, and then update only if it detects a version change.

The reason i've opted to not do this, is to centralize the install & update process, so that user's don't have to deal with it themselves. So for usability, this is better, but maybe some people don't want to download big images on a three month basis?

In any case, this is part of the issue I wanted to handle with: #28

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

5 participants