Solving GPU Problems¶
In this article
- After updating drivers or software in Ubuntu, an NVML error occurs: Driver/library version mismatch
- Nvidia Driver Installation: Kernel Modules Not Compiled
- Nvidia Driver Installation Error: Unable to Sign Kernel Modules
- Errors When Installing PyTorch and Its Modules on Ubuntu for Blackwell GPUs (RTX 5090 or RTX 6000 PRO)
- Multilingual Neural Models like DeepSeek R1 Respond in Chinese instead English
- Neural Model in OpenWebUI or Ollama Takes a Long Time to Respond
After updating drivers or software in Ubuntu, an NVML error occurs: Driver/library version mismatch¶
If you encounter an error like Failed to initialize NVML: Driver/library version mismatch after installation, it is necessary to reconnect the Nvidia kernel modules by deleting them and running nvidia-smi again for reinitialization:
sudo rmmod -f nvidia-modeset
sudo rmmod nvidia_uvm
sudo rmmod nvidia_drm
sudo rmmod nvidia-peermem
sudo rmmod nvidia
sudo nvidia-smi
The error can also occur due to the /boot partition being full during simultaneous system kernel updates and an inability to build new initial RAM disks (initrd) with video card modules. To fix this, use this instruction.
If the error persists, it is recommended to remove Nvidia driver packages:
and reinstall them (and CUDA) anew.
Nvidia Driver Installation: Kernel Modules Not Compiled¶
If you encounter an error during the installation of Nvidia drivers like this:
# command: 'make' -j128 KERNEL_UNAME=6.8.0-64-generic IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/6.8.0-64-generic/build LD=/usr/bin/ld.bfd CONFIG_X86_KERNEL_IBT= modules
Makefile:63: WARNING: Unable to locate the compiler x86_64-linux-gnu-gcc-12 from CONFIG_CC_VERSION_TEXT in the kernel configuration.
make[1]: Entering directory '/usr/src/linux-headers-6.8.0-64-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
You are using: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
SYMLINK /var/lib/dkms/nvidia/575.57.08/build/nvidia/nv-kernel.o
SYMLINK /var/lib/dkms/nvidia/575.57.08/build/nvidia-modeset/nv-modeset-kernel.o
it means that GCC version 12 is not installed on your system. Install it using the command:
and reinstall them (and CUDA) again.
Nvidia Driver Installation Error: Unable to Sign Kernel Modules¶
During the installation of graphics card drivers, you might see an error that the system cannot find the update-secureboot-policy package and sign the modules, even though Secure Boot is disabled in BIOS:
Building initial module nvidia/575.57.08 for 6.8.0-64-generic
Sign command: /usr/bin/kmodsign
Binary update-secureboot-policy not found, modules won't be signed
To resolve this issue, install the shim-signed package with the command:
and reinstall them (and CUDA) again.
Errors When Installing PyTorch and Its Modules on Ubuntu for Blackwell GPUs (RTX 5090 or RTX 6000 PRO)¶
When installing the stable version of PyTorch on this family of graphics cards, errors may occur. Use the nightly build version with their support by running the following command:
pip install --upgrade --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130
Where cu130 is the CUDA version (13.0). If you have an earlier version (12.8), use the path https://download.pytorch.org/whl/nightly/cu128.
Multilingual Neural Models like DeepSeek R1 Respond in Chinese instead English¶
Most multilingual models, such as DeepSeek, may occasionally switch to the primary training language (Chinese, for example) even if the request was made in English. This occurs due to model distillation, compression, or the presence of responses primarily in one main language.
To minimize this behavior, it is recommended to explicitly specify the response language by adding "Respond only in English" at the end of the prompt query and including this line in the system prompt. It is also advisable to use models like Qwen3 or Gemma3, which demonstrate greater stability in versions with fewer parameters compared to DeepSeek.
Additionally, you can manually check for responses in English using tools like OpenWebUI or on your chat's backend if you are working through an API.
Neural Model in OpenWebUI or Ollama Takes a Long Time to Respond¶
If the model takes a long time to respond, it may be due to its size and the capacity of your server.
Firstly, ensure that your model fits entirely into the video memory of the GPU. For example, the model qwen3-next:80b is 67 GB when compressed (q4) and requires 80–90 GB of video memory when fully unpacked. If your GPU is an NVIDIA A5000 or RTX 4090 with 24 GB of video memory, Ollama will offload parts of the model layers to the server's CPU, causing VM overload, core allocation reduction, and long response delays.
To work with such a model, more powerful GPUs are needed, such as Nvidia H100 with 80 GB of video memory or a combination of four RTX 4090s. Server RAM is important only for RAG tasks (working with knowledge bases and uploaded files), and in most cases 32 GB of RAM is sufficient.
You can estimate the size of the model in video memory by multiplying its size by 2 if the model is compressed to q4, or by 1.5 if the model is compressed as q8. For every additional 1000 tokens in a context window over 8000, add 1 GB of required video memory.
To check your GPU's load, log into the server via SSH and run ollama ps in the command line:
[ root ]$ ollama ps
NAME ID SIZE PROCESSOR UNTIL
yxchia/multilingual-e5-base:latest f5248cae7e12 1.1 GB 100% GPU 14 minutes from now
qwen3:14b bdbd181c33f2 14 GB 100% GPU 14 minutes from now
The output will show how much space your model occupies and whether it fits entirely in the GPU.
Note
For GPUs with 24 GB of video memory, models larger than 14B or compressed beyond q8 are not recommended. The larger the model's parameter count (volume) and context window size, the longer the response process will be.
Information
Computational performance for 14B models on Nvidia A5000:
- Cold start takes about 30-40 seconds before a response.
- Response time is 10–15 seconds (without reasoning).
- Response time is 20-30 seconds (with reasoning).
If RAG (Retrieval-Augmented Generation) or MCP is used, the response time increases by 5–10 seconds (for database search and tool requests).
Token generation speed is ~40–45 tokens per second. You can verify this by clicking on the icon at the bottom of the chat response line in OpenWebUI and checking the response_token/s parameter.