Showing posts with label nouveau. Show all posts
Showing posts with label nouveau. Show all posts

30 October 2020

668. Controlling the fan speed of an Nvidia card when you're using the nouveau driver and no xorg.conf

 My old GT210 has served me well, but I've had a few odd freezes recently, coupled with weird graphics behaviour. It's a pity, since it's a nice, silent fan-less graphics card from way back when: https://www.gigabyte.com/Graphics-Card/GV-N210SL-1GI#ov

Although some of it may be due to switching back and forth between VGA and HDMI output (between an old HP 19'' and my new fancy xp pen display) I ripped it out and replaced it with an almost as ancient GT 520 (https://www.gigabyte.com/Graphics-Card/GV-N520OC-1GI#ov)

The fan isn't loud, but it's there, and it's distracting since I'm working in a home environment (Corona!).

Looking online I found these posts:
http://floppym.blogspot.com/2013/07/fan-control-with-nouveau.html
https://forums.opensuse.org/showthread.php/501517-OS-13-1-Driver-quot-nouveau-quot-Unable-to-command-fan-speed-Nvidia-6800-GS
https://www.kernel.org/doc/Documentation/thermal/nouveau_thermal

So, first to check if fan control is possible:

me@indium:~$ find /sys -name pwm1_enable
find: ‘/sys/kernel/debug’: Permission denied
/sys/devices/platform/it87.2624/hwmon/hwmon2/pwm1_enable
/sys/devices/platform/it87.2656/hwmon/hwmon3/pwm1_enable
/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0/hwmon/hwmon0/pwm1_enable
me@indium:~$ readlink /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0/driver
../../../../bus/pci/drivers/nouveau

Good, and we got the hwmon number -- 0. 

I then created a script called gpufan.sh:

sudo sh -c "echo 1 > /sys/class/hwmon/hwmon0/pwm1_enable"
sudo sh -c "echo 35 > /sys/class/hwmon/hwmon0/pwm1_min"
sudo sh -c "echo 45 > /sys/class/hwmon/hwmon0/pwm1"

I set the min% to 35 -- it used to be 65. And I tested my way to 45% as a good compromise between noise and temperature. By default the fan speed was >4,000 rpm. Output from sensors now:

nouveau-pci-0500
Adapter: PCI adapter
GPU core:     +0.90 V  (min =  +0.90 V, max =  +1.11 V)
fan1:        2790 RPM
temp1:        +34.0°C  (high = +95.0°C, hyst =  +3.0°C)
                       (crit = +105.0°C, hyst =  +5.0°C)
                       (emerg = +135.0°C, hyst =  +5.0°C)

12 January 2012

48. nvidia gt520 issues and solutions on debian testing

EDIT: see here for a Linux Mint Debian Edition take on the GT 520 nouveau issue -- http://community.linuxmint.com/tutorial/view/824

EDIT: Someone made a succinct how-to for nvidia driver installation on debian: http://blog.libremath.org/2012/04/07/debian-nvidia-quick-guide/ NOTE: site seems to be down.

--start here --
I recently bought an nvidia gt520 1 GB graphics card. To my surprise it turned out to be a bit of a pain to actually get it working properly.

Sadly, we don't always document all the steps when trying to get something to work, but here's roughly what I remember.

The problem:
I plugged the nvidia gt520 into the pci express slot, connected the vga cable to the vga socket on the new graphics card and started my computer. My setup autostarts gdm3. Everything went fine -- the boot messages were flashing by as per normal, then gdm3 started. And got stuck. I experience two different types of hanging  -- either just a black screen, or a black screen with a single cursor indicator (a single _ in the top left corner).

Logging in remotely (had ssh server running) and looking at top I could see that gdm3 was using up 50+% cpu power. Leaving the system for half an hour didn't allow for any progress.

Also, even when I did ctrl+alt+f1 to bring up tty1 I would be forcibly returned to tty7 over and over again. Trying to fix anything was thus difficult. After doing ctrl+alt+f1 a few times and being thrown around it would stop responding and strange symbols would appear on the screen when trying to use the keyboard.

One last piece of information: my onboard graphics is nvidia as well, but this probably isn't relevant.

Logging in remotely I tried using the excellent smxi / sgfxi scripts (http://smxi.org/) to install the proper graphics drivers. I tried nouveau, debian-nvidia and nvidia-current . I also tried just deleting /etc/X11/xorg.conf and hoping for the best

Diagnosis:
First I made sure gmd wasn't starting anymore so that the computer wouldn't hang and I'd be able to work in peace:
sudo vim /etc/default/grub

CMD_LINUX_DEFAULT="quiet splash"
was changed to
CMD_LINUX_DEFAULT="quiet splash text"
(there may be other things on the same line -- just add text)

Then to make the changes take effect,
sudo update-grub
and reboot

Second I tried unloading any modules

sudo rmmod nouveau
sudo rmmod nvidia

I edited /etc/modules and commented out nvidia, and made sure nouveau was there. I also edited etc/modprobe.d/nvidia-kernel-common.conf and commented out blacklist nouveau.

I then tried installing the nouveu driver a last time
sudo sgfxi -N nouveau
and rebooted
After the reboot had completed dmesg| grep nouv gave me the clue I needed -- the drivers had failed to load! I don't remember what the exact message was, but it was all about failure.


Solution:
(also see first post below)

I removed the xorg.conf
sudo rm /etc/X11/xorg.conf
then
startx
The desktop started! But I found myself in fallback mode -- the graphics acceleration obviously wasn't working -- but that wasn't a surprise since the drivers had failed to load.

I then ran
sudo rmmod nouveau
sudo apt-get install nvidia-kernel-dkms nvidia-settings nvidia-smi nvidia-xconfig
sudo nvidia-xconfig
startx

It worked!

My autogenerated /etc/modprobe.d/nvidia-kernel-common.conf now looks like this again:
alias char-major-195* nvidia

options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=44 NVreg_DeviceFileMode=0660
# To enable FastWrites and Sidebus addressing, uncomment these lines
# options nvidia NVreg_EnableAGPSBA=1
# options nvidia NVreg_EnableAGPFW=1

# see #580894
blacklist nouveau

Remember to remove any mention of nouveau in /etc/modules.

You can change your /etc/default/grub back to the way it was again to make gdm start again every time.

Edit: Reading between the lines it seems that Squeeze may not have the proper drivers available for GT520 -- binary installation using smxi might be a good idea in that case: http://forums.debian.net/viewtopic.php?f=17&t=72876

Lengthy output follows:

Here's dmesg | grep nvidia

###############################
[    7.192358] nvidia: module license 'NVIDIA' taints kernel.
[    7.278115] nvidia 0000:02:00.0: PCI INT A -> Link[LNED] -> GSI 18 (level, low) -> IRQ 18
[    7.278122] nvidia 0000:02:00.0: setting latency timer to 64
###############################


Here's lspci -vvnn



###############################


02:00.0 VGA compatible controller [0300]: nVidia Corporation GF119 [GeForce GT 520] [10de:1040] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Giga-byte Technology Device [1458:3520]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 18
Region 0: Memory at df000000 (32-bit, non-prefetchable) [size=16M]
Region 1: Memory at d0000000 (64-bit, prefetchable) [size=128M]
Region 3: Memory at dc000000 (64-bit, prefetchable) [size=32M]
Region 5: I/O ports at ec00 [size=128]
[virtual] Expansion ROM at def80000 [disabled] [size=512K]
Capabilities: <access denied>
Kernel driver in use: nvidia

###############################


Here's lshw -C display (run as user)
###############################
WARNING: you should run this program as super-user.

  *-display            
       description: VGA compatible controller
       product: GF119 [GeForce GT 520]
       vendor: nVidia Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:18 memory:df000000-dfffffff memory:d0000000-d7ffffff memory:dc000000-ddffffff ioport:ec00(size=128) memory:def80000-deffffff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
###############################


And here's the xorg.conf:


###############################


# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 290.10  (pbuilder@cake)  Wed Nov 23 11:33:47 UTC 2011

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubS


###############################



Links to this page:
http://community.linuxmint.com/tutorial/view/824