-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: combine asus and surface builds with nvidia (#210)
* refactor: combine asus and surface builds with nvidia * refactor: Add fix for audio popping on Ally Original commit from ublue-os/asus repo: ublue-os/asus@d4b9b20 * refactor: Add service for Surface hardware setup Original commit from ublue-os/surface repo: ublue-os/surface@ebc60d3 * refactor: silverblue surface specific tweaks Original commits from ublue-os/surface: https://github.com/ublue-os/surface/commits/main/system_files/silverblue * refactor: nvidia-install with targeted Containerfile * refactor: improvement from main * refactor: don't build nvidia 470 for surface * refactor: add concurrency group and tweak some names * docs: README images URL tweak
- Loading branch information
Showing
18 changed files
with
539 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: ublue nvidia 38 | ||
name: ublue hwe 38 | ||
on: | ||
pull_request: | ||
merge_group: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: ublue nvidia 39 | ||
name: ublue hwe 39 | ||
on: | ||
pull_request: | ||
merge_group: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,49 @@ | ||
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" | ||
ARG BASE_IMAGE="ghcr.io/ublue-os/${IMAGE_NAME}-main" | ||
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-silverblue-main}" | ||
ARG SOURCE_ORG="${SOURCE_ORG:-ublue-os}" | ||
ARG BASE_IMAGE="ghcr.io/${SOURCE_ORG}/${SOURCE_IMAGE}" | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}" | ||
|
||
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS nvidia | ||
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS main | ||
|
||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}" | ||
ARG HWE_FLAVOR="{HWE_FLAVOR:-main}" | ||
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" | ||
ARG IMAGE_VENDOR="ublue-os" | ||
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-nvidia}" | ||
ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}" | ||
ARG RPMFUSION_MIRROR="" | ||
|
||
COPY *.sh /tmp/ | ||
COPY ${HWE_FLAVOR}/ /tmp/ | ||
|
||
RUN mkdir -p /var/lib/alternatives && \ | ||
IMAGE_FLAVOR=main /tmp/image-info.sh && \ | ||
/tmp/install.sh && \ | ||
mv /var/lib/alternatives /staged-alternatives && \ | ||
rm -rf /tmp/* /var/* && \ | ||
ostree container commit && \ | ||
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \ | ||
mkdir -p /tmp /var/tmp && \ | ||
chmod -R 1777 /tmp /var/tmp | ||
|
||
FROM main AS nvidia | ||
|
||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}" | ||
ARG HWE_FLAVOR="{HWE_FLAVOR:-main}" | ||
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" | ||
ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}" | ||
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-550}" | ||
ARG RPMFUSION_MIRROR="" | ||
|
||
COPY image-info.sh /tmp/image-info.sh | ||
COPY install.sh /tmp/install.sh | ||
COPY post-install.sh /tmp/post-install.sh | ||
COPY --from=ghcr.io/ublue-os/akmods-nvidia:${HWE_FLAVOR}-${FEDORA_MAJOR_VERSION}-${NVIDIA_MAJOR_VERSION} /rpms /tmp/akmods-rpms | ||
|
||
COPY --from=ghcr.io/ublue-os/akmods-nvidia:main-${FEDORA_MAJOR_VERSION}-${NVIDIA_MAJOR_VERSION} /rpms /tmp/akmods-rpms | ||
|
||
RUN /tmp/image-info.sh && \ | ||
/tmp/install.sh && \ | ||
/tmp/post-install.sh && \ | ||
rm -rf /tmp/* /var/* | ||
COPY *.sh /tmp/ | ||
|
||
RUN ostree container commit && \ | ||
mkdir -p /var/tmp && chmod -R 1777 /tmp /var/tmp | ||
RUN mkdir -p /var/lib/alternatives && \ | ||
IMAGE_FLAVOR=nvidia /tmp/image-info.sh && \ | ||
/tmp/nvidia-install.sh && \ | ||
mv /var/lib/alternatives /staged-alternatives && \ | ||
rm -rf /tmp/* /var/* && \ | ||
ostree container commit && \ | ||
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \ | ||
mkdir -p /tmp /var/tmp && \ | ||
chmod -R 1777 /tmp /var/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Nvidia | ||
# HWE | ||
|
||
[![build-38](https://github.com/ublue-os/nvidia/actions/workflows/build-38.yml/badge.svg)](https://github.com/ublue-os/nvidia/actions/workflows/build-38.yml) [![build-39](https://github.com/ublue-os/nvidia/actions/workflows/build-39.yml/badge.svg)](https://github.com/ublue-os/nvidia/actions/workflows/build-39.yml) | ||
[![build-38](https://github.com/ublue-os/hwe/actions/workflows/build-38.yml/badge.svg)](https://github.com/ublue-os/hwe/actions/workflows/build-38.yml) [![build-39](https://github.com/ublue-os/hwe/actions/workflows/build-39.yml/badge.svg)](https://github.com/ublue-os/hwe/actions/workflows/build-39.yml) | ||
|
||
The purpose of these images is to provide [community Fedora images](https://github.com/ublue-os/main) with Nvidia drivers built-in. This approach can lead to greater reliability as failures can be caught at the build level instead of the client machine. This also allows for individual sets of images for each series of Nvidia drivers, allowing users to remain current with their OS but on an older, known working driver. Performance regression with a recent driver update? Reboot into a known-working driver after one command. That's the goal! | ||
The purpose of these images is to provide [community Fedora images](https://github.com/ublue-os/main) with hardware enablement (ASUS and Surface) and Nvidia. This approach can lead to greater reliability as failures can be caught at the build level instead of the client machine. This also allows for individual sets of images for each series of Nvidia drivers, allowing users to remain current with their OS but on an older, known working driver. Performance regression with a recent driver update? Reboot into a known-working driver after one command. That's the goal! | ||
|
||
# Documentation | ||
|
||
- [Main website and documentation](https://universal-blue.org) | ||
- [Documentation for these images](https://universal-blue.org/images/nvidia) | ||
- [Documentation for these images](https://universal-blue.org/images/) | ||
- [Installation](https://universal-blue.org/installation/) - follow this for clean installation | ||
- [Rebase instructions](https://universal-blue.org/images/) - follow this if you want to switch to another image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"all": { | ||
"include": { | ||
"all": [ | ||
"asusctl", | ||
"asusctl-rog-gui", | ||
"fprintd" | ||
] | ||
}, | ||
"exclude": { | ||
"all": [] | ||
} | ||
} | ||
} |
155 changes: 155 additions & 0 deletions
155
asus/system_files/shared/usr/share/wireplumber/main.lua.d/50-alsa-config.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
alsa_monitor.enabled = true | ||
|
||
alsa_monitor.properties = { | ||
-- Create a JACK device. This is not enabled by default because | ||
-- it requires that the PipeWire JACK replacement libraries are | ||
-- not used by the session manager, in order to be able to | ||
-- connect to the real JACK server. | ||
--["alsa.jack-device"] = false, | ||
|
||
-- Reserve devices via org.freedesktop.ReserveDevice1 on D-Bus | ||
-- Disable if you are running a system-wide instance, which | ||
-- doesn't have access to the D-Bus user session | ||
["alsa.reserve"] = true, | ||
--["alsa.reserve.priority"] = -20, | ||
--["alsa.reserve.application-name"] = "WirePlumber", | ||
|
||
-- Enables MIDI functionality | ||
["alsa.midi"] = true, | ||
|
||
-- Enables monitoring of alsa MIDI devices | ||
["alsa.midi.monitoring"] = true, | ||
|
||
-- MIDI bridge node properties | ||
["alsa.midi.node-properties"] = { | ||
-- Name set for the node with ALSA MIDI ports | ||
["node.name"] = "Midi-Bridge", | ||
-- Removes longname/number from MIDI port names | ||
--["api.alsa.disable-longname"] = true, | ||
}, | ||
|
||
-- These properties override node defaults when running in a virtual machine. | ||
-- The rules below still override those. | ||
["vm.node.defaults"] = { | ||
["api.alsa.period-size"] = 256, | ||
["api.alsa.headroom"] = 8192, | ||
}, | ||
} | ||
|
||
alsa_monitor.rules = { | ||
-- An array of matches/actions to evaluate. | ||
-- | ||
-- If you want to disable some devices or nodes, you can apply properties per device as the following example. | ||
-- The name can be found by running pw-cli ls Device, or pw-cli dump Device | ||
--{ | ||
-- matches = { | ||
-- { | ||
-- { "device.name", "matches", "name_of_some_disabled_card" }, | ||
-- }, | ||
-- }, | ||
-- apply_properties = { | ||
-- ["device.disabled"] = true, | ||
-- }, | ||
--} | ||
{ | ||
-- Rules for matching a device or node. It is an array of | ||
-- properties that all need to match the regexp. If any of the | ||
-- matches work, the actions are executed for the object. | ||
matches = { | ||
{ | ||
-- This matches all cards. | ||
{ "device.name", "matches", "alsa_card.*" }, | ||
}, | ||
}, | ||
-- Apply properties on the matched object. | ||
apply_properties = { | ||
-- Use ALSA-Card-Profile devices. They use UCM or the profile | ||
-- configuration to configure the device and mixer settings. | ||
["api.alsa.use-acp"] = true, | ||
|
||
-- Use UCM instead of profile when available. Can be | ||
-- disabled to skip trying to use the UCM profile. | ||
--["api.alsa.use-ucm"] = true, | ||
|
||
-- Don't use the hardware mixer for volume control. It | ||
-- will only use software volume. The mixer is still used | ||
-- to mute unused paths based on the selected port. | ||
--["api.alsa.soft-mixer"] = false, | ||
|
||
-- Ignore decibel settings of the driver. Can be used to | ||
-- work around buggy drivers that report wrong values. | ||
--["api.alsa.ignore-dB"] = false, | ||
|
||
-- The profile set to use for the device. Usually this is | ||
-- "default.conf" but can be changed with a udev rule or here. | ||
--["device.profile-set"] = "profileset-name", | ||
|
||
-- The default active profile. Is by default set to "Off". | ||
--["device.profile"] = "default profile name", | ||
|
||
-- Automatically select the best profile. This is the | ||
-- highest priority available profile. This is disabled | ||
-- here and instead implemented in the session manager | ||
-- where it can save and load previous preferences. | ||
["api.acp.auto-profile"] = false, | ||
|
||
-- Automatically switch to the highest priority available port. | ||
-- This is disabled here and implemented in the session manager instead. | ||
["api.acp.auto-port"] = false, | ||
|
||
-- Other properties can be set here. | ||
--["device.nick"] = "My Device", | ||
}, | ||
}, | ||
{ | ||
matches = { | ||
{ | ||
-- Matches all sources. | ||
{ "node.name", "matches", "alsa_input.*" }, | ||
}, | ||
{ | ||
-- Matches all sinks. | ||
{ "node.name", "matches", "alsa_output.*" }, | ||
}, | ||
}, | ||
apply_properties = { | ||
--["node.nick"] = "My Node", | ||
--["node.description"] = "My Node Description", | ||
--["priority.driver"] = 100, | ||
--["priority.session"] = 100, | ||
--["node.pause-on-idle"] = false, | ||
--["monitor.channel-volumes"] = false | ||
--["resample.quality"] = 4, | ||
--["resample.disable"] = false, | ||
--["channelmix.normalize"] = false, | ||
--["channelmix.mix-lfe"] = false, | ||
--["channelmix.upmix"] = true, | ||
--["channelmix.upmix-method"] = "psd", -- "none" or "simple" | ||
--["channelmix.lfe-cutoff"] = 150, | ||
--["channelmix.fc-cutoff"] = 12000, | ||
--["channelmix.rear-delay"] = 12.0, | ||
--["channelmix.stereo-widen"] = 0.0, | ||
--["channelmix.hilbert-taps"] = 0, | ||
--["channelmix.disable"] = false, | ||
--["dither.noise"] = 0, | ||
--["dither.method"] = "none", -- "rectangular", "triangular" or "shaped5" | ||
--["audio.channels"] = 2, | ||
--["audio.format"] = "S16LE", | ||
--["audio.rate"] = 44100, | ||
--["audio.allowed-rates"] = "32000,96000", | ||
--["audio.position"] = "FL,FR", | ||
--["api.alsa.period-size"] = 1024, | ||
--["api.alsa.period-num"] = 2, | ||
--["api.alsa.headroom"] = 1024, | ||
--["api.alsa.start-delay"] = 0, | ||
--["api.alsa.disable-mmap"] = false, | ||
--["api.alsa.disable-batch"] = false, | ||
--["api.alsa.use-chmap"] = false, | ||
--["api.alsa.multirate"] = true, | ||
--["latency.internal.rate"] = 0 | ||
--["latency.internal.ns"] = 0 | ||
--["clock.name"] = "api.alsa.0" | ||
--["session.suspend-timeout-seconds"] = 5, -- 0 disables suspend | ||
}, | ||
}, | ||
} |
Oops, something went wrong.