Results 1 to 8 of 8

Thread: Error:-42: Argument 1 of instuction 'selp':must be register

  1. #1

    Error:-42: Argument 1 of instuction 'selp':must be register

    Hi,

    I have this error by changing static value in the kernel by arg value :

    Log = ptxas application ptx input, line 57; error : Argument 1 of instuction 'selp': must be register
    ptxas application ptx input, line 57; error : Argument 2 of instuction 'selp': must be register
    ptxas fatal : Ptx assembly aborted due to errors
    error : Ptx compilation failed: gpu='sm_13', device code='anonymous_jit_identity'
    : Retrieving binary for 'anonymous_jit_identity', for gpu='sm_13', usage mode=''
    : Considering profile 'compute_10' for gpu='sm_13' in 'anonymous_jit_identity'
    : Control flags for 'anonymous_jit_identity' disable search path
    : Ptx binary found for 'anonymous_jit_identity', architecture='compute_10'
    : Ptx compilation for 'anonymous_jit_identity', for gpu='sm_13', ocg options=''
    My kernel :

    Code :
    #define TYPE short
     
    __kernel void threshold(__global const TYPE *inputBuffer, __global TYPE *outputBuffer, const TYPE insideValue, const TYPE outsideValue, const TYPE thresholdHighValue, const TYPE thresholdLowValue)
    {
        int location = get_global_id(0);
        TYPE pixel ;
        if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
        {
            pixel = insideValue; // works if pixel =1000
        }
        else
        {
            pixel = outsideValue;
        }
        outputBuffer[location] = pixel;
    }

    The following codes work if pixel value is static:
    Code :
    if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
    {
        pixel = 1000;
    }
    else
    {
        pixel = 0;
    }
    Code :
    if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
    {
        pixel = insideValue;
    }
    else
    {
        pixel = 0;
    }

    Code :
    if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
    {
        pixel = 1000;
    }
    else
    {
        pixel = outsideValue;
    }

    , but not with both, insideValue, outsideValue together.

    Every part of code for "insideValue, outsideValue, thresholdHighValue, thresholdLowValue" are the same and all value are readed well before sending to GPU.

    Did you have any idea on this issue.
    Thanks.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    Good job finding out what works and what doesn't Have you tried contacting NVidia's technical support?
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    No, I haven't. Should I contact them?
    My first contact for OpenCL problem is always here .

    The problem propably come from me, but where? Finding a serious fault on technical aspect shouldn't be easy.
    Can it be a memory problem? (I don't thing so)

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    I don't see any error on your code, and even if there was, the error message from the compiler is not acceptable. You should definitely bring this to the attention of NVidia's support.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  5. #5

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    OK.

    The only similar error finding is here :
    http://forums.nvidia.com/index.php?showtopic=174885
    posted July 22, 2010 without any reply.

    I'll try to contact them, and post here if any concrete solution is suggest.

  6. #6

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    So, technical support suggest to register as an NVIDIA developer by click to link, where I can't :

    You must have your parent or guardian complete the COPPA form and submit it to the administrator before your member account can be created.
    ......
    Should I register here too, don't know.

    Another thread funding about similar problem is here, without solution for now:
    http://forums.nvidia.com/index.php?showtopic=153344

    I will search a alternative ...

  7. #7

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    I feel little bit like I talk to myself .

    I don't know how name this (trick, solution, ... not really) but I will develop my working code.

    Part of kernel code was :
    Code :
    ....
    if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
    {
        pixel = insideValue; 
    }
    else
    {
        pixel = outsideValue;
    }
    outputBuffer[location] = pixel;

    strangely, if I only change
    Code :
    pixel = outsideValue;
    by,
    Code :
    pixel = outsideValue+1; // or +2, +50, +1000
    , it works involving an offset.

    BUT, this code doesn't work too :
    Code :
    if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
    {
        pixel = insideValue+1;
    }
    else
    {
        pixel = outsideValue+1;
    }
    outputBuffer[location] = pixel-1;

    So, a working alternative is:
    Code :
    if(inputBuffer[location] < thresholdHighValue && inputBuffer[location] > thresholdLowValue)
    {
        pixel = insideValue; 
        outputBuffer[location] = pixel;
    }
    else
    {
        pixel = outsideValue+1;
        outputBuffer[location] = pixel-1;
    }

    I don't know if this problem will be fixed later or not, but hope it can be useful to someone.

  8. #8
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Error:-42: Argument 1 of instuction 'selp':must be regis

    Thanks for posting this solution in case other users find the same problem
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. clCreateImage : 'host_ptr_max_size' argument
    By polar01 in forum Suggestions for next release
    Replies: 0
    Last Post: 09-20-2012, 07:57 AM
  2. Kernel argument size
    By perlish in forum OpenCL
    Replies: 5
    Last Post: 09-03-2012, 05:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •