[RESOLVED] Sometimes, CUDA context cannot be initialized

Support forum for DGDecNV
Post Reply
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

[RESOLVED] Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

---------------------------
Warning
---------------------------
ERROR: Failed to create CUDA context on device 0

Hit Yes to continue notifying this specific error type; hit No to disable it.
Hit Cancel to suppress all further errors.
---------------------------

Occasionally happens. The only thing you need to do is to try again.

I'm calling from command line using "dgindexnv -i 20.m2ts -o 20.dgi -h -e", etc.

Any chance for an auto reattempt?
DAE avatar
AJR
Posts: 106
Joined: Mon Jan 06, 2014 10:40 am

Re: Sometimes, CUDA context cannot be initialized

Post by AJR »

I have such issues some versions back. With newest version I had no problem. I think Don could make for you debug build to see in what stage it is happened.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

@MeteorRain

We could try something like that but obviously I am averse to band-aid fixes. First, let me ask you some things.

Do you have multiple cards installed? If not, why are you forcing the device number in the INI file?

What are the cards you have installed? What nVidia driver version? Latest DGIndexNV being used (fresh downloaded)?

Is anything else going on in the background? Playing videos? Running any other scripts?
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

Code: Select all

Version=DGIndexNV 2051
Window_Position=16,254
Info_Window_Position=11,100
Process_Priority=2
Playback_Speed=3
AVS_Template_Folder=
AVS_Template_File=template.avs
AVS_Enable_Template=0
AVS_Overwrite=0
Full_Path_In_Files=1
MRUList[0]=L:\xxx
MRUList[1]=L:\xxx
MRUList[2]=L:\xxx
MRUList[3]=L:\xxx
Enable_Info_Log=1
Loop_Playback=0
AVC_Extension=264
MPG_Extension=m2v
VC1_Extension=vc1
HEVC_Extension=hevc
Deinterlace=0
UsePF=0
AlwaysCrop=0
UseD3D=0
Snapped=0
ResponseOnAudioMismatch=0
Enable_Audio_Demux=0
CUDA_Device=0
Decode_Modes=0,0,0,0
Full_Info=0
Bare_Demux=0
Disable_Encrypted_Audio_Warning=1
Fine_Cropping=0
Will answer your other questions later. Hold on for a second.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

You answered a question I didn't ask and none of the ones I did ask. I waited many seconds. :?
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

Sorry I was on my way to office, so post my local config first just in case you need it later -- You know, TeamViewer got hacked and I dare not to leave it running for long.

Following are the answers to your questions.

Yes I have multiple cards, one discrete GTX 950 one integrated from 4th gen i7.

nVidia driver I need to go home to get the number.

I'm using the version (fresh downloaded) about a month ago.

I have tons of programs running and I haven't reboot my computer for 3 months. Windows 10 stable channel.

No video playing at the moment.

Let me clarify: It only happens every couple days, randomly, no matter if I'm using the computer or I'm sleeping, no matter day or night, etc. Almost impossible to reproduce. Run the command again and it works perfectly.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

You have "tons of programs running"?

Can you not reboot and try it with nothing else running?

And how do you run this when you are sleeping? A batch file or something?
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

So basically I have bunch of windows explorer running, sometimes M$ Office running, FTP client running, Sublime Text, couple consoles, etc.

It happens every couple days, and it's not that possible to have nothing else running for couple days.

Yes I'm doing batch encoding using bash and rakefile.

Since I found it stuck in the morning I now always pre-create index beforehand -- and still occasionally hit the issue when creating index in a batch.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

Are you running anything else that consumes GPU memory?

I'll make a test build for you tomorrow that tries several times.
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

Not as I'm aware of, except the desktop itself.
nVidia, afaik, is on 358.91. (If I'm reading the correct version number.)

Just notice that dgindexnv.exe has the last modified date of 1/12.
Should I just update to the latest version first and see how it works?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

Yes, please do a fresh download and test it. I will await your results before making a test build for you.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

Do you have any further test results for us, MeteorRain? One of the recent updates fixed a race condition that could cause problems like yours.
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

admin wrote:Do you have any further test results for us, MeteorRain? One of the recent updates fixed a race condition that could cause problems like yours.
So far so good, tried encoding like 30 files and haven't hit the issue yet.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Sometimes, CUDA context cannot be initialized

Post by admin »

OK, thanks. Let me know if anything untoward occurs, please.
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: [RESOLVED] Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

Not too bad one time per month but still happens.

Image

Was playing a video when the task started.
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: [RESOLVED] Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

One more hit right now. Almost doing nothing just have about 40 windows on the desktop.

Ctrl-C and retry worked.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Sometimes, CUDA context cannot be initialized

Post by admin »

Maybe you ran out of memory.
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: [RESOLVED] Sometimes, CUDA context cannot be initialized

Post by MeteorRain »

admin wrote:Maybe you ran out of memory.
I don't think so, as it sometimes happens right after an encode, so at least 3-4GB of memory is freed right before running dgnv.

And I do have 16GB of memory, not that much but not easy to be used up as well :?
Post Reply