nona returns 234

Asked by Rafael

I was trying to generate a panorama on hugin version 2013.0.0, but nona keeps returning 234. I tried to dig where the problem is, but all I could do is to run the nona command hugin generates:

$ nona -g -r ldr -m TIFF_m -o IMG_3830-IMG_3846 -i 0 /mnt/library/Pictures/2014.01.31\ -\ Ilhabela/panorama\ 1/IMG_3830-IMG_3846.pto
nona: using graphics card: ATI Technologies Inc. AMD Radeon HD 6320 Graphics
destStart=[140, 406]
destEnd=[2140, 3053]
destSize=[(2000, 2647)]
srcSize=[(4272, 2848)]
srcBuffer=0x7f023c06c010
srcAlphaBuffer=0
destBuffer=0x7f023b146010
destAlphaBuffer=0x7f023ac39010
destGLInternalFormat=GL_RGBA8
destGLFormat=GL_RGB
destGLType=GL_UNSIGNED_BYTE
srcGLInternalFormat=GL_RGBA8
srcGLFormat=GL_RGB
srcGLType=GL_UNSIGNED_BYTE
srcAlphaGLType=GL_BYTE
destAlphaGLType=GL_UNSIGNED_BYTE
warparound=0
needsAtanWorkaround=1
maxTextureSize=16384
Source chunks:
    [(0, 0) to (4272, 2848) = (4272x2848)]
Dest chunks:
    [(0, 0) to (2000, 1324) = (2000x1324)]
    [(0, 1324) to (2000, 2647) = (2000x1323)]
Total GPU memory used: 201678592
Interpolator chunks:
    [(0, 0) to (4, 4) = (4x4)]
#version 110
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect SrcTexture;
float sinh(in float x) { return (exp(x) - exp(-x)) / 2.0; }
float cosh(in float x) { return (exp(x) + exp(-x)) / 2.0; }
float atan2_xge0(const in float y, const in float x) {
    if (abs(y) > x) {
        return sign(y) * (1.5707963267948965580 - atan(x, abs(y)));
    } else {
        return atan(y, x);
    }
}
float atan2_safe(const in float y, const in float x) {
    if (x >= 0.0) return atan2_xge0(y, x);
    else return (sign(y) * 3.1415926535897931160) - atan2_xge0(y, -x);
}
float atan_safe(const in float yx) {
    if (abs(yx) > 1.0) {
        return sign(yx) * (1.5707963267948965580 - atan(1.0/abs(yx)));
    } else {
        return atan(yx);
    }
}
void main(void)
{
    float discardA = 1.0;
    float discardB = 0.0;
    vec2 src = gl_TexCoord[0].st;
    src -= vec2(6017.5000000000000000, 1750.5000000000000000);

    // erect_pano(2453.9313396439351891)
    src.t = 2453.9313396439351891 * atan_safe(src.t / 2453.9313396439351891);

    // rotate_erect(7709.2526690391459852, 5011.0142348754452541)
    {
        src.s += 5011.0142348754452541;
        float w = (abs(src.s) > 7709.2526690391459852) ? 1.0 : 0.0;
        float n = (src.s < 0.0) ? 0.5 : -0.5;
        src.s += w * -15418.505338078291970 * ceil(src.s / 15418.505338078291970 + n);
    }

    // sphere_tp_erect(2453.9313396439351891)
    {
        float phi = src.s / 2453.9313396439351891;
        float theta = -src.t / 2453.9313396439351891 + 1.5707963267948965580;
        if (theta < 0.0) {
            theta = -theta;
            phi += 3.1415926535897931160;
        }
        if (theta > 3.1415926535897931160) {
            theta = 3.1415926535897931160 - (theta - 3.1415926535897931160);
            phi += 3.1415926535897931160;
        }
        float s = sin(theta);
        vec2 v = vec2(s * sin(phi), cos(theta));
        float r = length(v);
        theta = 2453.9313396439351891 * atan2_safe(r, s * cos(phi));
        src = v * (theta / r);
    }

    // persp_sphere(2453.9313396439351891)
    {
        mat3 m = mat3(-0.016626326079946719683, 0.99685994882744510814, 0.077419685512322727883,
                      -0.99986177308720192158, -0.016576409871205875085, -0.0012873828872969046797,
                      0.0000000000000000000, -0.077430388475878506038, 0.99699776074998014419);
        float r = length(src);
        float theta = r / 2453.9313396439351891;
        float s = 0.0;
        if (r != 0.0) s = sin(theta) / r;
        vec3 v = vec3(s * src.s, s * src.t, cos(theta));
        vec3 u = v * m;
        r = length(u.st);
        theta = 0.0;
        if (r != 0.0) theta = 2453.9313396439351891 * atan2_safe(r, u.p) / r;
        src = theta * u.st;
    }

    // rect_sphere_tp(2453.9313396439351891)
    {
        float r = length(src);
        float theta = r / 2453.9313396439351891;
        float rho = 0.0;
        if (theta >= 1.5707963267948965580) rho = 1.6e16;
        else if (theta == 0.0) rho = 1.0;
        else rho = tan(theta) / theta;
        src *= rho;
    }

    // resize(1.4061037225257644323, 1.4061037225257644323)
    src *= vec2(1.4061037225257644323, 1.4061037225257644323);

    // radial(1.0160607130997310055, 0.0000000000000000000, -0.016060713099730901388, 0.0000000000000000000, 1424.0000000000000000, 4.5921576618644461831)
    {
        float r = length(src) / 1424.0000000000000000;
        float scale = 1000.0;
        if (r < 4.5921576618644461831) {
            scale = ((0.0000000000000000000 * r + -0.016060713099730901388) * r + 0.0000000000000000000) * r + 1.0160607130997310055;
        }
        src *= scale;
    }

    // vert(-0.82856517828013398486)
    src.t += -0.82856517828013398486;

    // horiz(-110.86610103024599994)
    src.s += -110.86610103024599994;

    src += vec2(2135.5000000000000000, 1423.5000000000000000);

    src = src * discardA + vec2(-1000.0, -1000.0) * discardB;
    gl_FragColor = vec4(src.s, 0.0, 0.0, src.t);
}
#version 110
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect CoordTexture;
uniform sampler2DRect SrcTexture;
uniform sampler2DRect AccumTexture;
uniform vec2 SrcUL;
uniform vec2 SrcLR;
uniform vec2 KernelUL;
uniform vec2 KernelWH;
float w(const in float i, const in float f) {
    float A = -0.75000000000000000000;
    float c = abs(i - 1.0);
    float m = (i > 1.0) ? -1.0 : 1.0;
    float p = c + m * f;
    if (i == 1.0 || i == 2.0) {
        return (( A + 2.0 )*p - ( A + 3.0 ))*p*p + 1.0;
    } else {
        return (( A * p - 5.0 * A ) * p + 8.0 * A ) * p - 4.0 * A;
    }
}
void main(void)
{
    vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
    vec4 accum = texture2DRect(AccumTexture, gl_TexCoord[0].st);

    src -= SrcUL;
    vec2 t = floor(src) + -0.50000000000000000000;
    vec2 f = fract(src);
    vec2 k = vec2(0.0, 0.0);

    for (float ky = 0.0; ky < 4.0000000000000000000; ky += 1.0) {
        k.t = ky + KernelUL.t;
        float wy = w(k.t, f.t);
        for (float kx = 0.0; kx < 4.0000000000000000000; kx += 1.0) {
            k.s = kx + KernelUL.s;
            float wx = w(k.s, f.s);
            vec2 ix = t + k;
            vec4 sp = texture2DRect(SrcTexture, ix);
            float weight = wx * wy * sp.a;
            accum += sp * weight;
        }
    }

    gl_FragColor = accum;
}

#version 120
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect NormTexture;
uniform sampler2DRect CoordTexture;
uniform sampler2DRect InvLutTexture;
uniform sampler2DRect DestLutTexture;
void main(void)
{
    // Normalization
    vec4 n = texture2DRect(NormTexture, gl_TexCoord[0].st);
    vec4 p = vec4(0.0, 0.0, 0.0, 0.0);
    if (n.a >= 0.2) p = n / n.a;

    // Photometric
    // invLutSize = 256.00000000000000000
    // pixelMax = 255.00000000000000000
    // destLutSize = 1024.0000000000000000
    // destExposure = 0.0031229171262691984498
    // srcExposure = 0.0032653060494637008680
    // whiteBalanceRed = 1.0000000000000000000
    // whiteBalanceBlue = 1.0000000000000000000
    p.rgb = p.rgb * 255.00000000000000000;
    vec2 invR = texture2DRect(InvLutTexture, vec2(p.r, 0.0)).sq;
    vec2 invG = texture2DRect(InvLutTexture, vec2(p.g, 0.0)).sq;
    vec2 invB = texture2DRect(InvLutTexture, vec2(p.b, 0.0)).sq;
    vec3 invX = vec3(invR.x, invG.x, invB.x);
    vec3 invY = vec3(invR.y, invG.y, invB.y);
    vec3 invA = fract(p.rgb);
    p.rgb = mix(invX, invY, invA);
    // VigCorrMode=VIGCORR_RADIAL
    float vig = 1.0;
    {
        vec2 vigCorrCenter = vec2(2135.5000000000000000, 1423.5000000000000000);
        float radiusScale=0.00038953665465254853906;
        float radialVigCorrCoeff0 = 1.0000000000000000000;
        float radialVigCorrCoeff1 = -0.59193827167905099795;
        float radialVigCorrCoeff2 = 0.55932038085845503517;
        float radialVigCorrCoeff3 = -0.37438228130769002355;
        vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
        vec2 d = src - vigCorrCenter;
        d *= radiusScale;
        vig = radialVigCorrCoeff0;
        float r2 = dot(d, d);
        float r = r2;
        vig += radialVigCorrCoeff1 * r;
        r *= r2;
        vig += radialVigCorrCoeff2 * r;
        r *= r2;
        vig += radialVigCorrCoeff3 * r;
    }
    vec3 exposure_whitebalance = vec3(0.95639339129699996178, 0.95639339129699996178, 0.95639339129699996178);
    p.rgb = (p.rgb * exposure_whitebalance) / vig;
    p.rgb = p.rgb * 1023.0000000000000000;
    vec2 destR = texture2DRect(DestLutTexture, vec2(p.r, 0.0)).sq;
    vec2 destG = texture2DRect(DestLutTexture, vec2(p.g, 0.0)).sq;
    vec2 destB = texture2DRect(DestLutTexture, vec2(p.b, 0.0)).sq;
    vec3 destX = vec3(destR.x, destG.x, destB.x);
    vec3 destY = vec3(destR.y, destG.y, destB.y);
    vec3 destA = fract(p.rgb);
    p.rgb = mix(destX, destY, destA);

    gl_FragColor = p;
}

gpu shader program compile time = 0.554
gpu shader texture/framebuffer setup time = 0.056
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] coord image render time = 0.052
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] source chunk=[(0, 0) to (4272, 2848) = (4272x2848)] src upload = 0.091
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] source chunk=[(0, 0) to (4272, 2848) = (4272x2848)] src render = 0.026
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] source chunk=[(0, 0) to (4272, 2848) = (4272x2848)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.008
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] source chunk=[(0, 0) to (4272, 2848) = (4272x2848)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.05
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] normalization setup = 0.018
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] normalization render = 0.018
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] dest rgb disassembly setup = 0.007
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] dest rgb disassembly render = 0.012
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] rgb readback = 0.054
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] dest alpha disassembly setup = 0.001
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] dest alpha disassembly render = 0.006
gpu dest chunk=[(0, 0) to (2000, 1324) = (2000x1324)] alpha readback = 0.03
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] coord image render time = 0.043
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] source chunk=[(0, 0) to (4272, 2848) = (4272x2848)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.006
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] source chunk=[(0, 0) to (4272, 2848) = (4272x2848)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.069
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] normalization setup = 0.006
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] normalization render = 0.022
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] dest rgb disassembly setup = 0.008
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] dest rgb disassembly render = 0.022
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] rgb readback = 0.03
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] dest alpha disassembly setup = 0.004
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] dest alpha disassembly render = 0.007
gpu dest chunk=[(0, 1324) to (2000, 2647) = (2000x1323)] alpha readback = 0.02
gpu destruct time = 0.002
gpu total time = 1.272

$ echo $?
234

Any clue?

Thanks,

Rafael

Question information

Language:
English Edit question
Status:
Answered
For:
Hugin Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
tmodes (tmodes) said :
#1

Remove the switch -g from the command line. It seems gpu remapping does not work with your graphics systems (graphic card+driver).
In Hugin go to preferences, tab Programs and deactivate option "Use GPU for remapping".

Or you could try to update your graphics card driver. But there is no guarantee that this helps.

Can you help with this problem?

Provide an answer of your own, or ask Rafael for more information if necessary.

To post a message you must log in.