- Newest
- Most votes
- Most comments
After a lot of trial and error, i found a working solution. Unfortunately, I am not quite clear on what exactly the issue was, but i was able to create a functioning Dockerfile. I suspect I installed some packages in the wrong order or forgot some, leading to the setup not working. Nevertheless, here is a working Dockerfile for Ubuntu:
FROM ubuntu:20.04 as dcv
USER root
ARG DEBIAN_FRONTEND=noninteractive
# Prepare the container to run systemd inside
ENV container docker
# Install tools
RUN apt-get update && apt upgrade -y &&\
apt-get install -y \
tar vim wget kmod software-properties-common apt-transport-https \
sudo pciutils ca-certificates xz-utils locales curl && \
apt-get update
# install X Server, Gnome and GL libs/dependencies
RUN apt-get install -y \
mesa-utils libxvmc-dev libxatracker-dev \
xserver-xorg-core xserver-xorg xserver-xorg-dev xorg x11-utils xauth xinit \
openbox xfonts-base xterm freeglut3 ubuntu-desktop-minimal gnome-shell gdm3 \
libglfw3-dev libgles2-mesa-dev libglew-dev glew-utils
# Install Nvidia Driver, configure Xorg, install NICE DCV server
ENV NVIDIA_VISIBLE_DEVICES all
# ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV NVIDIA_DRIVER_CAPABILITIES all
ADD NVIDIA-installer.run /tmp/NVIDIA-installer.run
# RUN wget -q http://us.download.nvidia.com/XFree86/Linux-x86_64/430.26/NVIDIA-Linux-x86_64-430.26.run -O /tmp/NVIDIA-installer.run
RUN bash /tmp/NVIDIA-installer.run --accept-license \
--install-libglvnd \
--no-questions --no-kernel-module-source \
--no-nvidia-modprobe --no-kernel-module \
--disable-nouveau \
--no-backup \
--ui=none \
&& rm -f /tmp/NVIDIA-installer.run \
&& nvidia-xconfig --preserve-busid --enable-all-gpus -connected-monitor=DFP-0,DFP-1,DFP-2,DFP-3
# Install NICE DCV
RUN mkdir -p /tmp/dcv-inst && \
cd /tmp/dcv-inst && \
wget https://d1uj6qtbmh3dt5.cloudfront.net/NICE-GPG-KEY && \
gpg --import NICE-GPG-KEY && \
wget https://d1uj6qtbmh3dt5.cloudfront.net/2022.2/Servers/nice-dcv-2022.2-13907-ubuntu2004-x86_64.tgz && \
tar -xvzf nice-dcv-2022.2-13907-ubuntu2004-x86_64.tgz && cd nice-dcv-2022.2-13907-ubuntu2004-x86_64 && \
apt install -y \
./nice-dcv-server_2022.2.13907-1_amd64.ubuntu2004.deb \
./nice-dcv-web-viewer_2022.2.13907-1_amd64.ubuntu2004.deb \
./nice-xdcv_2022.2.481-1_amd64.ubuntu2004.deb \
./nice-dcv-gl_2022.2.983-1_amd64.ubuntu2004.deb \
./nice-dcv-simple-external-authenticator_2022.2.198-1_amd64.ubuntu2004.deb -y && \
usermod -aG video dcv && \
rm -rf /tmp/dcv-inst
# Define the dcvserver.service
COPY dcvserver.service /usr/lib/systemd/system/dcvserver.service
# Copy the NICE DCV license file
COPY license.lic /etc/dcv/license.lic
# Send Notification message DCV session ready
COPY send_dcvsessionready_notification.sh /usr/local/bin/
# Open required port on firewall, create test user, send notification, start DCV session for the user
COPY startup_script.sh /usr/local/bin
# Start DCV server and initialize level 5
COPY run_script.sh /usr/local/bin/
# Init DCV session configuration, start dotnet application
COPY init_session.sh /usr/local/bin
# Configure DCV settings
COPY dcv.conf /etc/dcv
# Append the startup script to be executed at the end of initialization and fix permissions
RUN chmod +x "/usr/local/bin/run_script.sh" \
"/usr/local/bin/send_dcvsessionready_notification.sh" \
"/usr/local/bin/startup_script.sh" \
"/usr/local/bin/init_session.sh"
EXPOSE 8443
CMD ["/usr/local/bin/run_script.sh"]
The setup is based on the one provided by the official NICE DCV vendor (centos7) and I tried to adapt it. This version is more or less a prototype and it may be possible to reduce the number of packages further, I have not tested that specifically. It's quite possible that there is a number of useless packages included. This setup runs on a Ubuntu EC2 g4dn.xlarge instance.
Are there any updates to this? Do you have a Github repo of everything I can clone and try myself? I don't see an init_session file for example.
Depending on your OS and instance you can use this guide: https://www.ni-sp.com/nice-dcv-in-containers/#nice-dcv-container-with-nvidia-gpu . A session init file is typically not needed as usually the standard X session startup works well - depends on your use case.
the init_session file handles startup stuff for our internal specific usecase, but is not needed, I just copy pasted the whole script essentially. I currently have no plans to upload to github, as our current docker file incorporates project related stuff as well, so I would have to clean that up. One thing I would like to add, however, is the fact that on the host machine you probably need to install the following packages: gdm3 xorg openbox Otherwise the container is unable to correctly start. Don't forget to run systemctl start gdm3
Hello,
As per the documentation below, if the command does not return LOCAL:, local users doesn't have access to the X server. Run the following commands to restart the X server, and to disable and re-enable DCV GL:
$ sudo systemctl isolate multi-user.target
$ sudo dcvgladmin disable
$ sudo dcvgladmin enable
$ sudo systemctl isolate graphical.target
However, if you still experience an issues after running the above commands, you may review server logs located at "/var/log/dcv/server.log" to identify any specific errors.
You may refer the following documentation to check the available logs: https://docs.aws.amazon.com/dcv/latest/adminguide/troubleshooting-logs.html
Additionally, you may also perform the following checks on the system to ensure the installation is working or not.
- Confirm NVIDIA drivers are installed and functional:
$ nvidia-smi -q | head
- Check if there is a display manager installed:
$ cat /etc/X11/default-display-manager
- Verify if display manager is running:
LightDm
$ service lightdm status
GDM3
$ service gdm status
- Check for errors in display manager log files;
/var/log/lightdm
- Check the X server is running:
$ ps aux | grep X | grep -v grep
- Check X server and dcv log files;
/var/log/Xorg.0.log
/var/log/dcv/server.log
Relevant content
- asked 8 months ago
- asked 2 years ago
- asked 8 months ago
- asked 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 10 months ago
Great progress!! Congratulations!!