Skip to content

Commit

Permalink
nvidia: Add FAN speed (PWM) controller
Browse files Browse the repository at this point in the history
NVIDIA's Jetpack framework provides a proprietary tool to control the
FAN speed (PWM) on Jetson platforms (specially the developer kit
boards). This commit introduces a FOSS and simplified version of this
tool written from scratch. Initially, two FAN speed profiles are being
provided for Jetson Xavier and Orin platforms: quiet and cool.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
  • Loading branch information
rene authored and OhmSpectator committed Sep 9, 2024
1 parent 5bdb074 commit 4db7152
Show file tree
Hide file tree
Showing 4 changed files with 402 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/nvidia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ RUN mkdir -p dist
RUN make cmd-nvidia-ctk && cp nvidia-ctk dist/
RUN make cmd-nvidia-cdi-hook && cp nvidia-cdi-hook dist/

# Build nvfanctrl
COPY nvfanctrl/ /nvfanctrl
WORKDIR /nvfanctrl
RUN make && mkdir -p dist/ && cp nvfanctrl dist/

# Get and extract ldconfig for glibc, this tool runs over the rootfs of the
# application container, like CUDA application containers (glibc based).
ADD http://ports.ubuntu.com/ubuntu-ports/pool/main/g/glibc/libc-bin_2.31-0ubuntu9.16_arm64.deb /
Expand Down Expand Up @@ -98,6 +103,7 @@ COPY --from=build /cdi-dist/*.yaml /etc/cdi/
COPY --from=build /rules.d/* /opt/vendor/nvidia/etc/udev/rules.d/
COPY --from=build /rootfs-dist/ /opt/vendor/nvidia/dist/
COPY --from=build /ldconfig-bin/* /opt/vendor/nvidia/bin/
COPY --from=build /nvfanctrl/dist/* /opt/vendor/nvidia/bin/
COPY --from=build /nvct/dist/* /opt/vendor/nvidia/bin/
COPY --from=build /nv-init.sh /opt/vendor/nvidia/init.d/

Expand Down
15 changes: 15 additions & 0 deletions pkg/nvidia/nvfanctrl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2024 Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0
#
SOURCES=main.go
BINARY=nvfanctrl

.PHONY: clean

all: $(BINARY)

$(BINARY):$(SOURCES)
go build -o $@ $<

clean:
rm -f $(BINARY)
Loading

0 comments on commit 4db7152

Please sign in to comment.