Blender not reconizing Nvidia CUDA

Blender 4.0 is not recognizing CUDA. (Downloaded from blender.org)

I have installed Nvidia driver using HowToNvidia and HowToCUDA.

System Info :

System Details Report


Report details

  • Date generated: 2023-12-10 10:39:39

Hardware Information:

  • Hardware Model: Micro-Star International Co., Ltd. GL63 9RC
  • Memory: 16.0 GiB
  • Processor: Intel® Core™ i5-9300H × 8
  • Graphics: Intel® UHD Graphics 630 (CFL GT2)
  • Graphics 1: NVIDIA GeForce GTX 1050
  • Disk Capacity: 512.1 GB

Software Information:

  • Firmware Version: E16P8IMS.308
  • OS Name: Fedora Linux 39 (Workstation Edition)
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 45.2
  • Windowing System: Wayland
  • Kernel Version: Linux 6.6.4-200.fc39.x86_64

nvidia-smi output :

Sun Dec 10 10:48:11 2023
±--------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06 Driver Version: 545.29.06 CUDA Version: 12.3 |
|-----------------------------------------±---------------------±---------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce GTX 1050 On | 00000000:01:00.0 Off | N/A |
| N/A 48C P8 N/A / ERR! | 1MiB / 4096MiB | 0% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+

±--------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 2422 G /usr/bin/gnome-shell 1MiB |
±--------------------------------------------------------------------------------------+

nvcc --version output :

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Nov__3_17:16:49_PDT_2023
Cuda compilation tools, release 12.3, V12.3.103
Build cuda_12.3.r12.3/compiler.33492891_0

lsmod | grep -e “nvidia” output :

nvidia_drm 118784 2
nvidia_modeset 1585152 2 nvidia_drm
nvidia_uvm 3522560 0
nvidia 62394368 34 nvidia_uvm,nvidia_modeset
video 77824 3 msi_wmi,i915,nvidia_modeset

cat /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=“console”
GRUB_CMDLINE_LINUX=“rhgb quiet nvidia-drm.modeset=1 rd.driver.blacklist=nouveau modprobe.blacklist=nouveau”
GRUB_DISABLE_RECOVERY=“true”
GRUB_ENABLE_BLSCFG=true

Is this issue related to kernel or due to Nvidia driver update?

I tried to check by booting with old kernel version, nvidia failed and throw driver mismatch error.

For me the update to the 545 driver also broke cuda since cuda was updated from 12.2 to 12.3.

I fixed it on my system by downgrading back to the 535 driver.

sudo dnf remove \*nvidia\*545\*
sudo dnf install akmod-nvidia-535.129.03* xorg-x11-drv-nvidia-cuda-535.129.03 nvidia-{settings,persistenced}-535.129.03

Note that this will only replace the kmod-nvidia package for those kernels where the 545 driver is already installed. You can see which driver is installed for all kernels with dnf list installed kmod-nvidia-\*

I am unsure if the install of the 535 drivers will work if you are using the rpmfusion-nonfree-nvidia-drivers repo since I do not use that repo. It worked for me with the rpmfusion-nonfree repo.

Thankyou so much for solution :heart:. Will try and update here.