Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.98k stars 169 forks source link

handle transient and permanent cuda failures differently #4348

Closed totaam closed 2 months ago

totaam commented 2 months ago

Some of these errors are worth retrying - others are not.

For example, this one is unlikely to yield better results later:

RuntimeError: creating decoder returned error: 'NO_DEVICE'
2024-09-04 16:46:25,252 Error drawing on window 2
Traceback (most recent call last):
  File "/usr/lib64/python3.11/site-packages/xpra/client/mixins/window_manager.py", line 1592, in _do_draw
    window.draw_region(x, y, width, height, coding, data, rowstride,
  File "/usr/lib64/python3.11/site-packages/xpra/client/gui/client_window_base.py", line 838, in draw_region
    backing.draw_region(x, y, width, height, coding, img_data, rowstride, options, callbacks)
  File "/usr/lib64/python3.11/site-packages/xpra/client/gui/window_backing_base.py", line 923, in draw_region
    self.paint_with_video_decoder(VIDEO_DECODERS.get(coding),
  File "/usr/lib64/python3.11/site-packages/xpra/client/gui/window_backing_base.py", line 800, in paint_with_video_decoder
    vd.init_context(coding, enc_width, enc_height, input_colorspace)
  File "xpra/codecs/nvidia/nvdec/decoder.pyx", line 507, in xpra.codecs.nvidia.nvdec.decoder.Decoder.init_context
    self.init_decoder()
  File "xpra/codecs/nvidia/nvdec/decoder.pyx", line 593, in xpra.codecs.nvidia.nvdec.decoder.Decoder.init_decoder
    cudacheck(r, "creating decoder returned error")
  File "/usr/lib64/python3.11/site-packages/xpra/codecs/nvidia/cuda_errors.py", line 17, in cudacheck
    raise RuntimeError(msg)
totaam commented 2 months ago

Improved somewhat in 4ce1d9bd540ec1161ac5d273983e43704155960c + a61ea33c916da2f58947f89426d084463dae3480

We need to remove the decoder spec completely if the error is not transient.. Problem is that some other errors will also show up as RuntimeErrors..

totaam commented 2 months ago

Forgot to tag this ticket: 97d1ac3611c4ca6e18b0656d8700acf99039172c, a071047ef3ff9ab9df0cdbc1db0001ba2426e16a, 9c2953f31e5b9a9274fd87c89c2604e27d86a526

totaam commented 2 months ago

I think that the commits above improve things quite a bit, but the new problem this creates is that we may now end up disabling video decoders that were previously used to expose encodings to the server!

So we may need to tell the server that the list of encodings has changed. Perhaps overload the encoding packet with an optional list of encodings? Or full csc modes for each one?

totaam commented 2 months ago

This will do for now.