Open Nadahar opened 5 months ago
When the program starts, it doesn't know what the user will use, rdp or rustdesk. Could you try https://github.com/21pages/test/releases/download/test/gpucodec_available.exe or debug this repo?
When I run gpucodec_available.exe
on the same computer from a RDP connection, it crashes with the same error. However, before it crashes, it outputs the following:
encoders:
FeatureContext { driver: NVENC, luid: 69739, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 127202171, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 69739, api: API_DX11, data_format: H264 }
FeatureContext { driver: NVENC, luid: 127202171, api: API_DX11, data_format: H264 }
decoders:
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] create nvdecoder
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 66 ms
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
Session Initialization Time: 35 ms
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
Session Deinitialization Time: 11 ms
Session Deinitialization Time: 13 ms
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 50 ms
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 23 ms
[2024-03-30T03:34:40Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
Just to be clear, I'm not trying to initialize a RustDesk connection when this happens. I'm controlling the computer using MS RDP and just starts the RustDesk GUI client and the crash happens.
Yes, detection is done when the program starts and it's another process.
I will change to first check its capabilities with the driver before actually testing it.
However, your driver supports h264 and h265, I will give you a program to print more logs and find the line where it crashes.
Yes, this computer has a RTX 2080 TI, so it probably supports everything except AV1. But, as I said, this problem doesn't happen if I sit locally at the computer when starting RustDesk. I can run gpucodec_available.exe
locally to get more output if that's of any help.
I just ran gpucodec_available.exe
when sitting physically at the computer. As expected, I didn't get the "crash report" from Windows when running it locally:
encoders:
FeatureContext { driver: NVENC, luid: 68321, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 68321, api: API_DX11, data_format: H264 }
decoders:
[2024-03-30T04:08:42Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 53 ms
[2024-03-30T04:08:42Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:08:42Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 20 ms
[2024-03-30T04:08:42Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
Session Deinitialization Time: 6 ms
Session Deinitialization Time: 9 ms
DecodeContext { device: None, driver: CUVID, luid: 68321, api: API_DX11, data_format: H264, output_shared_handle: false }
DecodeContext { device: None, driver: CUVID, luid: 68321, api: API_DX11, data_format: H265, output_shared_handle: false }
DecodeContext { device: None, driver: CUVID, luid: 68321, api: API_DX11, data_format: H264, output_shared_handle: false } DecodeContext { device: None, driver: CUVID, luid: 68321, api: API_DX11, data_format: H265, output_shared_handle: false }
This time it didn't crash and only luid: 68321
, not two differnt luids, you uninstall one driver?
This time it didn't crash and only luid: 68321, not two differnt luid
Yes, because I didn't run it from a RDP session. I didn't uninstall anything - the only difference is that I was sitting physically in front of the computer instead of remote controlling it from another computer with RDP.
I will try the scenario using rdp, could you try this program through rdp and show the log? https://github.com/21pages/test/releases/download/test/gpucodec_available_log.exe
It also crashed, but before crashing it output the following:
encoders:
FeatureContext { driver: NVENC, luid: 68321, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 2400212, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 68321, api: API_DX11, data_format: H264 }
FeatureContext { driver: NVENC, luid: 2400212, api: API_DX11, data_format: H264 }
decoders:
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] create nvdecoder
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] decode_and_recreate
Session Initialization Time: 60 ms
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] Decode result: 1 frames
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] prepare
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_srv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_rtv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_view_port ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_sample ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_shader ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_vertex_buffer ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] register_texture ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] GetFrame: 86085992448
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] BeginQuery
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] copy_cuda_frame ok
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] create nvdecoder
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] draw ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] decode_and_recreate
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] CopyResource ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] destroy
Session Initialization Time: 27 ms
Session Deinitialization Time: 9 ms
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] delete dec_ ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] Decode result: 1 frames
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] prepare
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_srv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_rtv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_view_port ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_sample ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_shader ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_vertex_buffer ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] register_texture ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] GetFrame: 86085992448
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] BeginQuery
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] copy_cuda_frame ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] draw ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] delete decoder
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] CopyResource ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] destroy
Session Deinitialization Time: 27 ms
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] delete dec_ ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] delete decoder
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] create nvdecoder
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] decode_and_recreate
Session Initialization Time: 51 ms
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] Decode result: 1 frames
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] prepare
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_srv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_rtv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_view_port ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_sample ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_shader ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_vertex_buffer ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] register_texture ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] GetFrame: 86077603840
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] BeginQuery
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] copy_cuda_frame ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] draw ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] CopyResource ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] destroy
Session Deinitialization Time: 8 ms
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] delete dec_ ok
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] create nvdecoder
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] decode_and_recreate
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] delete decoder
Session Initialization Time: 35 ms
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] Decode result: 1 frames
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] prepare
[2024-03-30T04:24:43Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_srv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_rtv ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_view_port ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_sample ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_shader ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] set_vertex_buffer ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] register_texture ok
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] GetFrame: 86069215232
[2024-03-30T04:24:43Z INFO gpu_common::inner] [CUVID] BeginQuery
function copy_cuda_frame failed in the last try
Could you show log of this program? https://github.com/21pages/test/releases/download/test/gpucodec_available_log2.exe
Note: log2
didn't crash!
encoders:
FeatureContext { driver: NVENC, luid: 68321, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 2400212, api: API_DX11, data_format: H265 }
FeatureContext { driver: NVENC, luid: 68321, api: API_DX11, data_format: H264 }
FeatureContext { driver: NVENC, luid: 2400212, api: API_DX11, data_format: H264 }
decoders:
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 71 ms
nSrcPitch 2048, m_nSurfaceHeight: 1088, m_nLumaHeight: 1080, m_nChromaHeight: 540
m.dstPitch 1920, GetWidth(): 1920
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame begin, luid:68321codec: H264
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:0
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:1
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame end
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] create nvdecoder
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy
Session Deinitialization Time: 15 ms
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete dec_ ok
Session Initialization Time: 34 ms
nSrcPitch 2048, m_nSurfaceHeight: 1088, m_nLumaHeight: 1080, m_nChromaHeight: 540
m.dstPitch 1920, GetWidth(): 1920
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame begin, luid:68321codec: H265
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete decoder
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:0
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:1
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame end
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy
Session Deinitialization Time: 16 ms
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete dec_ ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete decoder
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 34 ms
nSrcPitch 2048, m_nSurfaceHeight: 1088, m_nLumaHeight: 1080, m_nChromaHeight: 540
m.dstPitch 1920, GetWidth(): 1920
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame begin, luid:2400212codec: H264
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:0
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:1
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame end
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy
Session Deinitialization Time: 27 ms
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete dec_ ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete decoder
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] create nvdecoder
Session Initialization Time: 37 ms
nSrcPitch 2048, m_nSurfaceHeight: 1088, m_nLumaHeight: 1080, m_nChromaHeight: 540
m.dstPitch 1920, GetWidth(): 1920
[2024-03-30T04:49:48Z TRACE gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame begin, luid:2400212codec: H265
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] width:1920, height:1080, chromaHeight:540
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:0
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] do copy i:1
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuGraphicsSubResourceGetMappedArray ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] cuMemcpy2D ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] copy_cuda_frame end
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy
Session Deinitialization Time: 7 ms
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete dec_ ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] destroy ctx ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] free_driver ok
[2024-03-30T04:49:48Z INFO gpu_common::inner] [CUVID] delete decoder
DecodeContext { device: None, driver: CUVID, luid: 68321, api: API_DX11, data_format: H264, output_shared_handle: false }
DecodeContext { device: None, driver: CUVID, luid: 2400212, api: API_DX11, data_format: H264, output_shared_handle: false }
DecodeContext { device: None, driver: CUVID, luid: 68321, api: API_DX11, data_format: H265, output_shared_handle: false }
DecodeContext { device: None, driver: CUVID, luid: 2400212, api: API_DX11, data_format: H265, output_shared_handle: false }
It doesn't seem to happen every time, all code changes are log
The previous versions crash consistently - the latest version doesn't crash even if I run it multiple times. So, something has changed so that the crash isn't triggered.
I tried running the previous version again now (log.exe
), and it still crashes - so something has changed in log2.exe
.
I don't know why this happens, I can ensure there is only code format and log changes
It could be a timing issue - I've encountered such issues before where adding enough logging "solves" the issue because the logging takes enough time to space the operations far enough apart.
I'm experiencing consistent "crashes" when starting RustDesk on a remote computer that is controlled through
mstsc.exe
. RustDesk doesn't actually close or stop working, but Windows reports that "RustDesk Remote Desktop has stopped working". There's no further error code, and I can't really find much relevant in the RustDesk log either, it only logs the following:The crash causes the following error logged in the event log (sorry that this is localized to Norwegian, but there's not much I can do about that):
However, when I build RustDesk without including the
gpucodec
feature, this "crash" doesn't happen. The "crash" happens every time RustDesk is started, so it seems like there's some initialization code that causes the crash. If starting RustDesk from the physical computer instead, no such error occurs.I've seen similar issues with some software in the past, I don't think everything that's "available" when being on the computer locally is available via a RDP connection, I think some things (like hardware acceleration) is unavailable when running via RDP.