Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

求助:unraid如何可以手动控制pwm风扇

Featured Replies

想请教下unraid该如何手动控制pwm风扇,需要的原因是买了一块特斯拉P4的显卡直通给windows,为了散热上了个暴力风扇满载噪音太大,低速运行又会导致温度过高,想有没有可能使用User Scripts脚本,添加两条脚本,比如点一下就可以30%转速运行,点另外一个就可以100%转速运行

Solved by ich777

  • Solution
On 2/21/2024 at 11:25 AM, yin1217168205 said:

想请教下unraid该如何手动控制pwm风扇,需要的原因是买了一块特斯拉P4的显卡直通给windows,为了散热上了个暴力风扇满载噪音太大,低速运行又会导致温度过高,想有没有可能使用User Scripts脚本,添加两条脚本,比如点一下就可以30%转速运行,点另外一个就可以100%转速运行

I'm not sure if my translation site translated everything correctly but you should be able to manually set fan speeds with a script, however you have to do that on your own since this is in most of the times a bit of trail and error.

 

It would be best to start here at the ASUS section but keep in mind that you maybe have a bit different path to your fan controller since on my system it's like that:

/sys/devices/platform/nct6775.656/hwmon/hwmon4/

however if you figured out which path is for which fan you can write your script.

 

Hope that helps.

57 minutes ago, ich777 said:

I'm not sure if my translation site translated everything correctly but you should be able to manually set fan speeds with a script, however you have to do that on your own since this is in most of the times a bit of trail and error.

 

It would be best to start here at the ASUS section but keep in mind that you maybe have a bit different path to your fan controller since on my system it's like that:

/sys/devices/platform/nct6775.656/hwmon/hwmon4/

however if you figured out which path is for which fan you can write your script.

 

Hope that helps.

 

Thanks for sharing !

 

@yin1217168205 你可以参考上面 ich777 的资料去了解一下,我自己没试过使用脚本去控制风扇(也没研究),因为我设备上的风扇无法使用 autofan 插件进行控制(插件比较老了,所以不支持也是正常的),所以我都是通过主板 BIOS 去设置风扇转速来根据温度进行自动调整。

Edited by JackieWu

34 minutes ago, JackieWu said:

Thanks for sharing !

You basically should be always be able to control your fans with a script, you first have to make sure that you set the fan to manual mode (because otherwise it will apply the fan speed only for a short while) and then you can change the values from 0 to 255 (most of the times a minimum speed is set too, so to speak 0 is actually not 0 in most cases).

 

But the paths are basically the same as in the Arch wiki but as said you have to change it a bit according to your hardware.

 

Hope that helps.

  • Author
9 hours ago, ich777 said:

基本上,您应该始终能够使用脚本控制您的风扇,您首先必须确保将风扇设置为手动模式(否则它只会在短时间内应用风扇速度),然后您可以将值从 0 更改为 255(大多数时候也设置了最低速度, 可以这么说,在大多数情况下,0 实际上不是 0)。

 

但是路径与 Arch wiki 中的路径基本相同,但如前所述,您必须根据您的硬件对其进行一些更改。

 

希望能有所帮助。

我确定在BIOS中风扇设置为手动模式了,但是请教下unraid中该如何设置呢?因为我曾经使用     echo 120 | tee /sys/class/hwmon/hwmon3/pwm7     这条命令成功控制过风扇转速,但不知道之前操作了那些命令开启了手动模式,曾经运行的命令有  “sensors -uA”  “pwmconfig”  还有些其他命令,然后运行这条命令“echo 120 | tee /sys/class/hwmon/hwmon3/pwm7 ”就成功控制了速度,但是重启后直接运行控制转速命令就无法实现了。

还有个问题是,如果按照您  “/sys/devices/platform/nct6775.656/hwmon/hwmon4/”  这条命令运行我该如何查看我自己电脑“nct6775.656”该如何替换正确命令?

  • Author
9 hours ago, JackieWu said:

 

Thanks for sharing !

 

@yin1217168205 你可以参考上面 ich777 的资料去了解一下,我自己没试过使用脚本去控制风扇(也没研究),因为我设备上的风扇无法使用 autofan 插件进行控制(插件比较老了,所以不支持也是正常的),所以我都是通过主板 BIOS 去设置风扇转速来根据温度进行自动调整。

是的,我准备回去按这个方式研究研究,但是不太懂linux命令,我的CPU是使用BIOS去控制的,但是由于我的主板BIOS无法读取到Tesla P4显卡的温度,能想到的方法是只能使用脚本控制了,我想因为我的显卡被我直通给了虚拟机,Unraid无法读取到显卡温度也就无法使用AutoFan插件来控制显卡风扇的转速了

3 hours ago, yin1217168205 said:

还有个问题是,如果按照您  “/sys/devices/platform/nct6775.656/hwmon/hwmon4/”  这条命令运行我该如何查看我自己电脑“nct6775.656”该如何替换正确命令?

Sorry but I can't help you here since you have to discover which path is right for you on your own.

It maybe be not nct6775.656, it can be anything.

 

The setting in the BIOS doesn't matter, with that you override the fan profile from the BIOS, please go again to the linked Arch documentation and read again what you have to do to select the different modes.

Basically what you have to do is:

  1. Set the FAN mode to manual (not in the BIOS)
  2. Set the FAN speed to whatever you like (I assume a value of 120 in your case)
  3. Put the commands in a user script and let them run at reboot
  • Author
1 hour ago, ich777 said:

Sorry but I can't help you here since you have to discover which path is right for you on your own.

It maybe be not nct6775.656, it can be anything.

 

The setting in the BIOS doesn't matter, with that you override the fan profile from the BIOS, please go again to the linked Arch documentation and read again what you have to do to select the different modes.

Basically what you have to do is:

  1. Set the FAN mode to manual (not in the BIOS)
  2. Set the FAN speed to whatever you like (I assume a value of 120 in your case)
  3. Put the commands in a user script and let them run at reboot

OK,thank you

  • 1 year later...

和你一样捡了teslaP4,分享下方案:

首先感谢AI!感谢AI!感谢AI!

控制器编号自己改吧。

 

echo 1 >/sys/devices/platform/nct6775.656/hwmon/hwmon2/pwm1_enable
# 修改风扇为手动模式
while true; do
    # 获取显卡温度作为参数
    param=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits 2>/dev/null)

    # 检查命令是否执行成功
    if [ $? -ne 0 ]; then
        echo "无法获取显卡温度,请检查nvidia-smi命令是否可用。"
    else
        # 检查参数是否为有效的数字
        if ! [[ $param =~ ^[0-9]+$ ]]; then
            echo "获取的显卡温度不是一个有效的整数。"
        else
            # 根据参数值执行不同的任务
            if [ $param -gt 70 ]; then
                echo 251 >/sys/devices/platform/nct6775.656/hwmon/hwmon2/pwm1
                # 这里可以添加任务2的具体命令
            elif [ $param -gt 60 ]; then
                echo 249 >/sys/devices/platform/nct6775.656/hwmon/hwmon2/pwm1
                # 这里可以添加任务1的具体命令
            elif [ $param -lt 40 ]; then
                echo 0 >/sys/devices/platform/nct6775.656/hwmon/hwmon2/pwm1
                # 这里可以添加任务3的具体命令
            else
                echo "参数值未达到执行任务的条件。"
            fi
        fi
    fi
    # 等待 3 秒
    sleep 3
done

 

image.thumb.png.d12247c8bb4748498c7962acb608b73e.png

这题我会啊,在原来autofan加一个功能即可

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.