linuxulator-steam-utils icon indicating copy to clipboard operation
linuxulator-steam-utils copied to clipboard

Add a reminder of "dont forget to add user to video group/give it xhost authorization and install linux-nvidia-libs if you have nvidia"

Open ghost opened this issue 8 months ago • 8 comments

this will save a bunch of folks a lot of headache

ghost avatar Aug 15 '25 06:08 ghost

You mean not reading the README, nor reading the handbook ? Do you expect every 3D application to remind you to add your user to the video groups and if run as another user (under Xorg) to give it xhost authorization ?

So for linux-nvidia-libs: https://github.com/shkhln/linuxulator-steam-utils?tab=readme-ov-file#dependencies doing sudo make dependencies will install linux-nvidia-libs if it detects the nvidia driver.

Adding user to the video group: https://docs.freebsd.org/en/books/handbook/x11/#x-install

And finally, an example of running wine (so mostly an X11 application) as another user: You need to go down to: Next provide access to the display back to the windows user, as whom the WINE programs will be running: https://docs.freebsd.org/en/books/handbook/wine/index.html#using-a-common-installation-of-wine

monwarez avatar Aug 15 '25 08:08 monwarez

You mean not reading the README, nor reading the handbook ? Do you expect every 3D application to remind you to add your user to the video groups and if run as another user (under Xorg) to give it xhost authorization ?

So for linux-nvidia-libs: https://github.com/shkhln/linuxulator-steam-utils?tab=readme-ov-file#dependencies doing sudo make dependencies will install linux-nvidia-libs if it detects the nvidia driver.

Adding user to the video group: https://docs.freebsd.org/en/books/handbook/x11/#x-install

And finally, an example of running wine (so mostly an X11 application) as another user: You need to go down to: Next provide access to the display back to the windows user, as whom the WINE programs will be running: https://docs.freebsd.org/en/books/handbook/wine/index.html#using-a-common-installation-of-wine

Most likely, however I'd argue that with steam the user can easily miss that fact (especially since they have to make a new user for steam unless they pass the very boldly named DUMB_PERSON_FLAG). So it's not like "every 3D application" since they mostly run on the "main user"; it's not a big deal for people who know already - but it's a good reminder nonethless especially since a new user is encouraged to be added.

ghost avatar Aug 15 '25 09:08 ghost

  1. For whatever reason doing anything with xhost was never necessary for me, so I didn't bother. And, yes, it's supposedly enabled:
% xhost 
access control enabled, only authorized clients can connect

I honestly don't feel like I'm familiar enough with the subject to provide the correct instructions.

  1. There is a sanity check for Nvidia at https://github.com/shkhln/linuxulator-steam-utils/blob/2acc3359a9a298906387ce58665662336756e9c0/bin/steam#L138-L145

  2. We could add another check for the video group, but keep in mind that requirement is drm-specific. Care to submit a patch?

shkhln avatar Aug 15 '25 14:08 shkhln

  1. For whatever reason doing anything with xhost was never necessary for me, so I didn't bother. And, yes, it's supposedly enabled:
% xhost 
access control enabled, only authorized clients can connect

I honestly don't feel like I'm familiar enough with the subject to provide the correct instructions.

2. There is a sanity check for Nvidia at 
     
       
         [linuxulator-steam-utils/bin/steam](https://github.com/shkhln/linuxulator-steam-utils/blob/2acc3359a9a298906387ce58665662336756e9c0/bin/steam#L138-L145)
       
       
           Lines 138 to 145
         in
         [2acc335](/shkhln/linuxulator-steam-utils/commit/2acc3359a9a298906387ce58665662336756e9c0)
       
     
     
       
   
           
             
              if `sysctl -q hw.nvidia.version` =~ /hw.nvidia.version: NVIDIA UNIX x86_64 Kernel Module\s+(\d+\.\d+\.\d+|\d+\.\d+)/ 
           
   
           
             
                version = $1 
           
   
           
             
                libgl32 = File.join(EMUL_PATH, "usr/lib/libGLX_nvidia.so.#{version}") 
           
   
           
             
                if !File.exist?(libgl32) 
           
   
           
             
                  perr "#{libgl32} doesn't exist. You might want to install (or update) linux-nvidia-libs." 
           
   
           
             
                  exit 1 
           
   
           
             
                end 
           
   
           
             
              end

3. We could add another check for the video group, but keep in mind that requirement is drm-specific. Care to submit a patch?

The correct invokation is xhost +si:localuser:steamuser (where steamuser is the steam user name), this is required most often each time a session is initiated - otherwise cryptic errors about libGLX will popup. Even when the steam user is in the video group.

ghost avatar Aug 16 '25 06:08 ghost

The correct invokation is xhost +si:localuser:steamuser (where steamuser is the steam user name), this is required most often each time a session is initiated - otherwise cryptic errors about libGLX will popup. Even when the steam user is in the video group.

I don't understand why the focus on the video group, being in the video groups have nothing to do with being able to run an X11 application from another user.

monwarez avatar Aug 17 '25 19:08 monwarez

Also discovered one more tip that I could not find mentioned elsewhere. if you are an AMD user, you will likely be stuck with llvmpipe by default - this is easily fixable! Simply go to /usr/local/lib/dri/ and symlink the existing radeonsi_dri.so to a new "amdgpu_dri.so" symlink in the same directory, and do the same under the $HOME/.i386/usr/local/lib/dri/ folder too. It might be only the latter one is needed, but I did both for completeness.

Exact commands:

(from the wheel account): sudo ln -sf /usr/local/lib/dri/radeonsi_dri.so /usr/local/lib/dri/amdgpu_dri.so (from the Steam account): ln -sf $HOME/.i386-wine-pkg/usr/local/lib/dri/radeonsi_dri.so $HOME/.i386-wine-pkg/usr/local/lib/dri/amdgpu_dri.so

Took me a lot of debugging and trying to do a whole bunch of weird stuff to try and make it working (yes, I even went down the rabbit hole of compiling a custom mesa fork) but it was actually that simple in the end...

jamfor999 avatar Sep 04 '25 21:09 jamfor999

Also discovered one more tip that I could not find mentioned elsewhere. if you are an AMD user, you will likely be stuck with llvmpipe by default - this is easily fixable! Simply go to /usr/local/lib/dri/ and symlink radeonsi_dri.so to amdgpu_dri.so and do the same under the $HOME/.i386/usr/local/lib/dri/ folder too.

Took me a lot of debugging and trying to do a whole bunch of weird stuff to try and make it working (yes, I even went down the rabbit hole of compiling a custom mesa fork) but it was actually that simple in the end...

I don't know which packages you have, but amdgpu_dri.so does not exist on FreeBSD with latest repository, so doing a symlink to a non existing files would not give better result. I have an AMD gpu and I have proper graphics acceleration on FreeBSD binaries.

monwarez avatar Sep 05 '25 05:09 monwarez

Also discovered one more tip that I could not find mentioned elsewhere. if you are an AMD user, you will likely be stuck with llvmpipe by default - this is easily fixable! Simply go to /usr/local/lib/dri/ and symlink radeonsi_dri.so to amdgpu_dri.so and do the same under the $HOME/.i386/usr/local/lib/dri/ folder too. Took me a lot of debugging and trying to do a whole bunch of weird stuff to try and make it working (yes, I even went down the rabbit hole of compiling a custom mesa fork) but it was actually that simple in the end...

I don't know which packages you have, but amdgpu_dri.so does not exist on FreeBSD with latest repository, so doing a symlink to a non existing files would not give better result. I have an AMD gpu and I have proper graphics acceleration on FreeBSD binaries.

I mean that radeonsi_dri.so is the actual file and "amdgpu_dri.so" is the symlink to that file. Without that symlink, wine-proton gives up as it is expecting to find it, at least that has been my experience. Without that symlink, I can see in DXVK HUD that it falls back to llvmpipe on Windows games running.

This is probably better fixed as an upstream fix to wine-proton to get the right file, but right now this workaround works fine and is easy. Updated my original comment with clear commands:

(from the wheel account): sudo ln -sf /usr/local/lib/dri/radeonsi_dri.so /usr/local/lib/dri/amdgpu_dri.so (from the Steam account): ln -sf $HOME/.i386-wine-pkg/usr/local/lib/dri/radeonsi_dri.so $HOME/.i386-wine-pkg/usr/local/lib/dri/amdgpu_dri.so

jamfor999 avatar Sep 05 '25 09:09 jamfor999