Menu

Example programs fail to run on OSX Lion

2013-04-19
2013-06-12
  • Josh Susskind

    Josh Susskind - 2013-04-19

    I downloaded and built the ViennaCL library v1.4 on my MacBookPro Retina with OSX Lion. I've got all the standard dev tools (xcode, cmake, etc) and when I followed the installation instructions for Linux/OSX I was able to cmake and make the library and binaries successfully. However, when I tried running a couple of the example apps they die with the following error:

    arak:build josh$ examples/tutorial/blas1
    terminate called throwing an exceptionAbort trap: 6

    Has anyone come across this?

     
  • Karl Rupp

    Karl Rupp - 2013-04-19

    Hi,

    it seems like an exception is thrown, possibly because something is no initialized properly. Could you please wrap a try/catch around the code in main() like this:

    try
    {
        // tutorial code here
    } 
    catch(std::exception const & e)
    { 
      std::cout << "Exception: " << e.what() << std::endl;
    }
    

    As an alternative, please run the code in a debugger and send us a stacktrace.

    Thanks and best regards,
    Karli

     
  • Josh Susskind

    Josh Susskind - 2013-04-22

    Thanks for the response.
    I get a "Exception: ViennaCL: FATAL ERROR: CL_INVALID_VALUE." and when I ran this in the debugger I see that it happens the first time that the program tries to set a GPU variable:
      viennacl::scalar<ScalarType> vcl_s2 = ScalarType(1.0);

    Earlier lines in the code worked fine, e.g. ScalarType s3 = ScalarType(42.0).  Thus, the problem appears to be something specific about accessing the GPU.
    Note that I just tried the exact same code on a MacPro workstation and everything worked fine. It was also running Lion, and had a very similar dev environment.
    Perhaps this is a problem specific to the new Retina Macbook Pros.

    Here is the system profiler output for the graphics card information on my MBP retina. Perhaps you'll see if there's a problem:

    Graphics/Displays:

        NVIDIA GeForce GT 650M:

          Chipset Model: NVIDIA GeForce GT 650M
          Type: GPU
          Bus: PCIe
          PCIe Lane Width: x8
          VRAM (Total): 1024 MB
          Vendor: NVIDIA (0x10de)
          Device ID: 0x0fd5
          Revision ID: 0x00a2
          ROM Revision: 3688
          gMux Version: 3.2.19

        Intel HD Graphics 4000:

          Chipset Model: Intel HD Graphics 4000
          Type: GPU
          Bus: Built-In
          VRAM (Total): 512 MB
          Vendor: Intel (0x8086)
          Device ID: 0x0166
          Revision ID: 0x0009
          gMux Version: 3.2.19
          Displays:
            Color LCD:
              Display Type: LCD
              Resolution: 2880 X 1800
              Retina: Yes
              Pixel Depth: 32-Bit Color (ARGB8888)
              Main Display: Yes
              Mirror: Off
              Online: Yes
              Built-In: Yes
              Connection Type: DisplayPort

     
  • Josh Susskind

    Josh Susskind - 2013-04-22

    Also, I'm not sure why the system_profiler says there's two graphics cards, but I just checked more detail and it appears that I'm using the Intel HD Graphics 4000 one.

     
  • Karl Rupp

    Karl Rupp - 2013-04-24

    hmm, if the Intel graphics chip is used, I can imagine the following failure: With 512 MB RAM for the GPU, quite a substantial amount is required for the high resolution of the Retina display 4 Byte * 2880 x 1800 is about 20 MB per frame. With double-buffering and some other things in place, it may well be that the example just runs out of memory. This would at least explain why you only see the issues on this one machine, but not on another.

    My experience is that CL_INVALID_VALUE is sometimes returned if there are problems with allocating memory, hence this would be consistent. Other than that, I have really no idea what else could go wrong. Which device is returned as first device when running viennacl-info?

     
  • Josh Susskind

    Josh Susskind - 2013-04-24

    Here's the output of viennacl-info:

    arak:build josh$ examples/tutorial/viennacl-info
    # =========================================
    #         Platform Information            
    # =========================================
    #
    # Vendor and version: Apple: OpenCL 1.1 (Aug 10 2012 19:59:48)
    #
    # ViennaCL uses this OpenCL platform by default.
    #
    # Available Devices:
    #

      ---------------------------
      No.:              0
      Name:             Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
      Compute Units:    8
      Workgroup Size:   1024
      Global Memory:    16384 MB
      Local Memory:     32 KB
      Max-alloc Memory: 4096 MB
      Double Support:   1
      Driver Version:   1.1
      ---------------------------

      ---------------------------
      No.:              1
      Name:             GeForce GT 650M
      Compute Units:    2
      Workgroup Size:   1024
      Global Memory:    1024 MB
      Local Memory:     48 KB
      Max-alloc Memory: 256 MB
      Double Support:   0
      Driver Version:   CLH 1.0
      ---------------------------

    ###########################################

     
  • Karl Rupp

    Karl Rupp - 2013-04-24

    Thanks, nothing suspicious here. I'm still puzzled about the cause of the error. You mentioned that only some examples fail. Could you please tell me which of them actually fail? Maybe I can find a common pattern.

     

Log in to post a comment.