macOS 10.15.7安装Security Update 2021-002 Catalina后Core Image渲染空白问题求助
I’ve run into this exact problem on macOS Catalina systems right after applying the Security Update 2021-002. The Core Image software renderer stops working correctly, spits out blank images, and throws OpenCL-related errors. Let’s break down the issue, share what we know, and explore more fixes beyond the temporary workaround:
The Problem Scenario
When initializing CIContext with the .useSoftwareRenderer: true option, the code below generates a blank JPG instead of rendering the source image:
let ciContext = CIContext(options: [.useSoftwareRenderer: true]) guard let srcPath = Bundle.main.path(forResource: "Flowers", ofType: "jpg"), let ciImage = CIImage(contentsOf: URL(fileURLWithPath: srcPath)) else { return } let dstUrl = URL(fileURLWithPath: NSString("~/Desktop/1.jpg").expandingTildeInPath) guard let destination = CGImageDestinationCreateWithURL(dstUrl as CFURL, kUTTypeJPEG, 1, nil) else { return } guard let cgImage = ciContext.createCGImage(ciImage, from: ciImage.extent) else { return } CGImageDestinationAddImage(destination, cgImage, nil) CGImageDestinationFinalize(destination)
Console Error Output
The following OpenCL errors appear in the logs:
** OpenCL Error Notification: [CL_DEVICE_NOT_AVAILABLE] : OpenCL Error : Error: build program driver returned (-1) **
** OpenCL Error Notification: OpenCL Warning : clBuildProgram failed: could not build program for 0xffffffff (Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz) (err:-1) **
Native OpenCL program build failed:
Temporary Workaround
As noted, setting .useSoftwareRenderer: false to disable software rendering fixes the issue. But this isn’t ideal if you depend on software rendering for specific use cases—like compatibility with older hardware or avoiding GPU-related glitches.
Further Troubleshooting & Fixes
Here are actionable steps to try restoring software renderer functionality:
- Reset OpenCL Cache: The update might have corrupted the OpenCL program cache. Go to
~/Library/Caches/com.apple.opencl, delete all files inside, then restart your system. This forces macOS to rebuild the OpenCL programs from scratch. - Check SIP Status: Security updates can sometimes alter System Integrity Protection configurations. Run
csrutil statusin Terminal to confirm SIP is enabled. If it’s disabled, turning it on may resolve low-level driver issues tied to OpenCL. - Reinstall the Security Update: In rare cases, the update might have been installed incorrectly. Download the standalone installer for Security Update 2021-002 Catalina and reapply it to ensure all components are properly set up.
- Update Intel CPU Firmware: Since the error references an Intel Core i5-8500B CPU, make sure you have the latest Intel-related system updates installed. Apple occasionally releases firmware patches for Intel-based Macs that fix driver compatibility problems.
- Test a Minimal Pipeline: Simplify your code to isolate the issue. Try rendering a basic CIImage (like a solid color) with the software renderer—if the problem persists, it’s a general software renderer failure, not specific to your source image.
If none of these steps work, this is likely a bug introduced by the security update that requires Apple to release a patch. You can submit detailed feedback to Apple via their internal bug reporting tool, including your system specs, code snippet, and error logs to help them diagnose the issue faster.
内容的提问来源于stack exchange,提问作者Viktoriia

