NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

[Found workaround] Steam broken with radeon foss drivers on unstable (16.03pre71289.7ae05ed) #10950

Closed pstn closed 8 years ago

pstn commented 9 years ago

Every time I try to launch steam I only get the following message:

mkdir: cannot create directory ‘/tmp’: File exists
cp: cannot create regular file ‘/home/philipp/.local/share/Steam/bootstrap.tar.xz’: Permission denied
Running Steam on nixos 16.03pre71289.7ae05ed 64-bit
STEAM_RUNTIME has been set by the user to: /steamrt
Installing breakpad exception handler for appid(steam)/version(0_client)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

Thank you for your help, I will happily provide any more information you might need.

abbradar commented 9 years ago

Ouch, this is a new incarnation of https://github.com/NixOS/nixpkgs/issues/9003. I'll look into this, thanks for the reporting!

vcunat commented 9 years ago

When did it last work for you? (on the same machine/configuration) For example, I have nonstandard mount setup of $HOME, which results into missing vital stuff in the chroot by default (I add a mount by hand into the chroot).

pstn commented 9 years ago

The setup never worked since this is a new install (I'm new to nixos). My home is pretty standard:

/dev/mapper/lvm-philipphome on /home/philipp type ext4 (rw,relatime,data=ordered)
abbradar commented 9 years ago

Hmm, that's strange -- we have libstdc++ overridden by our version, which should fix the bug. I suspect Steam uses its own libstdc++ anyway -- I'll investigate more for a chance to avoid using nasty LD_PRELOAD again.

abbradar commented 9 years ago

Looks like there's sadly no other option. Can you please test if https://github.com/abbradar/nixpkgs/commit/0e7cc21b33f3406cebf0851e6a11761b0864639b fixes the problem for you?

  1. Make test.nix file with contents like this in the root of nixpkgs:
{ pkgs ? import ./ { } }:
pkgs.steam.override { workaroundLibstdc = true; }
  1. Run nix-build test.nix
  2. Run result/bin/steam and test.
pstn commented 8 years ago

ι tried to run your test but I can't get it to work. If I follow your guide as it is, I just get error: syntax error, unexpected '/', expecting ID or OR_KW or DOLLAR_CURLY or '"', at /home/philipp/workspace/nixpkgs/test.nix:1:18 If I change ./ to the directory I cloned from github I get

error: anonymous function at /home/philipp/workspace/nixpkgs/pkgs/games/steam/default.nix:1:1 called with unexpected argument ‘workaroundLibstdc’, at /home/philipp/workspace/nixpkg /lib/customisation.nix:58:12

I also ran LD_PRELOAD='/steamrt/amd64/lib/libstdc++.so.6:/steamrt/i386/lib/libstdc++.so.6' steam but that only returns

ERROR: ld.so: object '/steamrt/amd64/lib/libstdc++.so.6' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/steamrt/i386/lib/libstdc++.so.6' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/steamrt/amd64/lib/libstdc++.so.6' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/steamrt/i386/lib/libstdc++.so.6' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
mkdir: cannot create directory ‘/tmp’: File exists
cp: cannot create regular file ‘/home/philipp/.local/share/Steam/bootstrap.tar.xz’: Permission denied
Running Steam on nixos 16.03pre71289.7ae05ed 64-bit
STEAM_RUNTIME has been set by the user to: /steamrt
Installing breakpad exception handler for appid(steam)/version(0_client)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
abbradar commented 8 years ago

Ouch, I'm sorry, this should have been ./., not ./. Anyway, have you cherry-picked my patch? It's strange it doesn't have workaroundLibstdc argument, I added it with the patch.

pstn commented 8 years ago

I did cherry pick your patch, there was a merge conflict but I resolved it. Maybe I made a mistake?

abbradar commented 8 years ago

Hmm, the resulting chrootenv looks veery old, I think it was like that somewhere in the spring and definitely before 15.09. Try this branch: https://github.com/abbradar/nixpkgs/tree/steam-stdlibc . It's on top of latest unstable channel.

jgillich commented 8 years ago

Also seeing this with intel:

cp: cannot create regular file ‘/home/jakob/.local/share/Steam/bootstrap.tar.xz’: Permission denied
Running Steam on nixos 16.03.git.c828102 64-bit
STEAM_RUNTIME has been set by the user to: /steamrt
Installing breakpad exception handler for appid(steam)/version(0_client)
libGL error: failed to open drm device: Permission denied
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
abbradar commented 8 years ago

Does anyone still see this? If yes, on what branch?

pstn commented 8 years ago

I do still see it on https://nixos.org/channels/nixos-unstable

abbradar commented 8 years ago

Can you please try this patch and see if at least some games are fixed for you? Use the old guide above.

pstn commented 8 years ago

Unfortunately it doesn't.

abbradar commented 8 years ago

Hm, there is one leftover libstdc++ that I see -- try https://github.com/abbradar/nixpkgs/commit/5a005207c119d8bd81c3f067de80367b3d4540ac, please (use it combined with the previous patch).

EDIT: changed URL to the correct patch.

pstn commented 8 years ago

That also didn't work.

abbradar commented 8 years ago

https://github.com/abbradar/nixpkgs/commit/ee13ba8174864dd88a66eb0cb2401cf0d43987b9 this one, next!

pstn commented 8 years ago

That did it! Should I revert the other patches to look whether this fix alone is enough or would they be applied anyway?

abbradar commented 8 years ago

Yes, please. Also please test what games do work for you -- some most certainly wouldn't.

pstn commented 8 years ago

edit:

abbradar commented 8 years ago

Revised patchset at https://github.com/NixOS/nixpkgs/pull/12404

abbradar commented 8 years ago

Sadly I don't have any statistics on games which actually work with new libstdc++ -- I think someone reported DotA 2 as broken before, but I don't have the game or a Radeon card to test myself.

abbradar commented 8 years ago

Let's keep this bug open for discovering possible new workarounds, tests and Steam updates.

pstn commented 8 years ago

Most games seem to run. I have been able to run and get into actual gameplay of

I couldn't find any games that do not run so far.

abbradar commented 8 years ago

Please try this branch with this test.nix (as in old guide):

{ pkgs ? import ./. { } }:
pkgs.steam.override { withMesa = true; }

This will have a non-trivial amount of rebuilding, but should be the proper fix of your problem.

pstn commented 8 years ago

I tried your branch but the result was negative. The old error of not finding the driver pointer persists. Sorry for taking so long.

abbradar commented 8 years ago

Hm, what would happen if you clean LD_LIBRARY_PATH? Run LD_LIBRARY_PATH= steam.

pstn commented 8 years ago

That doesn't change anything.

abbradar commented 8 years ago

Oh, that was because I actually set LD_LIBRARY_PATH somewhere inside chrootenv itself. Pull from the branch and try again, please.

pstn commented 8 years ago

That build also failed in the same way.

abbradar commented 8 years ago

Very strange. I'm out for a bit, can you please make two changes in pkgs/games/steam/chrootenv.nixin my branch:

Then run and call:

And show me the results?

pstn commented 8 years ago

glxinfo

I also ran glxgears in the steam-chrootfenv shell just for fun and it worked.

abbradar commented 8 years ago

More and more interesting. What's in LD_LIBRARY_PATH?

pstn commented 8 years ago

Sorry, I forgot to say that it's empty.

abbradar commented 8 years ago

...and Steam fails nevertheless, huh? find /steamrt -name \*stdc\* find /usr - name \*stdc\* Steam fails with the same cannot load driver, correct?

pstn commented 8 years ago

The exact errors are still on steam launch are

libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

But I guess this is what you meant. Both finds don't find anything inside the steam-chrootenv.

pstn commented 8 years ago

Follow up for new instance of this error: glxgears is only 32Bit with nix-build -E 'with import ./. {}; pkgsi686Linux.steamPackages.steam-runtime-wrapped.override {newStdcpp = true; }' and 64Bit with nix-build -E 'with import ./. {}; steamPackages.steam-runtime-wrapped.override { newStdcpp = true; }' Both run fine.

mirh commented 8 years ago

What does LIBGL_DEBUG=verbose steam say? In my case it complains about

libGL: dlopen /usr/lib32/xorg/modules/dri/r600_dri.so failed (/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib32/xorg/modules/dri/r600_dri.so))

which basically resolves down to this problem. Normally you would be able to override this kind of error with LD_LIBRARY_PATH variable as you say above, but steam.sh (line 702) overrides.. any previous override. So you are back to start.

Editing the start script or deleting libs from steam folder seemed unorthodox. So (once taken into account of another error) I fixed it with export LD_PRELOAD=/usr/lib32/libstdc++.so.6:/usr/lib32/libgpg-error.so.0

p.s: adjust paths for Nix, should mine from Arch not compute :s

pstn commented 8 years ago

I already resolved the issue with @abbradar should have said something about that, sorry. We are keeping this thread open because this is a recurring error that comes back due to different upgrades or changes of the system and we need to resolve it again.

On June 5, 2016 11:38:13 PM GMT+02:00, mirh notifications@github.com wrote:

What does LIBGL_DEBUG=verbose steam say? In my case it complains about

libGL: dlopen /usr/lib32/xorg/modules/dri/r600_dri.so failed (/home/user/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/lib32/xorg/modules/dri/r600_dri.so)) which basically resolves down to this problem. Normally you would be able to override this kind of error with LD_LIBRARY_PATH variable as you say above, but steam.sh (line 702) overrides.. any previous override. So you are back to start.

Editing the start script or deleting libs from steam folder seemed unorthodox. So (once taken into account of another error) I fixed it with export LD_PRELOAD=/usr/lib32/libstdc++.so.6:/usr/lib32/libgpg-error.so.0

p.s: adjust paths for Nix, should mine from Arch not compute :s


You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/NixOS/nixpkgs/issues/10950#issuecomment-223839348

vcunat commented 8 years ago

Then maybe the first comment could be edited to be more informative...

abbradar commented 8 years ago

Completely forgot that I wanted to close this one. @pstn, let's instead re-open it when the issue is there again -- it makes it easier for people to navigate bugs.

rardiol commented 8 years ago

I'm getting the following error. Is this the same issue?

cp: cannot create regular file '/home/user/.local/share/Steam/bootstrap.tar.xz': Permission denied Running Steam on nixos 16.09pre87332.715e01c 64-bit STEAM_RUNTIME has been set by the user to: /steamrt Installing breakpad exception handler for appid(steam)/version(0) libGL error: unable to load driver: nouveau_dri.so libGL error: driver pointer missing libGL error: failed to load driver: nouveau libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast

pstn commented 8 years ago

It's probably a similar issue. Here are a few questions to get things started:

rardiol commented 8 years ago

16.09pre87332.715e01c (Flounder) 01:00.0 VGA compatible controller: NVIDIA Corporation GT218M [GeForce 310M] (rev a2) nouveau No. should I?

pstn commented 8 years ago

Yes, please try that. Never mesa needs another libcpp than what is in the steam runtime. This should fix it.

rardiol commented 8 years ago

That seems to work thanks.

Mounium commented 8 years ago

@pstn @abbradar

https://gist.github.com/Mounium/98eb1587d066210a4fe9b3f735260db9

May it be the related issue (except for this time not at starting steam, but starting a game (borderlands 2))? Steam starts up fine with any of the following arguments being set to true. I tried newStdcpp, nativeOnly and runtimeOnly as well, all three display the linked error messages, also both 16.03 version and unstable. I have an AMD R9 380 (Tonga).

pstn commented 8 years ago

I own this specific game and could reproduce the error. My first guess is that it's not directly related but that there is something missing in our runtime.

Shados commented 8 years ago

@abbradar @pstn I'm seeing the same error when using the radeon driver, that is:

libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

Setting nixpkgs.config.steam = pkgs.steam.override { newStdcpp = true; }; does not help.

abbradar commented 8 years ago

To install overridden Steam you need to either use nixpkgs.config.packageOverrides or use it directly in environment.systemPackages:

environment.systemPackages = [(pkgs.steam.override { newStdcpp = true; })];

On August 12, 2016 5:06:02 PM GMT+03:00, Alexei Robyn notifications@github.com wrote:

@abbradar <https://github.com/abbradar> @pstn
<https://github.com/pstn> I'm seeing the same error when using the
radeon driver, that is:

|libGL error: unable to load driver: radeonsi_dri.so libGL error:
driver pointer missing libGL error: failed to load driver: radeonsi
libGL error: unable to load driver: swrast_dri.so libGL error:
failed to load driver: swrast |

Setting |nixpkgs.config.steam = pkgs.steam.override { newStdcpp =
true; };| does not help.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/NixOS/nixpkgs/issues/10950#issuecomment-239455244>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABHtGuuodpaBCFfX-SuE1_wJCEE3TGFFks5qfH3KgaJpZM4Gf2C0>.