Hi!
This KPs happen in my system sometimes several times a day, or it can be stable for days as
@jaminmc
says. 99% of the times it is triggered by a click in finder or a spacebar press to quickview some image.

Good to know this kind of KP is CUDA related, until now I had no certain clue of what was causing this panics, RAM? CPU? SSDs? I was wondering if it might be my Wacom Cintq22HD in combination with my 2nd monitor (LG ULtrawide).
My system is a i7 8700K though, and way back in 2014 I was getting very similar KPs on my i7 Apple Mac Mini with an external GTX970 egpu .
I have tried both iMac 18,3 and iMaPro1'1 (right now; with no igpu enabled) but it has been of no help, I am still getting this reboots.
I need Cuda for Octane, so I need nVidia and High Sierra. So I am locked until that Octane X you mention is released.
I think the script will not be usefull to me, as I keep C4D open with Octane running while paint in ClipStudioPaint and go through references, having to disable CUDA would make my workflow impractical. But million thanks
@jaminmc for the info and the script.
My tipical panics:
*** Panic Report ***
panic(cpu 2 caller 0xffffff8013c87754): "thread_invoke: preemption_level 1, possible cause: blocking while holding a spinlock, or within interrupt context"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-4570.71.46/osfmk/kern/sched_prim.c:2231
or
*** Panic Report ***
mp_kdp_enter(): 3071, 1, 12 TIMED-OUT WAITING FOR NMI-ACK, PROCEEDING
panic(cpu 10 caller 0xffffff8015ab1fc9): "waitq deadlock - waitq=0xffffff80ee30b450, cpu=10\n"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-4570.71.46/osfmk/kern/waitq.c:1825
Mac mini was:
Mon Aug 17 16:08:03 2015
*** Panic Report ***
panic(cpu 2 caller 0xffffff8004816df2): Kernel trap at 0xffffff7f856ae02e, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0x000000060000003e, CR3: 0x0000000007d2a000, CR4: 0x00000000001626e0
RAX: 0x0000000000000006, RBX: 0x000000060000003e, RCX: 0x0000000000000007, RDX: 0x0000000000000034
RSP: 0xffffff81edf1bc90, RBP: 0xffffff81edf1bd20, RSI: 0x0000000000000071, RDI: 0xffffff81a2566008
R8: 0x0000000000000001, R9: 0x0000000000000020, R10: 0x00000001c95b808d, R11: 0xffffff7f855d1af2
R12: 0x0000000600000006, R13: 0xffffff802487c5c0, R14: 0xffffff81a2570008, R15: 0x0000000600000006
RFL: 0x0000000000010206, RIP: 0xffffff7f856ae02e, CS: 0x0000000000000008, SS: 0x0000000000000000
Fault CR2: 0x000000060000003e, Error code: 0x0000000000000000, Fault CPU: 0x2
and they share the:
Kernel Extensions in backtrace:
com.nvidia.web.NVDAResmanWeb(10.3.3)[9440CED0-E613-32B7-AAEB-13932263DD0F]@0xffffff7f88b81000->0xffffff7f891f9fff
dependency: com.apple.iokit.IOPCIFamily(2.9)[9C640A56-0FCC-39B4-B469-31F6ED15228E]@0xffffff7f88a94000
dependency: com.apple.iokit.IONDRVSupport(519.21)[8E0EE518-0D53-38C0-B308-2C6CD9EC5B7B]@0xffffff7f88b65000
dependency: com.apple.iokit.IOGraphicsFamily(519.21)[E5B53C5D-BF6E-3D72-9091-A80DFE5426C9]@0xffffff7f88b0f000
dependency: com.apple.AppleGraphicsDeviceControl(3.20.16)[163A3487-6927-3191-9A5A-F395956DDF72]@0xffffff7f88b75000
com.nvidia.web.NVDAGP100HalWeb(10.3.3)[76B91C29-8578-33E2-9C91-A6CB7C5E2C56]@0xffffff7f89377000->0xffffff7f8951dfff
dependency: com.nvidia.web.NVDAResmanWeb(10.3.3)[9440CED0-E613-32B7-AAEB-13932263DD0F]@0xffffff7f88b81000
dependency: com.apple.iokit.IOPCIFamily(2.9)[9C640A56-0FCC-39B4-B469-31F6ED15228E]@0xffffff7f88a94000