How to fix corrupted opencl.dll in Windows 10, if SFC and DISM are failing?

Solution 1:

To fix this problem, you need to have the ISO of the exact build you have installed.

  1. Mount the ISO image.
  2. Create a temporary directory to mount the Windows Image File (WIM).
    mkdir C:\WIM
  3. Mount the WIM file.
    Dism /Mount-Wim /WimFile:D:\sources\install.wim /index:1 /MountDir:C:\WIM /ReadOnly
  4. Run Dism with the following parameters.
    Dism /Online /Cleanup-Image /RestoreHealth /Source:C:\WIM\Windows /LimitAccess
  5. When done, unmount the image and delete the folder
    Dism /Unmount-Wim /MountDir:C:\WIM /Discard rmdir C:\WIM
  6. It's mandatory to restart your computer, or SFC and DISM will still show errors.

That should fix the issue.

Edit
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.

Solution 2:

From various forums on the Internet, I've assembled following repair procedure:

  1. Download MediaCreationTool from http://go.microsoft.com/fwlink/?LinkId=691209
  2. Download Windows 10 Pro ISO with MediaCreationTool.exe to c:\temp\windows.iso
  3. Use 7-zip for extract file c:\temp\windows.iso to folder c:\temp\windows
  4. Convert install.esd to install.wim

    Dism /Export-Image /SourceImageFile:c:\temp\windows\sources\install.esd /SourceIndex:1 /DestinationImageFile:c:\temp\windows\sources\install.wim /compress:max

  5. Check index and windows version in .wim file
    -index is used for next Dism command in parameter /Source:wim:path_to_wim:[index]

    Dism /Get-WimInfo /wimFile:c:\temp\windows\sources\install.wim

  6. 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

  7. Repair corrupted files:

    sfc /scannow

    It will repair corrupted files - success message: Windows Resource Protection found corrupt files and successfully repaired them.

  8. Restart Windows
  9. Check System files again to be sure for succesfull repair:

    sfc /scannow

    Success message after scan: Windows Resource Protection did not find any integrity violations.


Solution 3:

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).


Solution 4:

I solved the problem with opengl.dll as follows:

  1. Mount the Windows 10 image.

  2. 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\

  3. sfc /scannow

Good luck!


Solution 5:

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:

  1. This started for me with a Windows Update failure (error 0x800705b4).
  2. 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)
  3. 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)
  4. 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).