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

Unclear if supports AMD Radeon GPU #145

Open
Kreakdude opened this issue Apr 26, 2024 · 12 comments
Open

Unclear if supports AMD Radeon GPU #145

Kreakdude opened this issue Apr 26, 2024 · 12 comments
Labels
status:awaiting-triage type:documentation Improvements or additions to documentation

Comments

@Kreakdude
Copy link

Description

The readme under features says NVIDIA, AMD and Intel gpus are supported, but in the releases it just says Nvidia. Also I'm trying to use the docker compose and there's no instructions on how to configure it so it uses AMD. It seems to only support NVIDIA because of all the NVIDIA named vars like device_ids: ["${NVIDIA_VISIBLE_DEVICES}"]. So how would I change the docker compose for my Radeon GPU?

@Kreakdude Kreakdude added status:awaiting-triage type:documentation Improvements or additions to documentation labels Apr 26, 2024
@cRaZy-bisCuiT
Copy link

Hi @Kreakdude,
do you have a display attached to your host running Docker? This could already solve the problem maybe.

The Container runs on AMDGPU. I tried it on an integrated 5750GE APU (Host is Debian, Proxmox host) as well as a RX 6800 on Arch Linux Host (Sway WM). Both are working fine.

I could check my config when I'm back at home if you wish.

@Josh5
Copy link
Collaborator

Josh5 commented Apr 29, 2024

AMD and Intel GPUs don't need all the bullocks that NVIDIA GPUs do. NVIDIA has all the joy of proprietary Linux drivers and custom X display configuration.
So long as your host is set up with the required drivers, the container should "just work" with your AMD GPU.
As mentioned above, if you are having issues, it may be that you need to invest in an HDMI EDID emulator (only about $5) that will simulate a monitor plugged in. Other issues could be caused by having multiple GPUs.

@Kreakdude
Copy link
Author

No, @cRaZy-bisCuiT I do not have a display attached. It's on a dedicated server I recently bought.

My current issue is an error saying /dev/fuse/ doesn't exist which I checked and it doesn't. I'm not sure what it is or how to get it. I'm guessing I'll get the same problem with /dev/uinput/. I don't see anything about them in the setup so there's some more room for improvement on the documentation.

Before I get farther though, I wanted to make sure I wasn't wasting my time trying to get a Radeon GPU to work with this docker image in this repo. Which it sounds like it's supposed to support AMD so I'm not wasting my time.

@cRaZy-bisCuiT
Copy link

I use the following ENVs with Docker Compose and that works pretty well for me:

---
services:
  steam-headless:
    image: josh5/steam-headless:debian
    restart: unless-stopped
    runtime: ${DOCKER_RUNTIME}
    shm_size: ${SHM_SIZE}
    ipc: host # Could also be set to 'shareable'
    privileged: true
    ulimits:
      nofile:
        soft: 1024
        hard: 524288
    cap_add:
      - NET_ADMIN
      - SYS_ADMIN
      - SYS_NICE
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined

    # NETWORK:
    network_mode: host
    hostname: ${NAME}
    extra_hosts:
      - "${NAME}:127.0.0.1"
    
    # ENVIRONMENT:
    ## Read all config variables from the .env file
    env_file: .env

    # DEVICES:
    devices:
      # Use the host fuse device.
      - /dev/fuse
      # Add the host uinput device.
      - /dev/uinput
      # Add AMD/Intel HW accelerated video encoding/decoding devices (optional)
      - /dev/dri/D128
      - dev/dri/card1
    # Ensure container access to devices 13:*
    device_cgroup_rules:
      - 'c 13:* rmw'

    # VOLUMES:
    volumes:
      # The location of your home directory.
      - /opt/container-data/steam-headless/home/:/home/default/:rw

      # The location where all games should be installed.
      # This path needs to be set as a library path in Steam after logging in.
      # Otherwise, Steam will store games in the home directory above.
      - /mnt/games/:/mnt/games/:rw

      # The Xorg socket. This will be shared with other containers so they can access the X server.
      # Select only one option or leave commented out to not share the Xorg socket with any other Docker containers.
      #   Option #1) Start a X server in the container to share with any other containers.
      #- /opt/container-data/steam-headless/.X11-unix/:/tmp/.X11-unix/:rw
      #   Option #2) Use an existing X server running on the host.
      #- /tmp/.X11-unix/:/tmp/.X11-unix/:rw

      # Pulse audio socket. This will be shared with other containers so they can access the audio sink.
      # Leave commented out to not share the pulse socket with any other Docker containers.
      #- /opt/container-data/steam-headless/pulse/:/tmp/pulse/:rw

You have to make sure fuse is working for you on the host. I would have to search my history to find those settings but a google search might help here as well.

As stated by @Josh5 and me: You most likely need display connected to your server host HDMI port or a HDMI EDID emulator. I had the same problem. I did not work until I connected something to the HDMI port of the hosts GPU.

@Kreakdude
Copy link
Author

Kreakdude commented Apr 29, 2024

I'm hesitating to delve into solving the missing /dev/fuse/ and /dev/uinputs/ missing paths issue if you think I'm going to run into problems regarding not having a display connected. I did have a display connected to the hardware before, will it need to stay connected? Will connecting one solve the missing paths issue? My hardware has proxmox installed first and from there I'm running an ubuntu container and that's the host for this docker image build. When I had the display hooked up the only graphical display looked like some console output telling me an local IP address and port to put into another computer's web browser. The ubuntu container is also a non-graphical installation. Knowing all this, do you still think hooking up a display will solve everything?

@Josh5
Copy link
Collaborator

Josh5 commented May 1, 2024

I'm hesitating to delve into solving the missing /dev/fuse/ and /dev/uinputs/ missing paths issue if you think I'm going to run into problems regarding not having a display connected. I did have a display connected to the hardware before, will it need to stay connected? Will connecting one solve the missing paths issue? My hardware has proxmox installed first and from there I'm running an ubuntu container and that's the host for this docker image build. When I had the display hooked up the only graphical display looked like some console output telling me an local IP address and port to put into another computer's web browser. The ubuntu container is also a non-graphical installation. Knowing all this, do you still think hooking up a display will solve everything?

You dont need a full display. Just a dummy plug for like $5. But you can try to set it up and use it without one first if you like.

As for fuse, you will need to install libfuse on your host OS. That is something that should be added to the docs.
What OS are you running the Steam Headless Docker container on?

@Kreakdude
Copy link
Author

Kreakdude commented May 2, 2024

@Josh5 the host is ubuntu but it's a container spun up by proxmox. So when I have plugged in the monitor it just shows a full screen terminal for proxmox, like it shows the local IP address and port to use to control proxmox from remote.

I commented out the /dev/fuse/ and /dev/uinputs/ in the docker compose file and it's all working EXCEPT that the game I'm testing (Geometry Wars) is like 1 fps so I'm not sure what to do to troubleshoot that.

@Josh5
Copy link
Collaborator

Josh5 commented May 2, 2024

@Kreakdude, you will want to leave those 2 without comments.
Install libfuse on Ubuntu. apt install fuse.
You should already have uinput.
Make sure if you are running Ubuntu as an LXC, it is run privileged (i am not familiar with proxmox, so you will need to figure all that out).

Also, try a different game that uses directx or vulkan for testing.

@MNTLe-DMGD
Copy link

MNTLe-DMGD commented May 9, 2024

Assumption: You're using a CT container, instead of a KVM Virtual Machine.

  1. Proxmox CT containers require being run in privileged & unprotected mode to be able to access hardware (This does introduce potential security issues, and to enable those modes, you may have to spin up a new container)
  2. Setup the graphics card in the Ubuntu container as required for pass-through (See the Proxmox docs - Be sure to set it up as per the requirements for the CT containers, not the KVM Virtual Machines, they have different configurations)
  3. Make certain that the GPU can be seen and used by the Ubuntu container before spinning up the docker (Use something like nvtop - an nvidia tool, but should work on AMD GPU's)
  4. Spin up your docker, and make sure it works inside a test docker first, before running steam-headless.

These steps eliminate the possibility that steam-headless is at fault, making certain that the environment is indeed ready to run steam-headless. If everything works as intended, just passing through /dev/dri should be enough to enable hardware access for the docker container.

I personally have a Radeon 6900XT running on pass-through to a Virtual machine (not a container), and it works fine - but it DOES require a dummy plug to work. I also have a nVidia Quadro P2000 in the same machine, and they both work side by side at the same time without issue, on separate VM's, with separate installs of steam-headless.

I have never attempted to do hardware pass-through to a CT container, but after a little tweaking, it's perfectly fine inside a KVM Virtual Machine on Proxmox.

@Josh5
Copy link
Collaborator

Josh5 commented May 10, 2024

Assumption: You're using a CT container, instead of a KVM Virtual Machine.

  1. Proxmox CT containers require being run in privileged & unprotected mode to be able to access hardware (This does introduce potential security issues, and to enable those modes, you may have to spin up a new container)
  2. Setup the graphics card in the Ubuntu container as required for pass-through (See the Proxmox docs - Be sure to set it up as per the requirements for the CT containers, not the KVM Virtual Machines, they have different configurations)
  3. Make certain that the GPU can be seen and used by the Ubuntu container before spinning up the docker (Use something like nvtop - an nvidia tool, but should work on AMD GPU's)
  4. Spin up your docker, and make sure it works inside a test docker first, before running steam-headless.

These steps eliminate the possibility that steam-headless is at fault, making certain that the environment is indeed ready to run steam-headless. If everything works as intended, just passing through /dev/dri should be enough to enable hardware access for the docker container.

I personally have a Radeon 6900XT running on pass-through to a Virtual machine (not a container), and it works fine - but it DOES require a dummy plug to work. I also have a nVidia Quadro P2000 in the same machine, and they both work side by side at the same time without issue, on separate VM's, with separate installs of steam-headless.

I have never attempted to do hardware pass-through to a CT container, but after a little tweaking, it's perfectly fine inside a KVM Virtual Machine on Proxmox.

Would you be willing to write up a markdown doc guide with some screenshots on how to setup for proxmox?

@Grarak
Copy link

Grarak commented May 19, 2024

You don't necessarily need a dummy plug, try to put amdgpu.virtual_display=0000:03:00.0,1 in grubs cmdline, works for me

@Josh5
Copy link
Collaborator

Josh5 commented May 25, 2024

You don't necessarily need a dummy plug, try to put amdgpu.virtual_display=0000:03:00.0,1 in grubs cmdline, works for me

This is awesome. I dont jave an amd gpu, so I cannot test it myself. Im sure this will be really helpful for lors of people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting-triage type:documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants