NICE DCV – Tips and Tricks

Working since many years with NICE DCV our technical team at NI SP has compiled a number of Tips and Tricks related to related to NICE DCV administration and tuning. If you have any further questions just let us know.

Location of NICE DCV Logfiles

Typically Windows DCV Logfiles are here:   C:\ProgramData\NICE\dcv\log\ and

Linux DCV Logfiles are here: /var/log/dcv/

Changing the debug level in the DCV Client and the DCV Server

To create debug logfiles on the DCV client side:

  • open a command prompt and go to the folder where the dcvviewer application is located (it is usually in C;\Program Files (x86)\NICE\DCV\Client\bin) and the start the DCV Client:
  • dcvviewer.exe --log-level=debug --log-file-name=log.txt
  • reproduce the issue
  • send us the log.txt file that has been generated in that folder

On the server side on Linux you can add in the [log] section in /etc/dcv/dcv.conf:

[log]
log-level="debug"

This will enable debug logs after restart of the DCV server. After debugging please comment this entry again or configure the default “info”. The verbosity levels (in order of the amount of detail they provide) are: ‘error’,
‘warning’, ‘info’, and ‘debug’.

On Windows the registry entry is HKEY_USERS\S-1-5-18\Software\GSettings\com\nicesoftware\dcv\log\level where we can set the value to “debug”. In DCV on Windows the loglevel is immediately active in the DCV agent server.

To enable debug logs in the browser please connect adding “?logLevel=debug” to the URL – eg.: https://11.60.0.25:8443/?logLevel=debug

Disable NICE DCV Authentication on Windows

To disable the NICE DCV authentication on Windows you can follow these steps:

  1. Open the Windows Registry Editor.
  2. Navigate to the HKEY_USERS/S-1-5-18/Software/GSettings/com/nicesoftware/dcv/security/key and select the authentication parameter.​ ​If there is no authentication parameter in the registry key, create one
    ​a. In the left-hand pane, open the context (right-click) menu for the authentication key and​ ​choose New, string value.
    b. For Name, type authentication and press Enter.
  3. Open the authentication parameter. For Value data, enter either system or none.
  4. Choose OK and close the Windows Registry Editor.

Allow different users to connect to DCV on Windows

DCV on Windows by default starts one session, this session has an “owner”.

The default owner proposed at installation time is Administrator. You can change it during installation time or afterwards in the registry.

By default only the owner can connect to that session. If you want multiple users to be able to connect to the session, you have to change the DCV session permissions. From the DCV admin guide:

The default permissions file is used for all sessions if you do not specify a custom permissions file when creating a session. The default permissions file grants only the session owner full access to all features.

You can customize the default permissions file to include custom authorizations. The default permissions file is located at C:\Program Files\NICE\DCV\Server\conf\default.perm on Windows NICE DCV servers.”

You can configure a group (e.g. osgroup:YOUR_GROUP) or allow all users (%any%) to connect in default.perm:

[groups]
mygroup1=dom\user1, user2

[aliases]
; create permission alias
file-management=file-upload, file-download, clipboard-management

[permissions]
; Example to allow all users to connect
%any% allow builtin

; Example to allow users from osgroup YOUR_GROUP to connect
osgroup:YOUR_GROUP allow builtin

; allow the predefined mygroup to connect
group:mygroup1 allow builtin


The following features can be configured in the permissions file which allows for fine-granular permission control e.g. related to file transfer, cut&paste, USB devices, … :

builtin — All features.
display — Receive visual data from the NICE DCV server.
clipboard-copy — Copy data from the NICE DCV server to the client clipboard.
clipboard-paste — Paste data from the client clipboard to the NICE DCV server.
file-download — Download files from the session storage.
file-upload — Upload files to the session storage.
mouse — Input from the client pointer to the NICE DCV server.
keyboard — Input from the client keyboard to the NICE DCV server.
keyboard-sas — Use the secure attention sequence (CTRL+Alt+Del). Requires the keyboard
feature. Supported on version DCV 2017.3 and later.
touch — Use native touch events. Supported on version DCV 2017.3 and later. Not supported on Linux NICE DCV servers.
stylus — Input from specialized USB devices, such as 3D pointing devices or graphic tablets.
usb — Read the smart card from the client.
pointer — View NICE DCV server mouse position events and pointer shapes. Supported on version DCV 2017.3 and later.
audio-out — Play back NICE DCV server audio on the client.
audio-in — Insert audio from the client to the NICE DCV server.
printer — Print PDFs or XPS files from the NICE DCV server to the client.
smartcard — Read the smart card from the client.

Linux: nVidia driver not working anymore

In case an update of the kernel is performed e.g. via the yum update command, then the nVidia driver needs to be reinstalled. The related commands typically look similar like this (please remember to use dcvgldiag to check the DCV installation):

# reinstall the nVidia driver
sudo sh NVIDIA-Linux-x86_64-430.26.run
sudo nvidia-xconfig --preserve-busid --enable-all-gpus
# Add line ‘Option "UseDisplayDevice" "None" ’ into Screen section
sudo vim /etc/X11/xorg.conf
# ensure that X server is running; you might get logged out by these commands
sudo systemctl isolate multi-user.target
sudo systemctl isolate graphical.target
# enable DCV for 3D
sudo dcvgladmin enable
# verify the installation with dcvgldiag
dcvgldiag ### typical out like below

dcvgldiag is a very convenient tool to check the DCV installation on Linux which is part of the NICE DCV download:

root@host# dcvgldiag
NICE DCV - Diagnostic Script
 Host:             ip-172-31-19-22.eu-west-1.compute.internal
 Architecture:     x86_64
 Operating System: Red Hat Enterprise Linux Server release 7.7 (Maipo)
 Kernel Version:   3.10.0-1062.1.2.el7.x86_64
 Nvidia GPU:       GRID K520
 Nvidia Driver:    430.26
 Runlevel:         5
 X configuration file: /etc/X11/xorg.conf
 DCV GL is enabled for 64 bit applications.
 Running tests: ………………. DONE
 No problem found.
 A detailed report about the tests is available in '/root/dcvgldiag-qc1nmo'

And check if the nVidia driver is working fine again:

# check if the driver is working properly
root@host# nvidia-smi
Mon Jun 29 12:46:29 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GRID K520           Off  | 00000000:00:03.0 Off |                  N/A |
| N/A   46C    P0    44W / 125W |    357MiB /  4037MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2500      G   /usr/bin/X                                    62MiB |
|    0      2778      G   /usr/bin/gnome-shell                           4MiB |
|    0      3452      C   /usr/libexec/dcv/dcvagent                     60MiB |
|    0      4004      G   /usr/bin/gnome-shell                          59MiB |
|    0      7712      G   ...ownloads/lsprepost4.6_centos7/lsprepost   162MiB |
+-----------------------------------------------------------------------------+

Adapt the DCV image quality for best user experience

For fine-grained control, you can tune the 0-100 quality setting on the server side by modifying the /etc/dcv/dcv.conf file and adding a line to the display section:

[display]
quality="(30,50)"

​The format is (minimum_quality,maximum_quality).  So in this case it would lower the maximum H264 quality from it’s default value of 80 to 50. You can also raise the lower boundary from 30 to a higher value which will result in a higher bandwidth consumption while providing better image quality in the H264 stream.

On Windows it would be the respective parameter in HKEY_USERS​\​S-1-5-18​\​Software​\​GSettings​\​com​\​nicesoftware​\​dcv​\display\quality were we can create a string entry with “(50,90)” in case we want to always have a higher quality in the H264 stream with a higher bandwidth consumption.

When a larger portion of the screen content changes DCV will use a H264 stream to display the changing content. When the image is steady a pixel-perfect quality update will be send with the exact copy of the server side image on the GPU. To disable the quality update we can set HKEY_USERS​\​S-1-5-18​\​Software​\​GSettings​\​com​\​nicesoftware​\​dcv​\display\enable-qu to false.

Further optimization in case you are working in a high bandwidth environment and want to increase image quality testing effects in the following order on the DCV server (you need to reconnect to the session or restart the DCV server to pick up the settings):

  • Increase the H264 image quality by setting display/quality to e.g. (60, 80) or (80, 90). This will lead to an increase in bandwidth consumption so you can try (90,100) as well which will result in the highest quality and bandwidth consumption
  • Tweak queue weights for low latency and high bandwidth by setting display/frame-queue-weights to (8,5,1) (default: (5,3,1)). This is related to increase the number of active frames (DCV will send more frames before waiting for an ACK from the client). Related to this is to
  • Control the min-max frames in transit, default is (2, 4). E.g. set
    display/frames-in-transit to (2, 8)
  • Configure to use more bandwidth for the quality update by setting display/qu-bandwidth to 30 (or 50)
  • Disable heatmap evaluation by setting display/enable-heatmap to 0​
  • Adapt the frame limiter by setting display/target-fps to 60 or even disable it by setting it to 0
  • Set display/use-grabber-dirty-region to false (Specifies whether to use dirty screen regions. If enabled, the grabber tries to compute new frames out of the dirty regions from the screen.)

All these settings can be applied for DCV on Linux as well in dcv.conf in the [display] section similar to the example above.

More settings related to the DCV display configuration and other paramters can be found here: https://docs.aws.amazon.com/dcv/latest/adminguide/config-param-ref.html#display

Please note the Reload context column in each table indicates when the parameter is reloaded. Possible contexts include:

  • server—The parameter is loaded once when the server is started. If the parameter value is updated, the new value is loaded when the server is restarted.
  • session—The parameter is loaded when the session is created. If the parameter value is updated, the new value is loaded for subsequent sessions.
  • connection—The parameter is loaded when a new client connection is established. If the parameter value is updated, the new value is used for subsequent client connections.
  • custom—The conditions under which the parameter loads is unique to this parameter. See the parameter description for more information.

How to increase image quality forcing YUV444 or YUV420 lossless updates

In some cases high fidelity of images is needed like in movie editing where chroma artifacts introduced by the H264 stream can be an issue. In this case the colorspace can be changed for better image quality while increasing the network usage.

Force YUV444 colorspace for video content

Tradeoff: improve the overall quality, but increase the network usage.
To enable this on the Windows client there are two options:

  • Launch the client from the command line and set the option –enable-yuv444-decoding=true, for example with the command:C:\WINDOWS\system32>”C:\Program Files (x86)\NICE\DCV\Client\bin\dcvviewer.exe” –enable-yuv444-decoding=true
  • Set the EnableYUV444Decoding=true setting in the connection file [options] section. For example, add this configuration to the connection file:[options] EnableYUV444Decoding=true

To enable this on the Linux client and macOS client, you need to set the dconf registry:

  • Launch the dconf-editor and enable the option enable-yuv444-decoding at path com -> nicesoftware -> DcvViewer -> display.

It is not possible to set this option on the web client.

Force YUV colorspace for lossless updates

Tradeoff: reduce flickering, but lossless updates will not have the exact RGB values of the server source.

To enable this on the Windows client:

  • Launch the client from the command line and set the option –enable-lossless-yuv-decoding=true, for example with the command:C:\WINDOWS\system32>”C:\Program Files (x86)\NICE\DCV\Client\bin\dcvviewer.exe” –enable-lossless-yuv-decoding=true
  • Set the EnableLosslessYUVDecoding=true setting in the connection file [options] section. For example, add this configuration to the connection file:[options] EnableLosslessYUVDecoding=true

To enable this on the Linux client and macOS client, you need to set the dconf registry:

  • Launch the dconf-editor and set the option lossless-colorspace to value yuv_rec601 at path com -> nicesoftware -> DcvViewer -> display.

It is not possible to set this option on the web client.

Analyze GPU consumption with nVidia SMI and Process Explorer

You can find out how much GPU memory your applications are using with the nVidia tool nvidia-smi (/usr/bin/nvidia-smi) on Linux or C:\'Program Files'\'NVIDIA Corporation'\NVSMI\nvidia-smi.exe on Windows. With the option -a nvidia-smi will show full GPU details.

nvidia-smi on Linux with 10 Mio nodes LS-Dyna model loaded in LS-PrePost

Another very helpful tool to understand GPU usage on Windows is Process Explorer (Microsoft Process Explorer). Here a sample output with GPU consumption by Blender:

GPU frame rate drops to 1 fps after some minutes

On Linux instances with NVIDIA GPUs the Display Power Management (DPMS) can reduce the performance of the GPU and limit the GPU frame rate to 1 fps. The issue can be reproduced on physical hosts, with driver 415.xx and later.

The issue is not related to DCV. It can be reproduced without a running DCV server by e.g. running glxgears for some minutes in a SSH connection:

DISPLAY=:0 glxgears
...
300 frames in 5.0 seconds = 59.972 FPS
300 frames in 5.0 seconds = 59.972 FPS
300 frames in 5.0 seconds = 59.972 FPS
101 frames in 5.7 seconds = 17.767 FPS
5 frames in 5.0 seconds =  1.000 FPS
5 frames in 5.0 seconds =  1.000 FPS
...

The issue can be solved by disabling the HardDPMS option of NVIDIA driver 415 and later.

To disable the HardDPMS option add this row to the Device section of the /etc/X11/xorg.conf file:

Section "Device"
    ...
    Option         "HardDPMS" "false"
    ...
EndSection

or in an Extensions section

Section "Extensions"
    Option      "DPMS" "Disable"
EndSection

Check supported display resolutions

On Linux, make sure that the X server is running and use the command xrandr to get the minimum and maximum resolution supported by the driver:

$ DISPLAY=:0 xrandr
Screen 0: minimum 8 x 8, current 2560 x 1600, maximum 2560 x 1600
[...]

On Windows, you can use the following command from a PowerShell terminal to get the list of supported resolutions:

PS C:\> foreach ($video in Get-WmiObject -Class CIM_VideoControllerResolution) { Write-Host $video }
....
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="1920 x 1080 x 4294967296 colors @ 59 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="1920 x 1200 x 4294967296 colors @ 59 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="1920 x 1440 x 4294967296 colors @ 59 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="2048 x 1536 x 4294967296 colors @ 59 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="2560 x 1440 x 4294967296 colors @ 59 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="2560 x 1600 x 4294967296 colors @ 59 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="3840 x 2160 x 4294967296 colors @ 60 Hertz“
\\EC2AMAZ-PDQBG1E\root\cimv2:CIM_VideoControllerResolution.SettingID="4096 x 2160 x 4294967296 colors @ 60 Hertz“

Partially inspired by NICE support articles. If you have any questions or comments please let us know.