init_cuda_ctx....... invalid device ordinal

Calamon

New Member
To be honest I may have broke something for changed a setting unintentionally yesterday. Trying to improve a games performance. This morning while trying to stream live I got this error. I have been streaming fine for 2 months and this error seems familiar or one close to it but I can recall how to fix it.

init_cuda_ctx: CUDA call "cu->cuDeviceGet(&device, gpu)" failed with CUDA_ERROR_INVALID_DEVICE (101): invalid device ordinal

Now trying to find a fix I did see it was asked for a log report so I will attach it here. Can anyone see what I missed? I even updated my Navidia drivers again.
 

Attachments

  • 2025-01-10 12-50-12.txt
    10.3 KB · Views: 80

rockbottom

Active Member
The logs ends & the encode settings are missing but the wrong GPU is selected. It appears you are using the Advanced Mode, look at your encoder settings & make sure GPU is set to 0 & not 1 or something else.

12:50:21.293: Starting stream due to hotkey
12:50:21.294: [obs-nvenc] different GPU selected by user, falling back to non-texture encoder
12:50:21.315: [obs-nvenc: 'advanced_video_stream'] init_cuda_ctx: CUDA call "cu->cuDeviceGet(&device, gpu)" failed with CUDA_ERROR_INVALID_DEVICE (101): invalid device ordinal
12:50:21.315: Already in fallback encoder, can't fall back further!
12:50:21.315: Stream output type 'rtmp_output' failed to start! Last Error: init_cuda_ctx: CUDA call "cu->cuDeviceGet(&device, gpu)" failed with CUDA_ERROR_INVALID_DEVICE (101): invalid device ordinal

1736547484847.png
 

Krahazik

New Member
I just started getting this same error. It doesn't matter if my device is set to 0 or 1. I have two graphics cards, and for the past 2 weeks, it has been working just fine with the 2nd graphics card. Now I can't go live at all.
 

Krahazik

New Member
I just started getting this same error. It doesn't matter if my device is set to 0 or 1. I have two graphics cards, and for the past 2 weeks, it has been working just fine with the 2nd graphics card. Now I can't go live at all.
Just started getting this error again and I'm on OBS 31.0.3 and there is no longer any setting for selecting the GPU.
 

rogedkone

New Member
Just started getting this error again and I'm on OBS 31.0.3 and there is no longer any setting for selecting the GPU.
Have you found a solution? Maybe the difference is in the stable/unstable version obs?

I have 5080 + 5060 Ti and have same issue, but I can’t reproduce an error, it occurs by accident. I know that on Windows 11 when using streaming + record, GPU load goes 100% and encode 60 - 80. On windows 10 gpu load 0% (encode 60%). This error occurred when I recorded the video, without stream. Maybe the question is in vendors?

Mother: Gygabite Elite Wifi 7 x870e
Gpu: MSI 5080, Palit 5060 Ti
CPu: AMD 9700x
RAM: DDR5 Adata XPG 7.600 (xmp3)
 
Top