Linux Virtual Delivery Agent

Graphics configuration and fine-tuning

This article describes the Linux VDA graphics configuration and fine-tuning.

For more information, see System requirements and the Installation overview section.

Configuration

Optimize for 3D graphics workload

This setting configures the appropriate default values that best suit graphics-intensive workloads. Enable this setting for users whose workload focuses on graphics-intensive applications. Apply this policy only in cases where a GPU is available to the session. Any other settings that explicitly override the default settings set by this policy take precedence.

By default, Optimize for 3D graphics workload is disabled.

Video codec for compression

Thinwire is the display-remoting technology used in the Linux VDA. The technology allows graphics generated on one machine to be transmitted, typically across a network, to another machine for display.

The Use video codec for compression graphics policy sets the default graphics mode and provides the following options for different use cases:

  • Use when preferred. This setting is the default. No additional configuration is required. It ensures that Thinwire is selected for all Citrix connections, and optimized for scalability, bandwidth, and superior image quality for typical desktop workloads.
  • For the entire screen. Delivers Thinwire with full-screen H.264 or H.265 to optimize for improved user experience and bandwidth, especially in cases with heavy use of 3D graphics. Session watermark is supported when For the entire screen is selected, or when Use when preferred is selected and Optimize for 3D graphics workload is enabled.
  • For actively changing regions. The adaptive display technology in Thinwire identifies moving images (video, 3D in motion). It uses AV1, H.265, or H.264 only in the part of the screen where the image is moving. The selective use of the AV1, H.265, or H.264 video codec enables HDX Thinwire to detect and encode parts of the screen that are frequently updated. Still image compression (JPEG, RLE) and bitmap caching continue to be used for the rest of the screen, including text and photographic imagery. Users get the benefit of lower bandwidth consumption and better quality for video content combined with lossless text or high-quality imagery elsewhere. The selective use of AV1 and H.265 is not supported when the Visual quality policy is set to Always Lossless or Build to Lossless.

    For the entire screen being selected

Some other policy settings, including the following visual display policy settings can be used to fine-tune the performance of display remoting:

AV1/H.265/H.264 hardware encoding

The Use hardware encoding for video codec policy allows the use of GPU hardware acceleration, if available, to compress screen elements with the video codec. GPU hardware acceleration optimizes hardware resource utilization and highly improves the performance of frames per second (FPS).

GPU hardware acceleration covers all the graphics modes set by the Use video codec for compression policy:

  • Use when preferred
  • For the entire screen
  • For actively changing regions

To enable hardware video compression, complete the following steps:

  1. Set the Use hardware encoding for video codec policy to Enabled.
  2. Set Use video codec for compression to Use when preferred, For the entire screen, or For actively changing regions. Ensure that it is not set to Do not use video codec.

To be usable, AV1 or H.265 video codec must be supported and enabled on both the VDA and Citrix Workspace app. AV1 gets preference over H.265 and H.264 during codec negotiation. When AV1 is not supported, H.265 gets negotiated. If both AV1 and H.265 are not supported, sessions fall back to using the H.264 video codec. If GPU hardware is not available, the VDA falls back to CPU-based encoding using the software video codec.

Requirements for AV1 hardware encoding

VDA
Client
  • Citrix Workspace app 2305 for Windows or later
  • Client GPU that supports AV1 decoding:
    • NVIDIA Ampere or later
    • Intel 11th Gen / Arc or later
    • AMD Radeon RX 6000 / Radeon Pro W6000 series (RDNA2) or later

Requirements for H.265 hardware encoding

Client
  • Citrix Receiver for Windows 4.10 through 4.12
  • Citrix Workspace app 1808 for Windows and later

To enable H.265 hardware encoding on your client, see H.265 video encoding.

H.265/H.264 lossless compression

H.265/H.264 lossless compression is available for HDX 3D PRO hardware acceleration by NVIDIA GPUs. H.265 lossless compression requires Citrix Workspace app 2305 for Windows and later. H.264 lossless compression requires the following clients:

  • Citrix Workspace app 2303 for Windows and later
  • Citrix Workspace app 2301 for Mac and later with the Apple M1 chip

To enable H.265/H.264 lossless compression, complete the following steps:

  1. Set the Use hardware encoding for video codec policy to Enabled.
  2. Set the Use video codec for compression policy to For the entire screen.

  3. Set the Visual quality policy to Always losses or Build to Lossless.

Allow visually lossless compression

The Allow visually lossless compression policy allows visually lossless compression to be used instead of true lossless compression for graphics. Visually lossless improves performance over true lossless, but has minor loss that is unnoticeable by sight. This setting changes the way the values of the Visual quality setting are used.

The Allow visually lossless compression policy is disabled by default. To enable visually lossless compression, set Allow visually lossless compression to Enabled and the Visual quality policy to Build to Lossless.

If the Use video codec for compression policy is set to Do not use video codec, visually lossless compression applies to static image encoding. If the Use video codec for compression policy is set to a graphics mode other than Do not use video codec, visually lossless compression applies to H.264 encoding.

For more information about the Visual quality and Use video codec for compression policy settings, see Visual display policy settings and Graphics policy settings.

Graphics quality slider

We have included a graphics quality slider in the graphics status indicator tool that runs in your virtual Linux sessions. The slider helps to find the right balance between image quality and interactivity.

To use the slider, complete the following steps:

  1. Enable the Graphic status indicator policy in Citrix Studio.

    The Graphic status indicator policy

  2. Open the Terminal and run the ctxslider command. The slider UI appears.

    Note:

    • If you have set the Visual Quality policy to Always Lossless or Build to Lossless, the slider UI is not showing.

    • You can launch the slider UI from both the Terminal and the system tray.

    Graphic quality slider

    The following choices are now available:

    • To change the image quality, move the slider. The slider supports a range of 0–9.
    • To use system-defined settings, select Let the system decide.
    • To switch to lossless mode, select Pixel perfect.

Adjust average bit rates based on bandwidth estimates

Citrix enhances HDX 3D Pro hardware encoding by adjusting average bit rates based on bandwidth estimates.

When HDX 3D Pro hardware encoding is in use, the VDA can intermittently estimate the bandwidth of the network and adjust the bit rates of encoded frames accordingly. This new feature provides a mechanism to balance between sharpness and fluency.

This feature is enabled by default. To disable it, run the following command:

sudo /opt/Citrix/VDA/bin/ctxreg create -k "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\Thinwire" -t "REG_DWORD" -v "DisableReconfigureEncoder" -d "0x00000001" --force
<!--NeedCopy-->

In addition to using this feature, you can also run the following commands to adjust between sharpness and fluency. The AverageBitRatePercent and MaxBitRatePercent parameters set the percentage of bandwidth usage. The higher values you set, the sharper graphics and lower fluency you get. The recommended setting range is 50–100.

sudo /opt/Citrix/VDA/bin/ctxreg create -k "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\Thinwire" -t "REG_DWORD" -v "AverageBitRatePercent" -d "90" --force

sudo /opt/Citrix/VDA/bin/ctxreg create -k "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\Thinwire" -t "REG_DWORD" -v "MaxBitRatePercent" -d "100" --force
<!--NeedCopy-->

In the average bit rate adjustment, when your screen holds still, the most recent frame stays in a low-quality state because no new frames are sent. Sharpening support can address this issue by reconfiguring and immediately sending the most recent frame at the highest quality.

For a full list of the policies supported by the Linux VDA Thinwire, see Policy support list.

For information on the configuration of multi-monitor support on the Linux VDA, see CTX220128.

Parallel processing

Thinwire can improve the number of Frames Per Second (FPS) by parallelizing certain tasks, with the overhead of slightly higher overall CPU consumption. This feature is disabled by default. To enable the feature, run the following command on your VDA:

sudo /opt/Citrix/VDA/bin/ctxreg create -k "HKLM\System\CurrentControlSet\Control\Citrix\Thinwire" -t "REG_DWORD" -v "ParallelProcessing" -d "0x00000001" --force
<!--NeedCopy-->

Troubleshooting

Check which graphics mode is in use

Run the following command to check which graphics mode is in use (0 means TW+. 1 means full-screen video codec):

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep GraphicsMode
<!--NeedCopy-->

The result resembles:

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "GraphicsMode" -d "0x00000000" --force

Verify that AV1 is in use

Note:

To verify which video codec is in use for the current session, either run a command provided below or check the graphics status through the System tray.

Run the following command to verify that AV1 is in use (0 means not in use. 1 means in use):

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep AV1
<!--NeedCopy-->

For example, the result can resemble:

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "AV1" -d "0x00000000" --force

Verify that H.265 is in use

Run the following command to verify that full-screen H.265 is in use (0 means not in use. 1 means in use):

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep H265
<!--NeedCopy-->

For example, the result can resemble:

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "H265" -d "0x00000000" --force

Verify that H.264 is in use

Run the following command to verify that H.264 is in use (0 means not in use. 1 means in use):

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep H264
<!--NeedCopy-->

For example, the result can resemble:

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "H264" -d "0x00000000" --force

Check which YUV encoding scheme is in use

Run the following command to check which YUV encoding scheme is in use (0 means YUV420. 1 means YUV422. 2 means YUV444):

Note:

The value of YUVFormat is meaningful only when a video codec is in use.

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep YUVFormat
<!--NeedCopy-->

For example, the result can resemble:

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "YUVFormat" -d "0x00000000" --force

Verify that YUV444 software encoding is in use

Run the following command to verify that the YUV444 software encoding is in use:

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep Graphics
<!--NeedCopy-->

When YUV444 is in use, the result resembles:

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "GraphicsMode" -d "0x00000001" --force

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "H264" -d "0x00000001" --force

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "HardwareEncoding" -d "0x00000000" --force

create -k "HKLM\Software\Citrix\Ica\Session\4\Graphics" -t "REG_DWORD" -v "YUVFormat" -d "0x00000002" --force

Verify that HDX 3D Pro is enabled

Run the following commands to verify that HDX 3D Pro is enabled:

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep ProductEdition

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep StackSessionMode

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep 3DPro
<!--NeedCopy-->

When HDX 3D Pro is enabled, the result resembles:

create -k "HKLM\Software\Citrix\VirtualDesktopAgent\State" -t "REG_SZ" -v "ProductEdition" -d "<PLT or ENT>" --force

create -k "HKLM\System\CurrentControlSet\Control\Citrix\WinStations\tcp" -t "REG_DWORD" -v "StackSessionMode" -d "0x00000000" --force

create -k "HKLM\System\CurrentControlSet\Control\Citrix" -t "REG_DWORD" -v "3DPro" -d "0x00000000" --force

To verify that the required NVIDIA libraries are loaded for HDX 3D Pro, run the nvidia-smi command on the Linux VDA. The result resembles:

Tue Apr 12 10:42:03 2016
+------------------------------------------------------+
| NVIDIA-SMI 361.28     Driver Version: 361.28         |
|-------------------------------+----------------------+----------------------+
| 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 K1             Off  | 0000:00:05.0     Off |                  N/A |
| N/A   42C    P0    14W /  31W |    207MiB /  4095MiB |      8%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0      2164  C+G   /usr/local/bin/ctxgfx                          106MiB |
|    0      2187    G   Xorg                                            85MiB |
+-----------------------------------------------------------------------------+
<!--NeedCopy-->

Verify that the hardware encoding is in use for 3D Pro

Run the following command (0 means not in use. 1 means in use):

sudo /opt/Citrix/VDA/bin/ctxreg dump | grep HardwareEncoding
<!--NeedCopy-->

When 3D Pro is in use, the result resembles:

create -k "HKLM\Software\Citrix\Ica\Session\1\Graphics" -t "REG_DWORD" -v "HardwareEncoding" -d "0x00000001" --force

Verify that the NVIDIA GRID graphics driver is installed correctly

To verify that the NVIDIA GRID graphics driver is installed correctly, run nvidia-smi. The result resembles:

+------------------------------------------------------+
| NVIDIA-SMI 352.70     Driver Version: 352.70         |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla M60           Off  | 0000:00:05.0     Off |                  Off |
| N/A   20C    P0    37W / 150W |     19MiB /  8191MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
<!--NeedCopy-->

Set the correct configuration for the card:

etc/X11/ctx-nvidia.sh

HDX 3D Pro multi-monitor redraw issues

If you are seeing redraw issues on screens other than the primary monitor, check that the NVIDIA GRID license is available.

Check Xorg error logs

The log file of Xorg is named similar to Xorg.{DISPLAY}.log in the /var/log/ folder.

Known issues and limitations

For vGPU, the XenServer (formerly Citrix Hypervisor) local console shows the ICA desktop session screen

Workaround: Disable the VM’s local VGA console by running the following command:

[root@xenserver ~]# xe vgpu-param-set uuid=vgpu-uuid extra_args=disable_vnc=1
<!--NeedCopy-->

Gnome 3 desktop popups slow when logging on

It is a limitation of Gnome 3 desktop session startup.

Some OpenGL/WebGL applications do not render well upon resizing the Citrix Workspace app window

Resizing the window of Citrix Workspace app changes the screen resolution. The NVIDIA proprietary driver changes some internal states and might require applications to respond accordingly. For example, the WebGL library element lightgl.js might spawn an error saying that Rendering to this texture is not supported (incomplete frame buffer).