GPU Acceleration
By default, SpamFoo uses the mail server's CPU to handle its processing, and in the majority of cases, the server's CPU is all that's necessary. However, GPU acceleration is available as an option.
If your server has an NVIDIA GPU, you can enable GPU acceleration in order to speed up processing. When enabled, SpamFoo downloads and installs everything it needs on its own, so the only thing you install yourself is the NVIDIA driver. (If it's not installed already.) Any additional libraries will be automatically downloaded directly from NVIDIA, verified, and stored in the SpamFoo runtime directory.
Requirements
- An NVIDIA RTX 20xx series or newer GPU, or an equivalent NVIDIA datacenter GPU (Tesla T4 or newer). Other GPU brands are not currently supported.
- The latest NVIDIA driver installed on the server.
- A 64-bit version of Windows or Linux. GPU acceleration is not available on macOS.
- Outbound HTTPS (port 443) access to
developer.download.nvidia.comso SpamFoo can download the NVIDIA CUDA libraries. See Servers Without Internet Access if this is not possible.
Enabling GPU Acceleration
- Install the NVIDIA driver for your GPU from nvidia.com/drivers, then reboot if the installer asks for it.
- Open the SpamFoo Admin Dashboard at
http://localhost:16253/adminand go to Settings, then General. - In the Performance section, turn on GPU Acceleration and confirm.
SpamFoo handles the rest on its own:
- SpamFoo switches to the matching GPU release channel and downloads the GPU-enabled build. The service restarts briefly to finish installing, then picks up where it left off.
- After the restart, SpamFoo downloads the NVIDIA CUDA libraries. A progress bar appears under the GPU Acceleration toggle in Settings while this happens. Classification keeps running on the CPU during the download, so mail flow is not interrupted.
- Once the download finishes, the embedding model starts using the GPU automatically. No further restart is needed.
The download messages also appear in the system log. See Log Management for where to find log files.
If the toggle cannot be turned on
- "No compatible NVIDIA GPU was detected on this server." SpamFoo did not find an NVIDIA GPU. Check that the card is installed and the NVIDIA driver is working.
- "GPU acceleration is controlled by the SPAMFOO_GPU environment variable." The
SPAMFOO_GPUenvironment variable is set, which locks the toggle. Remove the variable and restart the service to control GPU acceleration from the dashboard.
Disabling GPU Acceleration
To disable GPU Acceleration, go to Settings, then General. In the Performance section, turn off GPU Acceleration. SpamFoo switches back to CPU processing right away. If enabling the toggle moved your install onto a GPU release channel, SpamFoo also returns to the release channel it was on before and installs the standard build at the next update check.
Environment Variables
Most servers only need the dashboard toggle. These variables are for hosts where you want the GPU behavior fixed ahead of time, such as automated deployments.
| Variable | Default | Description |
|---|---|---|
SPAMFOO_GPU |
Unset | Forces GPU mode. Use on to force GPU or off to force CPU. When set, the dashboard toggle is locked. Leave unset to control GPU acceleration from the dashboard. |
SPAMFOO_GPU_DEVICE |
0 |
Which GPU to use if the server has more than one (CUDA device number). |
SPAMFOO_GPU_AUTODOWNLOAD |
On | Set to off to stop SpamFoo from downloading CUDA libraries automatically. GPU acceleration still works if the CUDA libraries are already installed on the server. |
Servers Without Internet Access
On servers that cannot reach NVIDIA's download site, set SPAMFOO_GPU_AUTODOWNLOAD=off and install the NVIDIA CUDA 13 runtime and cuDNN 9 libraries yourself. When these are installed system-wide, SpamFoo finds and uses them without downloading anything.
Note that switching to the GPU-enabled build also requires outbound access to SpamFoo's cloud services for the update download. On fully offline servers, install the GPU-enabled build directly instead.
Next Steps
- Review other configuration options
- Watch classification activity in the admin dashboard
- Check Log Management for where GPU download and startup messages are logged