Skip to content

Instantly share code, notes, and snippets.

@salanki
Last active April 22, 2023 08:58
Show Gist options
  • Save salanki/2af5a1181bd20dc8bf7c5a3a47d258f1 to your computer and use it in GitHub Desktop.
Save salanki/2af5a1181bd20dc8bf7c5a3a47d258f1 to your computer and use it in GitHub Desktop.
KNative Service for Unreal Engine Pixelstream
# On how to build the pixelstreaming images yourself: https://adamrehn.com/articles/pixel-streaming-in-linux-containers/
# and https://github.com/adamrehn/ue4-example-dockerfiles/tree/master/pixel-streaming. All images used in this YAML are public.
# Developed for Bare Metal Managed Kubernetes GPUs from http://www.coreweave.com
# Will work locally without any additional components if POD CIDRs are reachable from the clients computer. To work from the Internet, a STUN/TURN server needs to be setup. Hit me up for more info on that.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: ue4-temple
spec:
template:
metadata:
annotations:
node.coreweave.com/gpu: GeForce_RTX_2060_Super
autoscaling.knative.dev/panicWindowPercentage: "1.0"
autoscaling.knative.dev/panicThresholdPercentage: "110.0"
autoscaling.knative.dev/minScale: "1"
spec:
containerConcurrency: 1
containers:
- name: game
image: coreweave/ue4:templet-pixelstream
command: ["/home/ue4/project/SunTemple.sh"]
args: ["-AudioMixer", "-RenderOffScreen", "-NvEncFrameRateNum=1", "-ResX=1920", "-ResY=1080", "-ForceRes", "-AllowPixelStreamingCommands", "-NvEncMaxEncodeWidth=3840", "-NvEncMaxEncodeHeight=2160"]
resources:
requests:
cpu: 1 # The CPU unit is mili-cores. 500m is 0.5 cores
memory: 2Gi
limits:
nvidia.com/gpu: 1
- name: webrtcproxy
image: coreweave/ue4:webrtcproxy
resources:
requests:
cpu: 500m # The CPU unit is mili-cores. 500m is 0.5 cores
memory: 2Gi
- name: signallingserver
image: coreweave/ue4:signallingserver
resources:
requests:
cpu: 100m # The CPU unit is mili-cores. 500m is 0.5 cores
memory: 64Mi
ports:
- name: http1
containerPort: 80
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment