cuda
Setting Up RamaLama with CUDA Support on Linux systems
This guide walks through the steps required to set up RamaLama with CUDA support.Install the NVIDIA Container Toolkit
Follow the installation instructions provided in the NVIDIA Container Toolkit installation guide.Installation using dnf/yum (For RPM based distros like Fedora)
-
Install the NVIDIA Container Toolkit packages
-
Update the packages list from the repository
Setting Up CUDA Support
For additional information see: Support for Container Device InterfaceGenerate the CDI specification file
Check the names of the generated devices
Open and edit the NVIDIA container runtime configuration:Testing the Setup
Based on this Documentation: Running a Sample WorkloadTest the Installation
Run the following command to verify setup:Expected Output
Verify everything is configured correctly, with output similar to this:container_use_devices boolean in order to run the nvidia-smi command successfully from a container.
:::
To check the status of the boolean, run the following:
off, run the following to turn the boolean on:
CUDA_VISIBLE_DEVICES
RamaLama respects theCUDA_VISIBLE_DEVICES environment variable if it’s already set in your environment. If not set, RamaLama will default to using all the GPU detected by nvidia-smi.
You can specify which GPU devices should be visible to RamaLama by setting this variable before running RamaLama commands:
CUDA_VISIBLE_DEVICES environment variable is set to an empty string, RamaLama will default to using the CPU.
Troubleshooting
CUDA Updates
On some CUDA software updates, RamaLama stops working complaining about missing shared NVIDIA libraries for example:See Also
ramalama(1), podman(1)Jan 2025, Originally compiled by Dan Walsh <dwalsh@redhat.com>
