Configuring Google Coral TPU on Proxmox VE: A Step-by-Step Technical Guide
Introduction
Machine learning and edge computing are rapidly evolving, and the Google Coral TPU represents a powerful solution for accelerating AI workloads. This guide will walk you through the precise steps of installing the Gasket driver for Google Coral TPU on Proxmox Virtual Environment (VE), enabling seamless hardware acceleration for your virtualized infrastructure.
Prerequisites
Before beginning the installation, ensure you have:
- A Proxmox VE server with root or sudo access
- An active internet connection
- Basic understanding of Linux command-line operations
Installation Procedure
1. Prepare the System
First, remove any existing gasket-dkms package to prevent potential conflicts:
apt remove gasket-dkms
2. Install Essential Development Packages
Install the necessary development tools for compiling and managing the driver:
apt install git
apt install devscripts
apt install dh-dkms
These packages will provide the tools required to clone, build, and install the Gasket driver.
3. Clone the Gasket Driver Repository
Retrieve the official Google Coral TPU driver from GitHub:
git clone https://github.com/google/gasket-driver.git
cd gasket-driver/
3.1 Optional: patch for PVE 9.X
need to make some changes google is unwilling to apply.
Either build from this branch: https://github.com/sethyx/gasket-driver
Or apply this patch:
diff --git a/src/gasket_core.c b/src/gasket_core.c
index b1c2726..4e5ad8c 100644
--- a/src/gasket_core.c
+++ b/src/gasket_core.c
@@ -1373,7 +1373,7 @@ static long gasket_ioctl(struct file *filp, uint cmd, ulong arg)
/* File operations for all Gasket devices. */
static const struct file_operations gasket_file_ops = {
.owner = THIS_MODULE,
- .llseek = no_llseek,
+ .llseek = noop_llseek,
.mmap = gasket_mmap,
.open = gasket_open,
.release = gasket_release,
diff --git a/src/gasket_page_table.c b/src/gasket_page_table.c
index c9067cb..1c4705e 100644
--- a/src/gasket_page_table.c
+++ b/src/gasket_page_table.c
@@ -54,8 +54,12 @@
#include <linux/vmalloc.h>
#if __has_include(<linux/dma-buf.h>)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0)
MODULE_IMPORT_NS(DMA_BUF);
-#endif
+#else
+MODULE_IMPORT_NS("DMA_BUF");
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0) */
+#endif /* __has_include(<linux/dma-buf.h>) */
#include "gasket_constants.h"
#include "gasket_core.h"
4. Build the Debian Package
Use debuild to compile and create a Debian package for the Gasket driver:
debuild -us -uc -tc -b
The flags in this command ensure:
-us: Skip source package signing-uc: Skip changes file signing-tc: Clean the source tree before building-b: Build binary packages only
5. Install the Gasket DKMS Package
Install the newly created Debian package:
cd ..
dpkg -i gasket-dkms_1.0-18_all.deb
6. Update System Packages
Ensure your system is up to date:
apt update && apt upgrade
Verification and Troubleshooting
After installation, verify the Coral TPU driver:
- Check kernel modules:
lsmod | grep gasket - Inspect system logs:
dmesg | grep coral
Performance Considerations
The Gasket driver enables direct hardware access for the Google Coral TPU, minimizing virtualization overhead and maximizing AI inference performance.
Conclusion
By following these steps, you've successfully configured the Google Coral TPU driver on Proxmox VE, unlocking powerful AI acceleration capabilities for your virtualized environment.
Additional Resources
Note: Always ensure compatibility with your specific hardware and software versions.
apt remove gasket-dkms
apt install git
apt install devscripts
apt install dh-dkms
git clone https://github.com/google/gasket-driver.git
cd gasket-driver/
debuild -us -uc -tc -b
cd ..
dpkg -i gasket-dkms_1.0-18_all.deb
apt update && apt upgrade