40. CUDA Support - m-marini/wheellyj GitHub Wiki

Wheelly — CUDA 11.6 Support

Wheelly supports GPU acceleration through NVIDIA CUDA 11.6 and Deeplearning4j (DL4J).

This page describes the requirements and configuration needed to run Wheelly with NVIDIA GPU acceleration.

Overview

Wheelly is a Java-based application and uses Deeplearning4j for deep learning workloads.

The CUDA execution stack is:

flowchart TD
    A[Wheelly] --> B[Deeplearning4j]
    B --> C[CUDA 11.6]
    C --> D[NVIDIA GPU]
Loading

Requirements

The following components are required for CUDA-enabled execution:

Component Requirement
Wheelly CUDA-enabled version
Java / JDK Version supported by Wheelly
Deeplearning4j CUDA-compatible version
NVIDIA Driver Compatible with CUDA 11.6
CUDA Toolkit 11.6
GPU NVIDIA CUDA-compatible GPU
Python Not required

Important: CUDA compatibility depends on the complete combination of NVIDIA drivers, CUDA libraries, and the Deeplearning4j version used by Wheelly.

1. Install NVIDIA CUDA 11.6 on Windows 11

Wheelly requires CUDA 11.6 for NVIDIA GPU acceleration.

CUDA 11.6 officially supports Microsoft Windows 11 on x86_64 systems. Visual Studio 2022 is supported as a CUDA compiler environment. NNVIDIA Docs

1.1. Check the NVIDIA GPU

Before installing CUDA, verify that the system has a CUDA-capable NVIDIA GPU.

Open Device Manager:

  1. Press Win + X.
  2. Select Device Manager.
  3. Expand Display adapters.
  4. Verify that an NVIDIA GPU is listed.

1.2. Install the NVIDIA Driver

Make sure that an appropriate NVIDIA driver is installed before configuring Wheelly.

Open PowerShell or Command Prompt and run:

nvidia-smi

If the driver is correctly installed, the command displays information about the NVIDIA GPU and driver.

Important: The NVIDIA driver and CUDA Toolkit are separate components. The driver must be compatible with the CUDA version required by Wheelly.

1.3. Download CUDA 11.6

CUDA 11.6 is an archived NVIDIA release.

Download the CUDA 11.6 Toolkit from the official NVIDIA CUDA archive:

https://developer.nvidia.com/cuda-11-6-0-download-archive

Select:

Operating System: Windows
Architecture: x86_64
Version: Windows 11
Installer Type: exe

1.4. Install CUDA Toolkit 11.6

Run the downloaded CUDA installer as Administrator.

During installation:

  1. Accept the NVIDIA license agreement.
  2. Select Custom (Advanced) if you want to control the installed components.
  3. Install the CUDA Toolkit.
  4. Keep the default CUDA installation directory unless there is a specific reason to change it.

The default installation directory is:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6

The CUDA 11.6 Windows installer can also install the NVIDIA display driver if a suitable driver is not already installed. NNVIDIA Docs+1

1.5. Verify the CUDA Installation

Open a new Command Prompt or PowerShell window after the installation.

Run:

nvcc --version

The output should contain:

Cuda compilation tools, release 11.6

You can also verify the CUDA installation directory:

Test-Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6"

The command should return:

True

1.6. Verify the NVIDIA Driver

Run:

nvidia-smi

The GPU should be listed without errors.

For example:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI                         Driver Version                           |
+-----------------------------------------------------------------------------+
| GPU Name                                                                    |
+-----------------------------------------------------------------------------+

Note: The CUDA version displayed by nvidia-smi represents the CUDA version supported by the installed driver. It is not necessarily the CUDA Toolkit version installed on the system. Use nvcc --version to verify the Toolkit version.

1.7. CUDA Environment Variables

The CUDA installer normally configures the required environment variables.

Verify the CUDA path:

$env:CUDA_PATH

For CUDA 11.6, it should point to:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6

You can also check the CUDA compiler:

where.exe nvcc

The result should point to the CUDA 11.6 installation, for example:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe

If nvcc is not found, check that the following directory is included in the system PATH:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin

1.9. Installation Verification

At this point, the following commands should work:

nvidia-smi
nvcc --version

Expected configuration:

flowchart TD
    A[Windows 11] --> B[NVIDIA GPU]
    B --> C[NVIDIA Driver]
    C --> D[CUDA 11.6]
    D --> E[Deeplearning4j CUDA Backend]
    E --> F[Wheelly]
    F --> G[Java / JDK]
Loading

The basic installation is complete when:

  • nvidia-smi detects the NVIDIA GPU;
  • nvcc --version reports CUDA 11.6;
  • CUDA_PATH points to the CUDA 11.6 installation;
  • Wheelly can load the Deeplearning4j CUDA backend.

CUDA 11.6 and a newer CUDA version are both installed

Avoid relying on whichever CUDA version happens to appear first in PATH.

For Wheelly, explicitly verify:

nvcc --version

and ensure that it reports:

release 11.6

You can inspect the installed CUDA directories with:

Get-ChildItem "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA"

NVIDIA allows multiple CUDA Toolkit versions to coexist on Windows. The active version depends on the configured environment and application dependencies.

Official NVIDIA Documentation

2. Deeplearning4j CUDA Backend

Wheelly relies on Deeplearning4j to execute deep learning operations.

For GPU execution, the CUDA-enabled Deeplearning4j backend must be available by adding the CUDA dependencies in maven pom.xml and remove the CPU backand

        <!--
        ND4J backend: every project needs one of these. The backend defines the hardware on which network training
        will occur. "nd4j-native-platform" is for CPUs only (for running on all operating systems).
        -->
        <!--
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-native</artifactId>
            <version>${dl4j-master.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-native</artifactId>
            <version>${dl4j-master.version}</version>
            <classifier>windows-x86_64-avx2</classifier>
            <classifier>linux-x86_64-avx512</classifier>
        </dependency>
        -->

        <!-- CUDA ND4J backend (required) -->
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-cuda-11.6-platform</artifactId>
            <version>${dl4j-master.version}</version>
        </dependency>
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-cuda-11.6</artifactId>
            <version>${dl4j-master.version}</version>
            <classifier>windows-x86_64</classifier>
        </dependency>

Note: Do not copy this dependency blindly. The artifact name and dependency structure may vary between Deeplearning4j versions. Use the dependency configuration defined by the Wheelly release.

3. Supported Configuration

The reference configuration for Wheelly GPU execution is:

flowchart TD
    A[Wheelly] --> B[Java / JDK]
    A --> C[Deeplearning4j]
    C --> D[CUDA Backend]
    D --> E[CUDA 11.6]
    E --> F[NVIDIA Driver]
    F --> G[NVIDIA GPU]
Loading
⚠️ **GitHub.com Fallback** ⚠️