I just spent a couple of days trying to figure this out. I hope someone can use this to have an "Ah ha!" moment for the actual issue, but this is a workaround.
I am running UBUNTU Ubuntu 22.04 on a ASUS ProArt B550-creator motherboard with a AMD Ryzen 9 5950X, 64GB RAM and a Zotac Gaming Geforce RTX 3060, dual booting with Windows 11.
Blender in Windows 11 didn't have any issues. I could see the GPU in the CUDA tabs in Preferences -> System. Both the GPU and CPU showed up.
In Blender on Ubuntu, Preferences -> System under the CUDA tab, it showed only "No Compatible GPUs found for Cycles Requires NVIDIA GPU with a compute capability 3.0".
I reverted to an older version of Blender as was suggested by a post I found (downloaded it from the Blender website) and ran it from the command line, and the CUDA tab showed the GPU as expected.
And then, why not...
I downloaded the latest version of Blender as a tar file, untarred it, cd'ed into the created directory and started it from the command line as well, and the CUDA tab showed as expected.
I'm not sure why running it from the command line works, but the "apt" application install doesn't (even when it is started from the command line).
It looks like apt install
installed Blender 3.0.1, and the download version that worked was for 3.4.1
I am going to try the following post next to see if it may be version related.
The following is a verbose history of the things I did to try and get it to work. I'm still not happy with it running from the command line, but at least I can use the GPU/Cycles with the latest version.
Installing blender via snap (later back this out):
sudo apt update
sudo apt install blender -y
sudo ubuntu-drivers autoinstall
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
Dealing with "UnboundLocalError: local variable 'version' referenced before assignment" errors, referred to ubuntu-drivers "UnboundLocalError: local variable 'version' referenced before assignment" when installing nvidia drivers
ls -l /usr/lib/python3/dist-packages/UbuntuDrivers/detect.py
sudo vi /usr/lib/python3/dist-packages/UbuntuDrivers/detect.py
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
ubuntu-drivers devices
sudo apt install nvidia-driver-525
sudo reboot
nvidia-smi
nvidia-setting
sudo apt install nvidia-cuda-toolkit
sudo reboot
Removing sudo apt install
version of Blender and installing it with snap --classic
and reinstalling drivers, etc.
sudo snap remove blender
sudo apt remove blender
sudo snap install blender --classic
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-driver-525
nvidia-smi
nvidia-settings
sudo apt install nvidia-cuda-toolkit
Removing all "Snap" version of blender and installing it with the normal apt install blender and reinstalling drivers, etc.
sudo snap remove blender
sudo apt install blender
nvidia-settings
nvidia-smi
Trying to run with some different drivers (testing blender after each block - no GPUs showed on any of the versions).
sudo apt install nvidia-driver-470
sudo reboot
sudo apt install nvidia-cuda-toolkit
nvidia-smi
sudo apt install nvidia-driver-525
sudo reboot
sudo apt install nvidia-cuda-toolkit
sudo reboot
nvidia-settings
nvidia-smi
sudo apt install nvidia-utils-525
sudo reboot
nvidia-smi
I'm not sure this was needed, but I wanted to see if OpenGL was working (thinking it may have been related to missing drivers?) followed: http://www.codebind.com/linux-tutorials/install-opengl-ubuntu-linux/
Installed VSCode:
code .
ls
sudo apt-get update
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
g++ main.cpp -o firstOpenGlApp -lglut -lGLU -lGL
ls
./firstOpenGlApp
After reading a document that stated that if you have problems with the current Blender version your graphics card probably doesn't support the newer version of openGL (or something like that) and that you should install the 2.79 version
Downloaded 2.79 from https://download.blender.org/release/Blender2.79/latest/
cd Downloads/
bunzip2 blender-2.79-e045fe53f1b0-linux-glibc217-x86_64.tar.bz2
tar -xvf blender-2.79-e045fe53f1b0-linux-glibc217-x86_64.tar
cd blender-2.79-e045fe53f1b0-linux-glibc217-x86_64/
./blender
Downloaded 3.4.1 from https://www.blender.org/download/ by clicking the download button, and unzipping from the Files application by right-clicking on the file in the ~/Downloads/
directory and selecting Extract here.
cd blender-3.4.1-linux-x64/
./blender
Once the latest was started, the GPU shows as expected... 3.4.1 vs. 3.0.1 that was installed by sudo apt install blender