Run a command on your GNU/Linux dedicated Nvidia GPU (e.g. ollama)

To make sure a command (CLI) is using your NVIDIA GPU in GNU/Linux, you can use the environment variables __NV_PRIME_RENDER_OFFLOAD=1 and __GLX_VENDOR_LIBRARY_NAME=nvidia before your command.

Example:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ollama run orca-mini

You can also verify that it works by running:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor

Which should output something like:

server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
5
Hicham

Get our stories delivered

From us to your inbox weekly.