Figure error: disconnecting compute ctx failed

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

Figure error: disconnecting compute ctx failed

Postby Cykel » Fri May 02, 2014 6:29 pm

I have been getting this error when trying to draw after a figure window has been closed:

Code: Select all
src/gfx/glctx.cpp:140: disconnecting compute ctx failed


Is there any way to make a new figure beyond the first one? I'd like to be able to close / hide / reopen the figure based on a user's preference.

If the user hits the 'X' button what is required in order to be able to draw again?

Thanks!
Cory
Cykel
 
Posts: 15
Joined: Wed Oct 09, 2013 6:14 pm

Re: Figure error: disconnecting compute ctx failed

Postby shehzan » Mon May 05, 2014 12:24 pm

Hi

From a quick test it does not look like there is no problem in closing a figure and starting another.
I ran one of the examples, closed the window, and drew another figure and it worked fine.
Can you please provide a sample code so that I can test it further.

This problem is probably related to something else, such as indexing or values in the array. If you provide your code, I can test it more rigorously.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Figure error: disconnecting compute ctx failed

Postby Cykel » Mon May 05, 2014 5:16 pm

shehzan wrote:Hi

From a quick test it does not look like there is a problem in closing a figure and starting another.
I ran one of the examples, closed the window, and drew another figure and it worked fine.
Can you please provide a sample code so that I can test it further.

This problem is probably related to something else, such as indexing or values in the array. If you provide your code, I can test it more rigorously.


Hi Shehzan,

Thanks for the reply! Here's a sample routine:

Code: Select all
void SOLVER::GetSolverFromFile()
{
    QString solver_filename = QFileDialog::getOpenFileName(0, tr("Load Solver"), QString(),
            tr("Solver File (*solver.txt)"));

    int cut = solver_filename.lastIndexOf("_");
    QString validity_filename = solver_filename.left(cut) + "_validity.txt";
    QFile  validity_file(validity_filename);
    if(!validity_file.exists()) {
        QMessageBox mError;
        mError.critical(0, "File Error", "Matching validity file not found."
                           "Please select a validity file to use.");
        validity_filename = QFileDialog::getOpenFileName(0, tr("Validity File"), QString(),
                                                         tr("Validity File (*validity.txt)"));
    }

    if(LoadSolver(solver_filename) == -1)
        return;
    if(LoadValidityMap(validity_filename) == -1)
        return;

    af::fig("color","default");
    af::fig("sub", 2, 1, 1);
    af::image(solver_);
    af::fig("title", "Solving Matrix");
    af::fig("sub", 2, 1, 2);
    af::image(af::moddims(validity_map_, grid_x_, grid_y_));
    af::fig("title", "Validity Map");
}


The variables with trailing underscores are all private members of SOLVER.

Note that I can open new solver files (and display them) as much as I want as long as I have the initial figure open. If I close the figure window and then try to run this routine again, I get the stated error. Also I can verify that the solver / validity maps are still loading properly...I just can't display them.
Cykel
 
Posts: 15
Joined: Wed Oct 09, 2013 6:14 pm

Re: Figure error: disconnecting compute ctx failed

Postby shehzan » Mon May 05, 2014 5:57 pm

Hi

Can you append the line following line to the end of your draw section and let me know what happens.
Code: Select all
fig("draw");


I don't see any reason to suspect the draw code - it is straightforward.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Figure error: disconnecting compute ctx failed

Postby Cykel » Mon May 05, 2014 6:27 pm

Unfortunately I see the same problem with
Code: Select all
fig("draw");
appended.

I wonder if there is some sort of hardware / driver issue behind it? I was hoping the error code might ring some bells as my searches came up short.

For what it's worth, I just wrote a quick plotting routine that looks like this:

Code: Select all
void SOLVER::TestFigure() {
   af::fig("color","default");
   af::fig("sub", 1, 1, 1);
   af::image(af::randu(100,100,f32));
   af::fig("title", "Random Test");
   af::fig("draw");
}


It exhibits the same behavior.

I'm using Win7 x64, VC11 compiler, QtCreator 2.7 and Qt 5.0.2. I've got a few other libraries for interfacing with custom hardware but nothing else GPU related.
Cykel
 
Posts: 15
Joined: Wed Oct 09, 2013 6:14 pm

Re: Figure error: disconnecting compute ctx failed

Postby Cykel » Mon May 05, 2014 6:32 pm

Update:

These messages show up from application output when it happens:

Code: Select all
src/gfx/device_api.cpp:230: _e  8
src/gfx/device_api.cpp:223: _e  8
src/gfx/device_api.cpp:427: _e  8
src/gfx/device_api.cpp:230: _e  8
src/gfx/device_api.cpp:223: _e  8
src/gfx/device_api.cpp:427: _e  8
src/gfx/device_api.cpp:230: _e  8
src/gfx/device_api.cpp:230: _e  8


GeForce GTX690
Cykel
 
Posts: 15
Joined: Wed Oct 09, 2013 6:14 pm

Re: Figure error: disconnecting compute ctx failed

Postby shehzan » Mon May 05, 2014 6:38 pm

So I was testing it on linux and it was working fine.
I ran a quick test on Windows with VC11 (VS12), and the error popped up.
The error has to do with window and OpenGL creation.

I will see if there are any other work-arounds for this issue and let you know.

Thanks for providing the info.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Figure error: disconnecting compute ctx failed

Postby shehzan » Tue May 06, 2014 10:16 am

Hi

It does not look like there is an easy work around for this.
Your best option is to not close the window.
I understand this may not be a satisfactory answer but the windowing system in Windows is the reason for this and is not an easy fix.

Let me know if I can provide any further help.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Figure error: disconnecting compute ctx failed

Postby Cykel » Tue May 06, 2014 10:34 am

Hi Shehzan,

Thanks for the clarification. I understand - at least I know the reason. I'd love to move to linux but can't happen in the short term unfortunately.

As far as a workaround, is there an easy way to remove the 'X' button? In other words, force the software or task manager to decide to close it?

R,
Cory
Cykel
 
Posts: 15
Joined: Wed Oct 09, 2013 6:14 pm

Re: Figure error: disconnecting compute ctx failed

Postby shehzan » Tue May 06, 2014 10:47 am

I do not believe that can be done.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm


Return to [archive-commercial] Programming & Development with ArrayFire

cron