Pages

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)

27 October 2020

667. XP PEN/virtual whiteboard during a lecture -- mirroring an application window on linux

The situation:

We're allowed to teach on campus at the moment, but we're also strongly encouraged to adopt a hybrid model where we stream everything via zoom so that students don't show up if they have flu/cold-like symptoms.

We've spent the past few years killing off ppt and transitioning to whiteboard/chalk-and-talk. The students love it -- the pace is better, and the lectures become more interactive since we can adjust our teaching to the students' learning. Good stuff. But horrible for streaming -- you can't just point a webcam at a whiteboard and expect a good outcome (although if need be, it can be done -- just use a good camera and write large with a dark pen).

I have an XP Pen Artist 13.3 Pro (https://www.parkablogs.com/content/review-xp-pen-artist-133-pro-pen-display ) which is fantastic for drawing. A lot of fun, and a potential solution to the whiteboard quandary.

The Problem:

Both the students in the class room and those following the lecture on zoom need to be able to see what you're doing. And since the pen display is a DISPLAY, you need to have your drawing program open on the pen display, and not on the projector (which is also a display).

The Solution:

1. Open your drawing window (xournal, or xournal++ or openboard or krita) on your pen display ... display. 

2. Then run xwininfo (part of x11-utils) and click on your window. You get a window id, e.g. 36000a

Then run x11vnc:
x11vnc -id 36000a

Note the port number -- likely 5900.

The window is now being shared via vnc. 

3. To see it, use e.g. vinagre, click Connect, set the protocol to vnc and the port to 5900 (and you're presumably connecting to localhost). 

Make sure to enable 'scaling', since many old video projectors have a 4:3 resolution ratio, whereas e.g. the xp pen 13.3 has a 16:9 ratio.

Drag this window to the projector.

4. Share the original window via zoom

Note that I've had issues getting the pen display to map correctly when all three display (laptop, xp pen, and projector) are connected. Turning off the laptop screen solved it.


A script:

I've made a script called mirror.sh which starts the x11vnc with the correct id:

winid=`xwininfo |grep "Window id"|gawk '{print $4}'`
x11vnc -id  $winid




01 October 2020

666. Zoom -- multiple booking for a course

Problem:

Recurring bookings are easy enough to make in zoom, but what do you do if your lectures are given at different times each day?

Solution: 

make a recurring booking e.g. at 8 am, 2 hours, each day for two weeks. 'When' is not important.

Then go in and edit the booking. You can then change the times for each zoom meeting:

You can also delete meetings e.g. those that fall on weekends: