How to fix corrupted opencl.dll in Windows 10, if SFC and DISM are failing?
To fix this problem, you need to have the ISO of the exact build you have installed.
- Mount the ISO image.
- Create a temporary directory to mount the Windows Image File (WIM).
- Mount the WIM file.
Dism /Mount-Wim /WimFile:D:\sources\install.wim /index:1 /MountDir:C:\WIM /ReadOnly
- Run Dism with the following parameters.
Dism /Online /Cleanup-Image /RestoreHealth /Source:C:\WIM\Windows /LimitAccess
- When done, unmount the image and delete the folder
Dism /Unmount-Wim /MountDir:C:\WIM /Discard rmdir C:\WIM
- It's mandatory to restart your computer, or SFC and DISM will still show errors.
That should fix the issue.
As pointed out in the comments, there might be a more direct approach. The TL;DR is, that it did not work for me, hence my more detailed approach. But I am interested if you had any problems with the direct approach. Please comment.
From various forums on the Internet, I've assembled following repair procedure:
- Download MediaCreationTool from http://go.microsoft.com/fwlink/?LinkId=691209
- Download Windows 10 Pro ISO with
- Use 7-zip for extract file
Dism /Export-Image /SourceImageFile:c:\temp\windows\sources\install.esd /SourceIndex:1 /DestinationImageFile:c:\temp\windows\sources\install.wim /compress:max
Check index and windows version in
-index is used for next Dism command in parameter
Dism /Get-WimInfo /wimFile:c:\temp\windows\sources\install.wim
Restore health windows components from downloaded and converted windows image (wim):
Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:c:\temp\windows\sources\install.wim:1 /LimitAccess
Repair corrupted files:
It will repair corrupted files - success message:
Windows Resource Protection found corrupt files and successfully repaired them.
- Restart Windows
Check System files again to be sure for succesfull repair:
Success message after scan:
Windows Resource Protection did not find any integrity violations.
An ESD is not an "encrypted" WIM, it is a WIM that has been highly packed/reencoded very differently (with a more complex structure).
A WIM is just "fast" compressed by unbreakable units of 4KB or 16KB, using a fast Huffmann compression. An ESD uses more advanced LZ-based compression without block size limitations. This compresssion does not allow the image to be open in read-write-mode as the compression is global (each file in the archive is no longer compressed separately, multiple logical files can share the actual storage of segments, to reach a mush higher compression level, notably when there are many small files with common headers parts, such as collections of icons, or parts of their digital signature data, copyright notices, HTML headers, embedded scripts and so on).
An SWM is a multipart WIM that has been split in multiple files with smaller sizes with a (rough) maximum size, but it is still writable, and can be stored on multiple DVDs.
CBS providers allow several archiving formats that can be supported by DISM, including WIM, CAB, ZIP, VHD, VHDX, multisession ISOs... But Windows comes with two builtin providers for the WIM and ESD formats (ESD is new to Windows 10, with Windows 8, only the WIM format was supported, but the images were larger)
The ESD format has been tuned for allowing the full multilingual distribution of Windows 10 to fit on a single DVD with less than 3GB...
You can transform an ESD to WIM, but the result will be a much larger file. The inverse conversion is also possible (so that you can read-write in the expanded WIM) to pack it again into a new ESD. Decompressing an ESD to WIM is relatively fast, but compressing a WIM to ESD requires lot of CPU ressources and is much longer (that's why you can't read-write directly into an ESD but you can do that quite easily in a WIM with modest CPU usage).
When you "mount" an ESD with DISM, the first thing it will do is to expand the ESD into a temporary storage and act on it as if it was a WIM, so that you can update files in this local storage. Unmounting it will require two steps: recreating a WIM (quite fast), and then pack it again into an ESD (very slow).
I solved the problem with opengl.dll as follows:
Mount the Windows 10 image.
Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:F:\sources\install.esd\1\Windows\WinSxS\wow64_microsoft-windows-r..xwddmdriver-wow64-c_31bf3856ad364e35_10.0.10586.0_none_3dae054b56911c22\
I spent a few days going down these paths and finally found a solution for my situation. I'm running Windows 10 version 1511 Build 10586.545. Here is my progression:
- This started for me with a Windows Update failure (error 0x800705b4).
- I then chased this error doing Windows Update troubleshooters, WUResets, disabling antivirus, etc.. This Link is a good article giving options for that issue (although they didn't help me)
- I then went down the DISM and SFC path. This ServerFault post was very helpful in that attempt. Unfortunately none of these options helped. I kept getting told I have a corrupt opencl.dll file, and running all sorts of variations of DISM /RestoreHealth didn't work. I kept getting 0x800f081f (Source files could not be found)
- I next tried to manually copy opencl.dll from a clean ISO into C:\Windows\SysWOW64. This never worked, even after messing with taking ownership, etc. I finally disabled the NVIDIA GeForce GPU driver in Device Manager (Leaving an Intel driver still enabling display), and was able to copy the clean opencl.dll into C:\Windows\SysWOW64.
From here, Windows Update started working again.
So in summary, if you're struggling with these errors and nothing seems to work, try disabling the NVIDIA GeForce drivers and then trying some of these steps (or manually copying in a clean version of the DLL).