One of the things I like to do with old computers is try to maximize their performance. Linux is a great operating system for this because it allows users to minimizing resource consumption. With these considerations in mind, I decided to experiment with using the integrated graphics on my Thinkpad T540p (specifically the HD4600 iGPU from its 4th-generation Intel CPU) to run PyTorch. At first glance, this might seem like a ludicrous idea. Integrated graphics are typically not supported by machine learning packages, and the older HD4600 integrated graphics make things even less feasible. Moreover, it isn’t clear whether the weak integrated graphics offer any practical computational advantage over using the CPU. While GPUs can theoretically accelerate computations, the low performance of an iGPU might not translate into real-world benefits.

OpenCL compability layer

Despite these limitations, I thought it was worth investigating further to see if we could circumvent these problems through software tweaks. After researching online, I found a compatibility layer for PyTorch called pytorch_dlprim that allows OpenCL devices to be used with PyTorch. This package enables the integrated graphics card to function, albeit in a computationally less efficient way than an NVIDIA GPU which has native support.

Since both packages rely on Python, I used miniconda to create a separate environment running Python 3.11 for installing PyTorch and the pytorch_dlprim package. The installation process worked without major errors. Unfortunately, even though I followed all instructions carefully, the integrated graphics were not available when queried in Pytorch in this setup. This turned out to be due to an incompatibility with the specific version of Ubuntu (24.04) that I was using. Unfortunately, Intel’s Beignet package which acted as compatibility layer for OpenCL (and was compatible with HD4600) stopped being updated, and is longer supported on versions of Ubuntu greater than 22.04.

Older hardware limited to deprecated packages

To resolve this issue, one option would have been to downgrade my system to Ubuntu 22. Alternatively, I could set up a virtual machine running that older distribution and then install the required software there. However, given the relatively weak hardware I was using, these solutions felt counterproductive; they were essentially using outdated methods with limited gains. Ultimately, I decided to abandon this approach entirely because it didn’t align well with efficient resource utilization or practical outcomes.

Nonetheless, this experience highlights something important: older integrated graphics might still provide some value in terms of compatibility and performance for certain tasks like machine learning if they are properly configured from the start. This is especially true when working with newer Intel CPUs—where iGPUs have become significantly more powerful over time—and openCL-based libraries or tools that support such setups become increasingly available by 2025 standards.

Another alternative solution I considered was switching to Windows and using DirectML, which can act as a compatibility layer for OpenCL devices but is intended primarily for TensorFlow. However, because Linux tends to extend hardware lifespan more effectively than Windows, it’s likely these whatever setup is possible with windows would involve very old and deprecated software. Therefore, this approach might not make sense if one is willing to do the required research and configuration from scratch on Linux.

Conclusion

In summary, while I couldn’t get OpenCL compability-layer working on my old Thinkpad due to package incompatibilities across Linux distributions, it remains an approach worth exploring with hardware that uses more modern Intel CPUs.

As a side note, I wasn’t able to find any compatibility layers for TensorFlow specifically. But this is understandable because PyTorch generally offers better compatibility with older hardware compared to TensorFlow’s stricter requirements around specific devices or drivers. In many cases, TensorFlow demands specific Nvidia GPUs for specific versions of its software, making it more complicated and error-prone when working with legacy systems. Therefore, sticking to PyTorch made sense as a simpler alternative.

References

1) Intel HD4600 is deprecated for modern OpenCL support. It must use at most Ubuntu 22.04 to install a (possible) backend:

Moreover, each intel integrated graphics generation has a specific OpenCL version it is compatible with. This is tied to the processor. For HD4600 (linked to a 4th gen CPU) the Intel generation of the graphics is:

  • Gen 7.5 (minimum is 8 for current software. See #2)
  • The iGPU only supports OpenCL 1.2 (which deprecated for newer software).

See: Intel Graphics Generations

2) The current (2025) software for OpenCL on older Intel iGPU’s (5th gen CPU and above).

See: Intel Compute Runtime

Moreover, some additional software may be needed to detect an OpenCL device. See the following dependencies:

3) Unofficial Pytorch backend to support OpenCL devices:
Note: Must ensure OpenCL compability for this to work. See above.

Installation instructions for the above:

  1. Use conda to install Python 3.11
  2. Use pip to install Pytorch 2.4 (2024).
  3. Install the local .whl file for pytorch_dlprim