sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    Leopard hang fix

    已排程 已置頂 已鎖定 已移動 SketchUp Bug Reporting
    sketchup
    80 貼文 53 Posters 34.1k 瀏覽 53 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • I 離線
      inio
      最後由 inio 編輯

      Short answer: If you have Intel GMA950 graphics (early MacBooks and all Mac Minis?) and SketchUp is locking up after you box-select or just randomly after you try to select objects, this download my resolve the issue. The latest versions of MacOS and SketchUp that this patch has been confirmed useful with are 10.5.6 and 7.0.8656.

      tested with OSX 10.5.6 and SU 7.0.8656(plus 216 more downloads a few posts down)

      If you have trouble with the above link, I've put it up here.

      In the worst case, this patch's side effects will be reduced performance or graphical artifacts.

      Slightly longer answer: MacOS 10.5 introduced a driver bug for certain video cards that causes SketchUp to freeze for several seconds after box selecting. This package installs a runtime patch causes SketchUp to fully refresh the display after certain types of rendering operations, preventing the freezes from occurring. For source code of the patch, see a few posts down.

      **Tip:**Even though it's unlikely to cause problems, it's a good idea to verify that this patch is still necessary after updating SketchUp or MacOS. Just uninstall it (using the uninstaller script put into your SketchUp directory) and see if you can make SketchUp lock up.

      ================== ORIGINAL POST ======================

      Just fired up SketchUp for the first time since installing leopard on my MacBook and ... Hmmm, hanging oddly when I select lines. I see there's other reports of this, but I noticed one thing that hadn't been mentioned before so I figured I should share:

      I fired up SpinControl (as one should when an app starts freezing on them unexpectedly and clicked around in SketchUp a bit. Got a hang, clicked over to SC, and the call tree for thread 1 shows glBegin in 716 out of 751 samples. It looks like in those instances glBegin is resulting a command buffer flush of some sort through private APIs inside CG (glcDoNonSimpleFlushOptions calls CGSFlushSurfaceWithOptions, calls _CGSFlushSurfaceInline calls a mach trap), and that's taking a while.

      Knowing the OpenGL is the problem, I fire up Sketchup from OpenGL Profiler with "collect trace" enabled. Using the box selection tool causes the hang as others have reported and ... it locks up for a solid 10 seconds. Wee! The trace log shows that some of the calls glBegin (called for each line segment?) are taking 16,000 to 30,000 microseconds. Hmm, that sounds like multiples of 60Hz, my display's native refresh rate.

      Thus my guess is, for some reason glEnd is synchronizing to the display. So lets try to figure out what OpenGL state is causing this. Looking at a trace, it looks like glClear is called at the beginning of each normal frame, but not before rectangle drags - this makes it a good target. Open up the breakpoints window, set a breakpoint before glClear, click over to the state tab and check the "changes since last breakpoint" box. Results are ... nadda. There is no difference (according to apple's tools) in the OpenGL state between a normal responsive frame and a frame where glEnd beam synchs.

      This smells like a driver bug. I'm guessing it relates to switching between drawing to the front buffer and back buffer. One work around could be to draw an empty frame after any front buffer drawing.

      1 條回覆 最後回覆 回覆 引用 0
      • bradB 離線
        brad
        最後由 編輯

        Hey INIO,

        Your attention to detail and great bug reporting will help us in finding the cause of this problem.

        I have asked a few developers to look into this matter. I can't make any promises about the resolution, but having the information you gave sure is a great starting place.

        Thank you.

        Brad

        Brad
        SketchUp QA

        1 條回覆 最後回覆 回覆 引用 0
        • I 離線
          inio
          最後由 編輯

          To make installing (and uninstalling) it easier I've put together an Installer package. Along with the InputManager, it also throws an applescript in your sketchup folder to uninstall it.


          ThawUp Installer.pkg.zip

          1 條回覆 最後回覆 回覆 引用 0
          • T 離線
            tim
            最後由 編輯

            @unknownuser said:

            Hey INIO,

            Your attention to detail and great bug reporting will help us in finding the cause of this problem.

            Damn right - I wish more of my users would take so much trouble to help!

            1 條回覆 最後回覆 回覆 引用 0
            • H 離線
              heckler
              最後由 編輯

              Thank you so much Inio!
              Your fix was too helpful!

              1 條回覆 最後回覆 回覆 引用 0
              • W 離線
                willem-anne
                最後由 編輯

                Inio, your fix is also useful in sketchup's update dating 5th of december.
                It really speeds up sketchup on the Mac Book, great work!

                1 條回覆 最後回覆 回覆 引用 0
                • G 離線
                  GaryWith1R
                  最後由 編輯

                  Thanks Inio - Sketchup was unusable even after the latest update with constant hangs. I've been searching for a cheap alternative to complete a project I'm in the middle of, but couldn't find anything as powerful - so this fix has saved the day! 😎

                  1 條回覆 最後回覆 回覆 引用 0
                  • I 離線
                    inio
                    最後由 編輯

                    Good to know. The fix should be pretty harmless - in the worst case it will cause graphical artifacts and a very slight slowdown in future versions once they fix the problem directly.

                    edit: that said, it should be uninstalled once the problem is fixed. There's no reason to keep it around and it could conceivably cause minor problems. This is why I included the uninstaller script.

                    1 條回覆 最後回覆 回覆 引用 0
                    • H 離線
                      huevosgrandes
                      最後由 編輯

                      Thanks.. that fixes my problems.. I thought it was because I had installed earlier a patch for the pro... Cheers

                      1 條回覆 最後回覆 回覆 引用 0
                      • W 離線
                        wingnut21
                        最後由 編輯

                        Worked for me as well! Thanks for taking matters into your own hands!

                        1 條回覆 最後回覆 回覆 引用 0
                        • N 離線
                          numin
                          最後由 編輯

                          just got SU6 installed on my new macbook and is really disappointed at the problems I'm facing on getting it to function 'normally'. I've been using Sketchup since the first versions and is very impressed with how its grown. However, that was when I was still on Windows. Incredibly, SU6 works so much faster on my 2 year old Dell XPS (centrino duo).
                          Been searching around the whole day today and turns out that its got something to do with the macbooks GMA 900 video card that's now working with OpenGL and sketchup which caused those little dots to follow the cursor. Turning OpenGL of, solves it but also slows it down so much that its not exactly functional or usable.
                          I'm still on Tiger and on a 2.16ghz macbook 1Gb RAM and the older video processor GMA 900.
                          Should I try this install?

                          1 條回覆 最後回覆 回覆 引用 0
                          • P 離線
                            phatphil
                            最後由 編輯

                            Trying it now. SketchUp has sucked for me all around since the upgrade to Leopard.

                            Edit: The fix seems to work perfect. Very appreciated!

                            1 條回覆 最後回覆 回覆 引用 0
                            • G 離線
                              georgetemplemanmac.com
                              最後由 編輯

                              I have been struggling with SU since the purchase of my new mac pro with x1900xt graphics card. The lag during use and the hanging when importing images was unbearable.

                              I have just installed the fix and repeated the the previous import problem and all seems to be well

                              Many thanks indeed

                              1 條回覆 最後回覆 回覆 引用 0
                              • K 離線
                                kiddo
                                最後由 編輯

                                The fix is in & working. Thanks for saving my Canadian bacon for the holiday homework. Hopefully there aren't any other Leopard bugs lurking about. Cheers

                                1 條回覆 最後回覆 回覆 引用 0
                                • K 離線
                                  krisbern
                                  最後由 編輯

                                  Inio,

                                  Thanks for the patch! Works fantastic! Nothing was working in SU. Nothing.

                                  Cheers,

                                  • Kris
                                  1 條回覆 最後回覆 回覆 引用 0
                                  • L 離線
                                    lebagelman
                                    最後由 編輯

                                    Another big thanks, the fix is working fine. I was going crazy restarting Sketchup every 10 minutes.

                                    lebagelman

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • S 離線
                                      SuperJUN
                                      最後由 編輯

                                      Inio,

                                      it is my first reply in this forum, and i would like to say "thank you!"

                                      the fix, it just works! and it make SU in leopard work!

                                      thank u very very much

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • I 離線
                                        inio
                                        最後由 編輯

                                        BTW, if anyone's wondering 10.5.2 and it's Graphics Update do NOT fix the driver bug that causes this.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • I 離線
                                          inio
                                          最後由 編輯

                                          Looks like I was right. The attached "input manager" seem to resolve the freezes as far as I can tell. It causes visual artifacts in a few cases when dragging rectangles, but that hopefully isn't too big of an issue.

                                          (bare Input Manager obsoleted by dedicated installer package above).

                                          Here's the source code, if you're interested. If you want the full project, let me know and I'll post it.:

                                          
                                          @interface ThawUp ; NSObject 
                                          {
                                          }
                                          @end
                                          
                                          #import "APELite.h"
                                          #import "OpenGL/gl.h"
                                          #import "OpenGL/OpenGL.h"
                                          
                                          static void (*orig_glClear) (GLbitfield mask) = nil;
                                          static void new_glClear(GLbitfield mask);
                                          
                                          static void (*orig_glDrawBuffer) (GLenum mode) = nil;
                                          static void new_glDrawBuffer(GLenum mode);
                                          
                                          static BOOL wasFront;
                                          
                                          @implementation ThawUp
                                          + (void) load
                                          {
                                              if(![[[NSBundle mainBundle] bundleIdentifier] hasPrefix;@"com.google.sketchup"]){ return; }
                                              NSLog(@"ThawUp loaded as input manager");
                                          	
                                          	wasFront = FALSE;
                                          	
                                          	orig_glClear = APEPatchCreate(glClear, new_glClear);
                                          	orig_glDrawBuffer = APEPatchCreate(glDrawBuffer, new_glDrawBuffer);
                                          }
                                          
                                          static void new_glClear(GLbitfield mask) {
                                              if (wasFront) {
                                          		wasFront = FALSE;
                                          		NSLog(@"ThawUp causing CGLFlushDrawable");
                                          		CGLFlushDrawable(CGLGetCurrentContext());
                                          	}
                                          	orig_glClear(mask);
                                          }
                                          
                                          static void new_glDrawBuffer(GLenum mode) {
                                          	if (mode == GL_FRONT) wasFront = TRUE;
                                          	orig_glDrawBuffer(mode);
                                          }
                                          @end
                                          
                                          

                                          ThawUp.zip

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • B 離線
                                            bjanzen
                                            最後由 編輯

                                            Thanks for trying this with 10.5.2. For now, this patch is the best solution I've seen.

                                            Barry

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 1 / 4
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement