SweetHome3D

From PGWiki

SweetHome3D는 홈 모델링을 위한 CAD 무른모다.

문제 해결

실행 시 com.jogamp.opengl.GLException 예외 발생

실행을 하면 다음과 같은 오류와 함께 종료되는 경우가 있다.

com.jogamp.opengl.GLException: J3D-Renderer-1: Error making temp context(1) current: display 0x7fd2ec1c1e40, context 0x7fd2ec669bd8, drawable X11OnscreenGLXDrawable[Realized true,
	Factory   jogamp.opengl.x11.glx.X11GLXDrawableFactory@238417c3,
	Handle    0x4e00097,
	Surface   JAWTWindow[0x3cd27508][JVM version: 1.8.0_121 (1.8.0 update 121)
JAWT version: 0x10004, CA_LAYER: false, isLayeredSurface false, bounds [ 0 / 0  737 x 364 ], insets [ l 0, r 0 - t 0, b 0 - 0x0], pixelScale 1.0x1.0, shallUseOffscreenLayer false, isOffscreenLayerSurface false, attachedSurfaceLayer 0x0, windowHandle 0x4e00097, surfaceHandle 0x4e00097, bounds [ 0 / 0  737 x 364 ], insets [ l 0, r 0 - t 0, b 0 - 0x0], window [0/0 737x364], pixels[scale 1.0, 1.0 -> 737x364], visible true, lockedExt false,
	config AWTGraphicsConfiguration[AWTGraphicsScreen[AWTGraphicsDevice[type .awt, connection :0.0, unitID 0, awtDevice X11GraphicsDevice[screen=0], handle 0x0], idx 0],
	chosen    GLCaps[glx vid 0x28, fbc 0xaf: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono  , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
	requested GLCaps[rgba 5/5/5/1, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
	X11GraphicsConfig[dev=X11GraphicsDevice[screen=0],vis=0x28],
	encapsulated X11GLXGraphicsConfiguration[X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x7fd2ec1c1e40, owner true, JAWTToolkitLock[obj 0x3d3c62ea, isOwner true, <fd99e70, c60aa47>[count 1, qsz 0, owner <J3D-Renderer-1>]]], idx 0], visualID 0x28, fbConfigID 0xaf,
	requested GLCaps[rgba 5/5/5/1, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
	chosen    GLCaps[glx vid 0x28, fbc 0xaf: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono  , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]]],
	awtComponent com.eteks.sweethome3d.j3d.Component3DManager$ObservedCanvas3D[canvas2,0,0,737x364],
	surfaceLock <3bd124a5, 104d44d6>[count 1, qsz 0, owner <J3D-Renderer-1>]]]
	at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:393)
	at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:765)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:648)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
	at javax.media.j3d.JoglPipeline.createNewContext(JoglPipeline.java:6411)
	at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4602)
	at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2376)
	at javax.media.j3d.Renderer.doWork(Renderer.java:881)
	at javax.media.j3d.J3dThread.run(J3dThread.java:271)
Error in Java 3D : 3 Renderer: Error creating Canvas3D graphics contextX11Util.Display: Shutdown (JVM shutdown: true, open (no close attempt): 2/2, reusable (open, marked uncloseable): 0, pending (open in creation order): 2)
X11Util: Open X11 Display Connections: 2
X11Util: Open[0]: NamedX11Display[:0.0, 0x7fd2ec10ef80, refCount 1, unCloseable false]
X11Util: Open[1]: NamedX11Display[:0.0, 0x7fd2ec1c1e40, refCount 1, unCloseable false]

이 경우에는 /usr/bin/sweethome3d 실행 스크립트를 열어서 다음과 같은 줄을 추가해주면 된다.

#!/bin/sh

SWEETHOME3D_JAVA3D=“1.5"
APP_CLASSPATH=
JAVA_EXEC=

...

범블비(Bumblebee) 환경에서 속도 저하

리눅스 환경에서 Nvidia 옵티머스를 사용하기 위해서는 범블비를 사용한다.

이 경우 optirun으로 SweetHome3D를 호출해도 느린 증상이 있는데, 이는 /usr/bin/sweethome3d 스크립트 실행 파일에서 실제 SweetHome3D를 구동하는 자바를 exec로 호출하면서 발생하는 문제다.

이를 해결하기 위해서는 이 스크립트에서 optirun을 호출하도록 수정하면 된다.

...

exec optirun \
    "${JAVA_EXEC}" \
    -classpath "${APP_CLASSPATH}" \
    ${JAVA_OPTS} \
    -Dcom.eteks.sweethome3d.applicationId=SweetHome3D#Installer \
    com.eteks.sweethome3d.SweetHome3D \
    -open "$1"