I have a laptop with a Geforce rtx 3050 mobile graphics card. I installed stable diffusion using their Easy Diffusion package. That way I can generate all kinds of funky images on my laptop.
I have no experience using these kind of applications, so I am running into new things here and need your help.
AFAIK the GPU can be used for computing, using cuda. My GPU matches the requirements. I did not pay much attention during the install, but I think I saw some Torch, conda and python packages being installed. I will try to find a log.
In the end I have a local server which I can access through a web UI, using localhost:9000. Unfortunately it does not recognize my GPU and instead wants to use the CPU, which is much slower. How can I make it see my Nvidia?
When I start Easy Diffusion it tells me this amongst others:
16:00:42.925 INFO MainThread started at 01/28/24 16:00:42 server.py:32
stable-diffusion model(s) found.
gfpgan model(s) found.
realesrgan model(s) found.
vae model(s) found.
/home/[username]/Downloads/easy-diffusion/installer_files/env/lib/python3.8/site-packages/torch/cuda/__init__.py:546: UserWarning: Can't initialize NVML
warnings.warn("Can't initialize NVML")
16:00:44.273 WARNING MainThread WARNING: Could not find a compatible GPU. Using the CPU, but this will be very slow! device_manager.py:56
16:00:44.274 INFO MainThread Start new Rendering Thread on device: cpu
I looked up the script, but that doesn’t get my anywhere:
def _raw_device_count_nvml() -> int:
"""Return number of devices as reported by NVML
or negative value if NVML discovery/initialization failed."""
from ctypes import CDLL, c_int, byref
nvml_h = CDLL("libnvidia-ml.so.1")
rc = nvml_h.nvmlInit()
warnings.warn("Can't initialize NVML")
Some information on my system:
mhwd -l -d --pci
--------------------------------------------------------------------------------
> PCI Device: /devices/pci0000:00/0000:00:06.0/0000:01:00.0 (0302:10de:25a2)
Display controller nVidia Corporation GA107M [GeForce RTX 3050 Mobile]
--------------------------------------------------------------------------------
> INSTALLED:
NAME: video-hybrid-intel-nvidia-prime
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Hybrid prime solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver.
PRIORITY: 8
FREEDRIVER: false
DEPENDS: video-modesetting
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302 0300
VENDORIDS: 10de 8086
NAME: video-linux
ATTACHED: PCI
VERSION: 2018.05.04
INFO: Standard open source drivers.
PRIORITY: 2
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300 0380 0302
VENDORIDS: 1002 8086 10de
> AVAILABLE:
NAME: video-hybrid-intel-nvidia-prime
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Hybrid prime solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver.
PRIORITY: 8
FREEDRIVER: false
DEPENDS: video-modesetting
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302 0300
VENDORIDS: 10de 8086
NAME: video-hybrid-intel-nvidia-470xx-prime
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Hybrid prime solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver.
PRIORITY: 7
FREEDRIVER: false
DEPENDS: video-modesetting
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302 0300
VENDORIDS: 10de 8086
NAME: video-nvidia
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Closed source NVIDIA drivers for linux.
PRIORITY: 5
FREEDRIVER: false
DEPENDS: -
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302
VENDORIDS: 10de
NAME: video-nvidia-470xx
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Closed source NVIDIA drivers for linux.
PRIORITY: 4
FREEDRIVER: false
DEPENDS: -
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302
VENDORIDS: 10de
NAME: video-linux
ATTACHED: PCI
VERSION: 2018.05.04
INFO: Standard open source drivers.
PRIORITY: 2
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300 0380 0302
VENDORIDS: 1002 8086 10de
--------------------------------------------------------------------------------
> PCI Device: /devices/pci0000:00/0000:00:02.0 (0300:8086:9a49)
Display controller Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics]
--------------------------------------------------------------------------------
> INSTALLED:
NAME: video-hybrid-intel-nvidia-prime
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Hybrid prime solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver.
PRIORITY: 8
FREEDRIVER: false
DEPENDS: video-modesetting
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302 0300
VENDORIDS: 10de 8086
NAME: video-linux
ATTACHED: PCI
VERSION: 2018.05.04
INFO: Standard open source drivers.
PRIORITY: 2
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300 0380 0302
VENDORIDS: 1002 8086 10de
NAME: video-modesetting
ATTACHED: PCI
VERSION: 2020.01.13
INFO: X.org modesetting video driver.
PRIORITY: 1
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300
VENDORIDS: *
> AVAILABLE:
NAME: video-hybrid-intel-nvidia-prime
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Hybrid prime solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver.
PRIORITY: 8
FREEDRIVER: false
DEPENDS: video-modesetting
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302 0300
VENDORIDS: 10de 8086
NAME: video-hybrid-intel-nvidia-470xx-prime
ATTACHED: PCI
VERSION: 2023.03.23
INFO: Hybrid prime solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver.
PRIORITY: 7
FREEDRIVER: false
DEPENDS: video-modesetting
CONFLICTS: video*nvidia*
CLASSIDS: 0300 0302 0300
VENDORIDS: 10de 8086
NAME: video-linux
ATTACHED: PCI
VERSION: 2018.05.04
INFO: Standard open source drivers.
PRIORITY: 2
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300 0380 0302
VENDORIDS: 1002 8086 10de
NAME: video-modesetting
ATTACHED: PCI
VERSION: 2020.01.13
INFO: X.org modesetting video driver.
PRIORITY: 1
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300
VENDORIDS: *
NAME: video-vesa
ATTACHED: PCI
VERSION: 2017.03.12
INFO: X.org vesa video driver.
PRIORITY: 0
FREEDRIVER: true
DEPENDS: -
CONFLICTS: -
CLASSIDS: 0300
VENDORIDS: *
inxi -Fz
System:
Kernel: 6.1.71-1-MANJARO arch: x86_64 bits: 64 Desktop: KDE Plasma
v: 5.27.10 Distro: Manjaro Linux
Machine:
Type: Laptop System: ASUSTeK product: Vivobook_ASUSLaptop X7600PC_N7600PC
v: 1.0 serial: <superuser required>
Mobo: ASUSTeK model: X7600PC v: 1.0 serial: <superuser required>
UEFI: American Megatrends LLC. v: X7600PC.300 date: 11/08/2021
Battery:
ID-1: BAT0 charge: 35.3 Wh (43.4%) condition: 81.4/96.0 Wh (84.8%)
volts: 11.7 min: 11.7
CPU:
Info: quad core model: 11th Gen Intel Core i7-11370H bits: 64 type: MT MCP
cache: L2: 5 MiB
Speed (MHz): avg: 649 min/max: 400/4800 cores: 1: 1074 2: 400 3: 1056
4: 400 5: 400 6: 400 7: 400 8: 1069
Graphics:
Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel
Device-2: NVIDIA GA107M [GeForce RTX 3050 Mobile] driver: N/A
Device-3: IMC Networks USB2.0 HD UVC WebCam driver: uvcvideo type: USB
Display: x11 server: X.Org v: 21.1.10 driver: X: loaded: modesetting
dri: iris gpu: i915 resolution: 2560x1600
API: EGL v: 1.5 drivers: iris,swrast platforms: gbm,x11,surfaceless,device
API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 23.3.3-manjaro1.1
renderer: Mesa Intel Xe Graphics (TGL GT2)
API: Vulkan v: 1.3.274 drivers: intel surfaces: xcb,xlib
Audio:
Device-1: Intel Tiger Lake-LP Smart Sound Audio driver: snd_hda_intel
API: ALSA v: k6.1.71-1-MANJARO status: kernel-api
Server-1: PulseAudio v: 16.1 status: active
Network:
Device-1: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
driver: mt7921e
IF: wlo1 state: up mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
Bluetooth:
Device-1: IMC Networks Wireless_Device driver: btusb type: USB
Report: btmgmt ID: hci0 state: up address: <filter> bt-v: 5.2
Drives:
Local Storage: total: 476.94 GiB used: 144.63 GiB (30.3%)
ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFM512GD3JX013N
size: 476.94 GiB
Partition:
ID-1: / size: 150.74 GiB used: 42.89 GiB (28.5%) fs: ext4
dev: /dev/nvme0n1p1
ID-2: /boot/efi size: 487 MiB used: 312 KiB (0.1%) fs: vfat
dev: /dev/nvme0n1p2
ID-3: /home size: 286.23 GiB used: 101.7 GiB (35.5%) fs: ext4
dev: /dev/nvme0n1p4
Swap:
ID-1: swap-1 type: partition size: 31.25 GiB used: 39.2 MiB (0.1%)
dev: /dev/nvme0n1p5
Sensors:
System Temperatures: cpu: N/A mobo: N/A
Fan Speeds (rpm): cpu: 2800
Info:
Processes: 279 Uptime: 1h 24m Memory: total: 16 GiB note: est.
available: 15.31 GiB used: 10.58 GiB (69.1%) Shell: Zsh inxi: 3.3.31
Tried updating to the latest drivers using mhwd -a pci nonfree 0300 , but apparently I already have what’s best. Tried to figure out if there is some way to ‘activate’ the nvidia gpu. Installed Optimus-manager, but that did not work at all… I would like to have the option to only use the nvidia is necessary, but the GPU should be recognised/initialised by Stable diffusion.
Thank you!