Page 1 of 1

[RESOLVED] Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 12:24 am
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?

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 6:10 am
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.

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 7:16 am
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?

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 10:27 am
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.

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 12:28 pm
by admin
You answered a question I didn't ask and none of the ones I did ask. I waited many seconds. :?

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 1:18 pm
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.

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 3:11 pm
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?

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 4:45 pm
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.

Re: Sometimes, CUDA context cannot be initialized

Posted: Fri Jun 03, 2016 9:04 pm
by admin
Are you running anything else that consumes GPU memory?

I'll make a test build for you tomorrow that tries several times.

Re: Sometimes, CUDA context cannot be initialized

Posted: Sat Jun 04, 2016 2:07 am
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?

Re: Sometimes, CUDA context cannot be initialized

Posted: Sat Jun 04, 2016 7:46 am
by admin
Yes, please do a fresh download and test it. I will await your results before making a test build for you.

Re: Sometimes, CUDA context cannot be initialized

Posted: Tue Jun 07, 2016 6:24 am
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.

Re: Sometimes, CUDA context cannot be initialized

Posted: Tue Jun 07, 2016 7:30 pm
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.

Re: Sometimes, CUDA context cannot be initialized

Posted: Wed Jun 08, 2016 6:20 am
by admin
OK, thanks. Let me know if anything untoward occurs, please.

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

Posted: Sat Jul 02, 2016 6:00 pm
by MeteorRain
Not too bad one time per month but still happens.

Image

Was playing a video when the task started.

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

Posted: Fri Aug 05, 2016 1:25 am
by MeteorRain
One more hit right now. Almost doing nothing just have about 40 windows on the desktop.

Ctrl-C and retry worked.

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

Posted: Sun Aug 07, 2016 5:02 pm
by admin
Maybe you ran out of memory.

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

Posted: Sat Aug 13, 2016 5:01 pm
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 :?