ayon
January 11, 2025, 12:38pm
1
Introduction: I use Intel Arc GPU (specifically a750) paired with i5 13400F, how can I enable hardware accelaration and install other necessary drivers in it? I am a bit confused as I am a newbie to Linux and NixOS.
What I have learned and implemented (only those which are comments) after reading a few wiki pages, inside /etc/configuration.nix
{
...
services.xserver = {
enable = true;
xkb.layout = "us";
#videoDrivers = [ "intel" ];
};
#hardware.graphics = {
# enable = true;
# extraPackages = with pkgs; [
# vpl-gpu-rt
# libvdpau-va-gl
# intel-media-driver
# intel-vaapi-driver
# intel-compute-runtime
# ];
# extraPackages32 = with pkgs.pkgsi686Linux; [ intel-vaapi-driver ];
#};
#environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; NIXOS_OZONE_WL = "1"; };
...
}
But, when I do sudo nixos-rebuild switch I encounter no errors but when I reboot it only shows the tty. And, after loggin in through tty I cannot even start sddm sudo systemctl start sddm
. It says sddm.service not found. So, after that I just commented every change I made and it fixed.
so for the configuration of the Gpu you just need to put following in the configuration:
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
... # your Open GL, Vulkan and VAAPI drivers
vpl-gpu-rt # for newer GPUs on NixOS >24.05 or unstable
# onevpl-intel-gpu # for newer GPUs on NixOS <= 24.05
# intel-media-sdk # for older GPUs
];
};
For the sddm problem i don’t really understand if it works now.
but could you post your config?
ayon
January 11, 2025, 3:00pm
3
the problem was with
services.xserver.videoDrivers = [ "intel" ];
after commenting out this line and intel-vaapi-driver
everything worked fine!
thanks for your response!
this is my configuration
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
# bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# hostname
networking.hostName = "dhaka";
# networking
networking.networkmanager.enable = true;
# time zone
time.timeZone = "Asia/Dhaka";
# locale
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# x11 windowing system/ xorg session
services.xserver = {
enable = true;
xkb.layout = "us";
};
# hardware graphics extra packages
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
vpl-gpu-rt
libvdpau-va-gl
intel-media-driver
intel-compute-runtime
];
extraPackages32 = with pkgs.pkgsi686Linux; [ intel-vaapi-driver ];
};
# environment variables
environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; NIXOS_OZONE_WL = "1"; };
# display manager
services.displayManager.sddm.enable = true;
# desktop environment
services.desktopManager.plasma6.enable = true;
# sound with pipewire
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# user account
users.users.me = {
isNormalUser = true;
description = "home";
extraGroups = [ "networkmanager" "wheel" ];
};
# default shell configuration
users.defaultUserShell = pkgs.zsh;
programs = {
zsh = {
enable = true;
autosuggestions.enable = true;
zsh-autoenv.enable = true;
syntaxHighlighting.enable = true;
ohMyZsh = {
enable = true;
theme = "robbyrussell";
plugins = [
"git"
"history"
];
};
};
};
# users group
users.groups.libvirtd.members = [ "me" ];
# unfree packages
nixpkgs.config.allowUnfree = true;
# install programs via options
programs.kdeconnect.enable = true;
programs.virt-manager.enable = true;
# fonts
fonts.packages = with pkgs; [
roboto
unifont
fira-code
hack-font
noto-fonts
font-awesome
dejavu_fonts
liberation_ttf
lohit-fonts.bengali
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
];
# open banla keyboard on wayland with fcitx 5
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.waylandFrontend = true;
fcitx5.addons = with pkgs; [
fcitx5-openbangla-keyboard
];
};
# environment system packages
environment.systemPackages = with pkgs; [
vim
git
qemu
wget
kitty
unzip
clinfo
haruna
yt-dlp
firefox
vscodium
keepassxc
obs-studio
teamviewer
nixpkgs-fmt
qbittorrent
ffmpeg-full
protonvpn-gui
joplin-desktop
github-desktop
kdePackages.kate
nixfmt-rfc-style
kdePackages.kdenlive
(ungoogled-chromium.override {
enableWideVine = true;
commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
"--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport"
"--enable-features=UseMultiPlaneFormatForHardwareVideo"
"--ignore-gpu-blocklist"
"--enable-zero-copy"
];
})
];
# nix flakes
# nix.settings.experimental-features = [ "nix-command" "flakes" ];
# list services that you want to enable:
# teamviewer
services.teamviewer.enable = true;
# virtualization
virtualisation = {
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
# flatpak and xdg portal
services.flatpak.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.config.common.default = "gtk";
# system state version
system.stateVersion = "24.11";
}
1 Like