KDE Plasma容器化桌面环境支持NVIDIA GPU远程访问
这是一个基于KDE Plasma的容器化桌面环境项目,为Kubernetes优化设计。支持通过NVIDIA GPU实现OpenGL、Vulkan和Wine/Proton功能,利用WebRTC和HTML5技术提供远程云/HPC图形或游戏流媒体服务。采用独立X.Org X11服务器,无需额外主机配置。提供Selkies-GStreamer和KasmVNC两种Web界面,满足不同远程访问需求。
KDE Plasma Desktop container designed for Kubernetes, supporting OpenGL EGL and GLX, Vulkan, and Wine/Proton for NVIDIA GPUs through WebRTC and HTML5, providing an open-source remote cloud/HPC graphics or game streaming platform. Spawns its own fully isolated X.Org X11 Server instead of using the host X Server, not requiring /tmp/.X11-unix
host sockets or host configuration.
Use docker-nvidia-egl-desktop for a KDE Plasma Desktop container which directly accesses NVIDIA (and unofficially Intel and AMD) GPUs without using an X.Org X11 Server, supports sharing one GPU with many containers, supports Apptainer/Singularity, and automatically falling back to software acceleration in the absence of GPUs (but with lower graphics performance).
Please read Troubleshooting first, then use Discord or GitHub Discussions for support questions. Please only use Issues for technical inquiries or bug reports.
Container startup may take some time at first launch as it could automatically install NVIDIA driver libraries compatible with the host.
For Windows applications or games, Wine, Winetricks, Lutris, Heroic Launcher, PlayOnLinux, and q4wine are bundled by default. Comment out the section where it is installed within Dockerfile
if the user wants containers without Wine.
The container requires host NVIDIA GPU driver versions of at least 450.80.02 and preferably 470.42.01 (the latest minor version in each major version), with the NVIDIA Container Toolkit to be also configured on the host for allocating GPUs. The latest minor versions (xx
in 000.xx.00
) are strongly encouraged. All Maxwell or later generation GPUs in the consumer, professional, or datacenter lineups should not have significant issues running this container, although the Selkies-GStreamer high-performance NVENC backend may not be available. Kepler GPUs are untested and likely does not support the NVENC backend, but can be mostly functional using fallback software acceleration.
The high-performance NVENC backend for the Selkies-GStreamer WebRTC interface is only supported in GPUs listed as supporting H.264 (AVCHD)
under the NVENC - Encoding
section of NVIDIA's Video Encode and Decode GPU Support Matrix. If your GPU is not listed as supporting H.264 (AVCHD)
, add the environment variable SELKIES_ENCODER
to values including x264enc
, vp8enc
, or vp9enc
in your container configuration for falling back to software acceleration, which also has a very good performance depending on your CPU.
There are two web interfaces that may be chosen in this container, the first being the default Selkies-GStreamer WebRTC HTML5 web interface (requires a TURN server or host networking for best performance), and the second being the fallback KasmVNC WebSocket HTML5 web interface. While the KasmVNC interface does not support audio forwarding, it can be useful for troubleshooting the Selkies-GStreamer WebRTC interface or using this container in constrained environments.
The KasmVNC interface can be enabled in place of Selkies-GStreamer by setting KASMVNC_ENABLE
to true
. KASMVNC_THREADS
sets the number of threads KasmVNC should use for frame encoding, defaulting to all threads if not set. When using the KasmVNC interface, environment variables SELKIES_ENABLE_BASIC_AUTH
, SELKIES_BASIC_AUTH_USER
, SELKIES_BASIC_AUTH_PASSWORD
, SELKIES_ENABLE_RESIZE
, SELKIES_ENABLE_HTTPS
, SELKIES_HTTPS_CERT
, and SELKIES_HTTPS_KEY
, used with Selkies-GStreamer, are also inherited. As with the Selkies-GStreamer WebRTC interface, the KasmVNC interface username and password will also be set to the environment variables SELKIES_BASIC_AUTH_USER
and SELKIES_BASIC_AUTH_PASSWORD
, also using ubuntu
and the environment variable PASSWD
by default if not set.
1. Run the container with Docker, Podman, or other NVIDIA-supported container runtimes (NVIDIA Container Toolkit required):
docker run --name xgl -it -d --gpus 1 --tmpfs /dev/shm:rw -e TZ=UTC -e DISPLAY_SIZEW=1920 -e DISPLAY_SIZEH=1080 -e DISPLAY_REFRESH=60 -e DISPLAY_DPI=96 -e DISPLAY_CDEPTH=24 -e PASSWD=mypasswd -e SELKIES_ENCODER=nvh264enc -e SELKIES_VIDEO_BITRATE=8000 -e SELKIES_FRAMERATE=60 -e SELKIES_AUDIO_BITRATE=128000 -e SELKIES_BASIC_AUTH_PASSWORD=mypasswd -p 8080:8080 ghcr.io/selkies-project/nvidia-glx-desktop:latest
Alternatively, use Docker Compose by editing the docker-compose.yml
file:
# Start the container from the path containing docker-compose.yml docker compose up -d # Stop the container docker compose down
If the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow, read Step 3 and the WebRTC and Firewall Issues section very carefully.
NOTE: The container tags available are
latest
and24.04
for Ubuntu 24.04,22.04
for Ubuntu 22.04, and20.04
for Ubuntu 20.04. Persistent container tags are available in the form24.04-20210101010101
. Replace all instances ofmypasswd
with your desired password.SELKIES_BASIC_AUTH_PASSWORD
will default toPASSWD
if unspecified. The container must NOT be run in privileged mode.
Change SELKIES_ENCODER
to x264enc
, vp8enc
, or vp9enc
when using the Selkies-GStreamer interface if your GPU does not support H.264 (AVCHD)
under the NVENC - Encoding
section in NVIDIA's Video Encode and Decode GPU Support Matrix.
2. Connect to the web server with a browser on port 8080. You may also separately configure a reverse proxy to this port for external connectivity.
The default username is ubuntu
for both the web authentication prompt and the container Linux username. The environment variable PASSWD
(defaulting to mypasswd
) is the password for the container Linux user account, and SELKIES_BASIC_AUTH_PASSWORD
is the password for the HTML5 interface authentication prompt. If SELKIES_ENABLE_BASIC_AUTH
is set to true
for Selkies-GStreamer but SELKIES_BASIC_AUTH_PASSWORD
is unspecified, the HTML5 interface password will default to PASSWD
.
NOTE: Only one web browser can be connected at a time with the Selkies-GStreamer WebRTC interface. If the signaling connection works, but the WebRTC connection fails, read Step 3 and the WebRTC and Firewall Issues section.
Additional configurations and environment variables for the Selkies-GStreamer WebRTC HTML5 interface are listed in lines that start with parser.add_argument
within the Selkies-GStreamer Main Script or selkies-gstreamer --help
.
3. (Not Applicable for KasmVNC) Read carefully if the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow.
A TURN server is required because you are self-hosting WebRTC, unlike commercial services using WebRTC.
Choose whether to use host networking, an internal TURN server, or an external TURN server.
There is an internal TURN server inside the container that may be used when an external TURN server or host networking is not available.
Add environment variables -e SELKIES_TURN_PROTOCOL=udp -e SELKIES_TURN_PORT=3478 -e TURN_MIN_PORT=65534 -e TURN_MAX_PORT=65535
(change the ports accordingly) with the docker run
command (or uncomment the relevant docker-compose.yml
sections), where the SELKIES_TURN_PORT
should not be used by any other host process or container, and the TURN_MIN_PORT
/TURN_MAX_PORT
port range has to contain at least two ports also not used by any other host process or container.
Then, open the ports with the docker run
arguments -p 8080:8080 -p 3478:3478 -p 3478:3478/udp -p 65534-65535:65534-65535 -p 65534-65535:65534-65535/udp
(or uncomment the relevant docker-compose.yml
sections) in addition to the web server port.
If UDP cannot be used, at the cost of higher latency and lower performance, omit the ports containing /udp
and use the environment variable -e SELKIES_TURN_PROTOCOL=tcp
.
All these ports must be exposed to the internet if you need access over the internet. If you need use TURN within a local network, add -e SELKIES_TURN_HOST=[YOUR_INTERNAL_IP]
with YOUR_INTERNAL_IP
to the internal hostname or IP of the local network.
The Selkies-GStreamer WebRTC HTML5 interface will likely just start working if you open UDP and TCP ports 49152–65535 in your host server network and add --network host
to the above docker run
command, or network_mode: 'host'
in docker-compose.yml
. Note that running multiple desktop containers in one host under this configuration may be problematic and is not recommended. When deploying multiple containers, you must also pass a new DISPLAY
environment variable such as -e DISPLAY=:22
into the container, that is not used with any other X11 server or container in the same host.
However, host networking may be restricted or not be desired because of security reasons or when deploying multiple desktop containers in one host. If not available, check if the container starts working after omitting --network host
.
If having no TURN server does not work, you need an external TURN server. Read the WebRTC and Firewall Issues section and add the environment variables -e SELKIES_TURN_HOST=
, -e SELKIES_TURN_PORT=
, and pick one of -e SELKIES_TURN_SHARED_SECRET=
or both -e SELKIES_TURN_USERNAME=
and -e SELKIES_TURN_PASSWORD=
environment variables to the docker run
command based on your authentication method.
1. Create the Kubernetes Secret
with your authentication password (change keys and values as adequate):
kubectl create secret generic my-pass --from-literal=my-pass=YOUR_PASSWORD
NOTE: Replace
YOUR_PASSWORD
with your desired password, and change the namemy-pass
to your preferred name of the Kubernetes secret with thexgl.yml
file changed accordingly as well. It is possible to skip the first step and directly provide the password withvalue:
inxgl.yml
, but this exposes the password in plain text.
2. Create the pod after editing the xgl.yml
file to your needs, explanations are available in the file:
kubectl create -f xgl.yml
If the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow, read Step 4 and the WebRTC and Firewall Issues section very carefully.
NOTE: The container tags available are
latest
and24.04
for Ubuntu 24.04,22.04
for Ubuntu 22.04, and20.04
for Ubuntu 20.04. Persistent container tags are available in the form24.04-20210101010101
.SELKIES_BASIC_AUTH_PASSWORD
will default toPASSWD
if unspecified. The container must NOT be run in privileged mode.
Change SELKIES_ENCODER
to x264enc
, vp8enc
, or vp9enc
when using the Selkies-GStreamer interface if your GPU does not support H.264 (AVCHD)
under the NVENC - Encoding
section in NVIDIA's Video Encode and Decode GPU Support Matrix.
3. Connect to the web server spawned at port 8080. You may configure the ingress endpoint or reverse proxy that your Kubernetes cluster provides to this port for external connectivity.
The default username is ubuntu
for both the web authentication prompt and the container Linux username. The environment variable PASSWD
(defaulting to mypasswd
) is the password for the container Linux user account, and SELKIES_BASIC_AUTH_PASSWORD
is the password for the HTML5 interface authentication prompt. If SELKIES_ENABLE_BASIC_AUTH
is set to true
for Selkies-GStreamer but SELKIES_BASIC_AUTH_PASSWORD
is unspecified, the HTML5 interface password will default to PASSWD
.
NOTE: Only one web browser can be connected at a time with the Selkies-GStreamer WebRTC interface. If the signaling connection works, but the WebRTC connection fails, read Step 4 and the WebRTC and Firewall Issues section.
Additional configurations and environment variables for the Selkies-GStreamer WebRTC HTML5 interface are listed in lines that start with parser.add_argument
within the Selkies-GStreamer Main Script or selkies-gstreamer --help
.
4. (Not Applicable for KasmVNC) Read carefully if the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow.
A TURN server is required because you are self-hosting WebRTC, unlike commercial services using WebRTC.
Choose whether to use host networking, an internal TURN server, or an external TURN server.
There is an internal TURN server inside the container that may be used when an external TURN server or host networking is not available.
Uncomment the relevant environment variables SELKIES_TURN_PROTOCOL=udp
, SELKIES_TURN_PORT=3478
, TURN_MIN_PORT=65534
, TURN_MAX_PORT=65535
(change the ports accordingly) within xgl.yml
(within name:
and value:
), where the SELKIES_TURN_PORT
should not be used by any other host process or container, and the TURN_MIN_PORT
/TURN_MAX_PORT
port range has to contain at least two ports also not used by
AI小说写作助手,一站式润色、改写、扩写
蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。
字节跳动发布的AI编程神器IDE
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。
全能AI智能助手,随时解答生活与工作的多样问题
问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。
实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。
一键生成PPT和Word,让学习生活更轻松
讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。
深度推理能力全新升级,全面对标OpenAI o1
科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。
一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型
Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。
AI助力,做PPT更简单!
咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。
选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。
专业的AI公文写作平台,公文写作神器
AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。
最新AI工具、AI资讯
独家AI资源、AI项目落地
微信扫一扫关注公众号