intel/intel-data-center-gpu-driver-for-openshift

Improve Driver Container Image Size

hershpa opened this issue · 1 comments

Summary:

The dockerfile copies unnecessary files and directories to the final UBI minimal based driver container image. The goal is to copy only the necessary ko files and firmware binaries to keep the driver container image size as small as possible.

Solution:

Initial analysis of current driver container image shows we can safely copy all *.ko and *.ko.xz files under /lib/modules/4.18.0-372.46.1.el8_6.x86_64/. The following ko files would be copied. Note: *.ko.xz files are not shown below since there are several. The xz extension indicates it is a compressed ko file so it takes less space than a traditional ko file.

image

For firmware binaries, the proposed solution is to copy only dg2* firmware binaries since those are the only binaries that are needed for Intel Data Center GPU Flex Series. We will continue to copy the copyright license in /firmware/i915/license/ and the firmware binaries in /firmware/i915/.

Task Checklist:

  • 1. Make above changes in dockerfile
  • 2. Re-build and deploy driver container using updated dockerfile and KMM
  • 3. Test updated driver container to ensure no regression issues.
  • 4. Review and compare updated compressed driver container image size. Current compressed size is 256 MiB.
  • 5. Submit PR to update dockerfile after reviewing results.

New driver container compressed image size is down from 256 MiB to 180.1 MiB. Reduced by 75.9 MiB. build log