KRay, Multiple Processors, and Adaptive AA

General disscusion about Kray
Locked
jrandom
Posts: 22
Joined: Thu Jul 22, 2010 11:37 pm
Contact:

KRay, Multiple Processors, and Adaptive AA

Post by jrandom »

I just got this shiny new 12-core Mac and finally got Lightwave and KRay installed. Woo! Very, very fast.

One thing that caught me off guard, though, is that the adaptive AA pass only uses a tiny fraction of the available cores, averaging around 4. The final gather and raytracing passes use every ounce of computing power in this thing, which is awesome, but the adaptive AA pass is just killing my render times.

Is this a bug, or just some technical limitation in how adaptive AA is implemented?
jrandom
Posts: 22
Joined: Thu Jul 22, 2010 11:37 pm
Contact:

Re: KRay, Multiple Processors, and Adaptive AA

Post by jrandom »

I've attached a screencap of processor usage and you can see where the adaptive AA suddenly only uses a fraction of the available processors.
Attachments
KRay_FGMedium.png
jure
Posts: 2142
Joined: Thu Jun 02, 2005 6:53 pm

Re: KRay, Multiple Processors, and Adaptive AA

Post by jure »

jrandom wrote:I've attached a screencap of processor usage and you can see where the adaptive AA suddenly only uses a fraction of the available processors.
What are your system OS spec and which software version are you running?
- Jure
jrandom
Posts: 22
Joined: Thu Jul 22, 2010 11:37 pm
Contact:

Re: KRay, Multiple Processors, and Adaptive AA

Post by jrandom »

This is on Mac OS X (10.6.4), Lightwave 9.6, KRay 2.1.

The CPU history shown above is not actually complete -- the AA pass went on for quite some time and the CPU usage never went back up past that tail end you see in the screenshot.

I've also noticed that Uncached maxes out all my processors while FInal Gather (as shown above) uses most but not all available CPU power (although this may be impacted by memory bus speeds as part of the Final Gather algorithm, but I"m not certain).
jure
Posts: 2142
Joined: Thu Jun 02, 2005 6:53 pm

Re: KRay, Multiple Processors, and Adaptive AA

Post by jure »

Do you have a chance to test this scene on a PC too s o that we could see if it's mac related problem?
- Jure
jrandom
Posts: 22
Joined: Thu Jul 22, 2010 11:37 pm
Contact:

Re: KRay, Multiple Processors, and Adaptive AA

Post by jrandom »

Sadly, no. I will eventually be installing Windows 7 on this new Mac Pro (ohmygodthisthingissofastimsogladisavedupforayearsoicouldbuyit) via bootcamp, but I've only had this thing a few days and the stores in my local area only sell the "upgrade" version of WIndows 7... uh... short answer: no, no Windows yet.
jure
Posts: 2142
Joined: Thu Jun 02, 2005 6:53 pm

Re: KRay, Multiple Processors, and Adaptive AA

Post by jure »

jrandom wrote:Sadly, no. I will eventually be installing Windows 7 on this new Mac Pro (ohmygodthisthingissofastimsogladisavedupforayearsoicouldbuyit) via bootcamp, but I've only had this thing a few days and the stores in my local area only sell the "upgrade" version of WIndows 7... uh... short answer: no, no Windows yet.
Perhaps you can share the scene then so I can check it on my PC?
- Jure
jrandom
Posts: 22
Joined: Thu Jul 22, 2010 11:37 pm
Contact:

Re: KRay, Multiple Processors, and Adaptive AA

Post by jrandom »

Layout crashed, and now whenever I try to render with KRay, it crashes consistently after about 87-89% of it's Global PM building. SInce it was working before the crash, I assuming something got whacked into a bad state. How can I fix this? (Crash info below.)

On a better note, the AA thing isn't consistent and it normally uses most of my processing power. It may have been the particular settings I was using (which I don't remember since I try out a lot of different settings).

Scene:
http://rainybrain.org/Assets/Lightwave/ ... y_Test.zip

Crash info:

Process: Layout [216]
Path: /Applications/LightWave3D 9.6/Layout.app/Contents/MacOS/Layout
Identifier: com.newtek.LightWave.Layout
Version: 9.6 (9.6)
Code Type: X86 (Native)
Parent Process: launchd [168]

Date/Time: 2010-09-05 13:42:15.661 -0700
OS Version: Mac OS X 10.6.4 (10F2521)
Report Version: 6

Interval Since Last Report: 49267 sec
Crashes Since Last Report: 9
Per-App Interval Since Last Report: 2615 sec
Per-App Crashes Since Last Report: 6
Anonymous UUID: F48011CC-759C-46B2-BFA3-973C54B18DE9

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000000c
Crashed Thread: 42

Thread 0: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x98dc4142 semaphore_wait_signal_trap + 10
1 libSystem.B.dylib 0x98dc9c06 pthread_mutex_lock + 490
2 com.kraytracing.Kray 0x29b87269 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 425
3 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
4 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
5 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
6 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
7 com.kraytracing.Kray 0x29b8753f photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1151
8 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
9 com.kraytracing.Kray 0x29b8753f photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1151
10 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
11 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
12 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
13 com.kraytracing.Kray 0x29b8753f photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1151
14 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
15 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
16 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
17 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
18 com.kraytracing.Kray 0x29b87570 photonmap::kd_builder::createkd(photon**, unsigned long, kdel**, int) + 1200
19 com.kraytracing.Kray 0x29b77eff photonmap::kd_builder::run() + 47
20 com.kraytracing.Kray 0x29b7e308 photonmap::global_pms_kdize(unsigned long) + 616
21 com.kraytracing.Kray 0x29b86ca4 photonmap::buildlightmap(scene*, float) + 1588
22 com.kraytracing.Kray 0x29b88ef1 photon_init(scene&) + 1377
23 com.kraytracing.Kray 0x29bac5a4 scene::frame_init(float, int) + 1236
24 com.kraytracing.Kray 0x29bac8c1 scene::init_render() + 497
25 com.kraytracing.Kray 0x29bb0db2 scene::render() + 50
26 com.kraytracing.Kray 0x29a179ef anim_renderpipe() + 3343
27 com.kraytracing.Kray 0x29a71047 k_render() + 87
28 com.kraytracing.Kray 0x29a7198b k_main(int, char const**) + 955
29 com.kraytracing.Kray 0x29a9d0fa run_kray() + 378
30 com.kraytracing.Kray 0x29a9d635 processCommand(char const*) + 53
31 com.kraytracing.Kray 0x29aa44b6 LwExtKrayRender(void*, int, int, int, int (*)(int, int, void*), int) + 150
32 com.newtek.LightWave.Layout 0x0002a8d4 urender(void*, unsigned short) + 2690
33 libtools.dylib 0x013f8569 ActionDefDispatch + 229
34 libtools.dylib 0x0141308d CmdEntryFireTag + 151
35 com.newtek.LightWave.Layout 0x00021eb0 CmdEvaluate(LayoutCommandData*, char const*) + 532
36 com.newtek.LightWave.Layout 0x00040b42 master_command_evaluate + 34
37 com.kraytracing.Kray 0x29aa3152 KrayRender(long, void* (*)(char const*, int), st_LWLayoutGeneric*, void*, int) + 850
38 com.kraytracing.Kray 0x29aa331e KrayFrame(long, void* (*)(char const*, int), void*, void*) + 46
39 libtools.dylib 0x014972f4 ServerActivate(st_HostServer*, int, void*) + 110
40 com.newtek.LightWave.Layout 0x0002f522 uplugs(void*, unsigned short) + 230
41 libtools.dylib 0x013f8569 ActionDefDispatch + 229
42 libtools.dylib 0x0141308d CmdEntryFireTag + 151
43 com.newtek.LightWave.Layout 0x00021eb0 CmdEvaluate(LayoutCommandData*, char const*) + 532
44 com.newtek.LightWave.Layout 0x000cb4ac utools(void*, unsigned short) + 6302
45 libtools.dylib 0x013f8569 ActionDefDispatch + 229
46 libtools.dylib 0x0141308d CmdEntryFireTag + 151
47 com.newtek.LightWave.Layout 0x00021eb0 CmdEvaluate(LayoutCommandData*, char const*) + 532
48 com.newtek.LightWave.Layout 0x0011f4c1 executecmd(char const*) + 25
49 liblcore.dylib 0x00f7962f localDispatch(_script*, char const*, int*) + 333
50 liblcore.dylib 0x00f80552 CS_CommandInput + 462
51 liblcore.dylib 0x00fe7a9e processBuiltinFunction + 1614
52 liblcore.dylib 0x00feec61 processFunctionCall + 109
53 liblcore.dylib 0x00fc7572 BMLeval + 12910
54 liblcore.dylib 0x01077fff process_control_callbacks(_script*, st_LSComponent*) + 3091
55 liblcore.dylib 0x010806dc AppEvent(void*, st_IComponent*, int, void const*) + 3500
56 libtools.dylib 0x0141d363 CompClientEvent(st_IComponent*, int, void const*) + 201
57 libtools.dylib 0x0141c059 Zonis_Down(st_ZonisContext*, st_MouserInfo*, st_ZoneInfo*) + 93
58 libtools.dylib 0x014ceb3c OPALwin_kEventClassMouse_kEventMouseDown_handler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 750
59 com.apple.HIToolbox 0x978cbf2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
60 com.apple.HIToolbox 0x978cb1f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
61 com.apple.HIToolbox 0x978ed9bb SendEventToEventTarget + 52
62 com.apple.HIToolbox 0x978ff4db ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1257
63 com.apple.HIToolbox 0x978cc380 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2672
64 com.apple.HIToolbox 0x978cb1f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
65 com.apple.HIToolbox 0x978ed9bb SendEventToEventTarget + 52
66 libtools.dylib 0x014c7831 WManGetInput + 553
67 com.newtek.LightWave.Layout 0x000c9316 domessages(st_lwrender*, int) + 702
68 com.newtek.LightWave.Layout 0x000e79e3 main + 839
69 com.newtek.LightWave.Layout 0x0000acba _start + 216
70 com.newtek.LightWave.Layout 0x0000abe1 start + 41
jure
Posts: 2142
Joined: Thu Jun 02, 2005 6:53 pm

Re: KRay, Multiple Processors, and Adaptive AA

Post by jure »

The scene works fine on my PC. No crashes and also good CPU usage. I'm testing on internal beta build so perhaps this bug was already fixed. Check this problem again with next kray update and see if it's fixed.
- Jure
Locked