Software rendering with AMD Ryzen 5 Pro 7535U amdgpu

Hi,
I switched Laptops last night, from an Intel (HD Graphics) based one to a AMDGPU based one (Thinkpad L14 Gen 5; AMD Ryzen 5 Pro 7535U)

My NixOS Live iso works perfectly which basically is
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix>
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>

But with a dd-copy of my old laptops disk (+entending the partition table), the system ends up in software-rendering mode. /run/opengl-driver is totally missing while the amdgpu kernel module is loaded. I regenerated hardware-configuration.nix and reduced my configuration.nix to a rather minimal example, in some instances trying to re-create the config of a live-system. Wayland doesn’t work at all while X11 works only in software-rendering-mode.

Any idea? Any specific videodriver that I should try (the wiki seems outdated therefore I didn’t try setting specific packages for hardware.graphics.

# lsmod
Module                  Size  Used by
ccm                    20480  6
michael_mic            12288  1
af_packet              65536  6
nls_iso8859_1          12288  1
nls_cp437              16384  1
qrtr_mhi               16384  0
vfat                   24576  1
fat                   110592  1 vfat
amdgpu              15753216  1
snd_acp6x_pdm_dma      16384  1
snd_soc_dmic           12288  1
snd_soc_acp6x_mach     40960  4
snd_sof_amd_acp70      16384  0
snd_sof_amd_acp63      16384  0
snd_soc_acpi_amd_match     8192  1 snd_sof_amd_acp63
snd_sof_amd_vangogh    16384  0
snd_sof_amd_rembrandt    16384  0
snd_sof_amd_renoir     16384  0
snd_sof_amd_acp        69632  5 snd_sof_amd_acp70,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_sof_amd_renoir
snd_sof_pci            24576  5 snd_sof_amd_acp70,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_sof_amd_renoir
snd_sof_xtensa_dsp     16384  1 snd_sof_amd_acp
snd_sof               479232  2 snd_sof_amd_acp,snd_sof_pci
joydev                 28672  0
snd_sof_utils          16384  1 snd_sof
snd_pci_ps             28672  0
mousedev               24576  0
snd_amd_sdw_acpi       16384  2 snd_sof_amd_acp,snd_pci_ps
soundwire_amd          45056  2 snd_sof_amd_acp,snd_pci_ps
soundwire_generic_allocation    12288  1 soundwire_amd
soundwire_bus         147456  2 soundwire_generic_allocation,soundwire_amd
snd_soc_core          462848  5 snd_soc_acp6x_mach,snd_sof,snd_acp6x_pdm_dma,soundwire_amd,snd_soc_dmic
snd_hda_codec_realtek   221184  1
qrtr                   57344  5 qrtr_mhi
snd_compress           32768  1 snd_soc_core
ac97_bus               12288  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_hda_codec_generic   114688  1 snd_hda_codec_realtek
intel_rapl_msr         20480  0
hid_multitouch         36864  0
amdxcp                 12288  1 amdgpu
hid_generic            12288  0
snd_hda_codec_hdmi     98304  1
snd_hda_scodec_component    20480  1 snd_hda_codec_realtek
drm_exec               12288  1 amdgpu
ath11k_pci             24576  0
snd_rpl_pci_acp6x      16384  0
gpu_sched              65536  1 amdgpu
btusb                  81920  0
r8169                 131072  0
snd_acp_pci            12288  0
ath11k                573440  1 ath11k_pci
btrtl                  36864  1 btusb
drm_buddy              28672  1 amdgpu
snd_acp_legacy_common    16384  1 snd_acp_pci
drm_suballoc_helper    12288  1 amdgpu
btintel                69632  1 btusb
snd_hda_intel          69632  10
think_lmi              36864  0
drm_ttm_helper         16384  2 amdgpu
uvcvideo              192512  2
btbcm                  24576  1 btusb
snd_intel_dspcfg       40960  2 snd_hda_intel,snd_sof
ttm                   106496  2 amdgpu,drm_ttm_helper
videobuf2_vmalloc      20480  1 uvcvideo
firmware_attributes_class    12288  1 think_lmi
edac_mce_amd           40960  0
snd_ctl_led            28672  0
snd_intel_sdw_acpi     16384  1 snd_intel_dspcfg
realtek                45056  1
snd_pci_acp6x          20480  0
wmi_bmof               12288  0
btmtk                  36864  1 btusb
edac_core             114688  0
uvc                    12288  1 uvcvideo
spd5118                12288  0
snd_hda_codec         221184  4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
snd_pci_acp5x          20480  0
mac80211             1654784  1 ath11k
mdio_devres            12288  1 r8169
videobuf2_memops       16384  1 videobuf2_vmalloc
of_mdio                24576  1 mdio_devres
drm_display_helper    290816  1 amdgpu
videobuf2_v4l2         40960  1 uvcvideo
snd_rn_pci_acp3x       24576  0
thinkpad_acpi         196608  0
bluetooth            1093632  6 btrtl,btmtk,btintel,btbcm,btusb
snd_hda_core          147456  5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
amd_atl                57344  1
videobuf2_common       98304  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
snd_hwdep              20480  1 snd_hda_codec
snd_acp_config         24576  10 snd_rn_pci_acp3x,snd_sof_amd_acp70,snd_pci_acp6x,snd_pci_acp5x,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_acp_pci,snd_pci_ps,snd_sof_amd_renoir
intel_rapl_common      53248  1 intel_rapl_msr
nvram                  16384  1 thinkpad_acpi
cec                    81920  1 drm_display_helper
fixed_phy              16384  1 of_mdio
ucsi_acpi              12288  0
snd_pcm               192512  14 snd_sof_amd_acp,snd_hda_codec_hdmi,snd_pci_acp6x,snd_hda_intel,snd_hda_codec,snd_sof,snd_acp6x_pdm_dma,snd_compress,snd_soc_core,snd_sof_utils,soundwire_amd,snd_hda_core,snd_pci_ps,snd_pcm_dmaengine
snd_soc_acpi           16384  3 snd_sof_amd_acp,snd_acp_config,snd_pci_ps
crct10dif_pclmul       12288  1
fwnode_mdio            16384  1 of_mdio
videodev              397312  2 videobuf2_v4l2,uvcvideo
crc32_pclmul           12288  0
platform_profile       12288  1 thinkpad_acpi
i2c_algo_bit           24576  1 amdgpu
typec_ucsi             77824  1 ucsi_acpi
sparse_keymap          12288  1 thinkpad_acpi
snd_timer              53248  1 snd_pcm
polyval_clmulni        12288  0
polyval_generic        12288  1 polyval_clmulni
snd                   155648  41 snd_ctl_led,snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_sof,snd_timer,snd_compress,thinkpad_acpi,snd_soc_core,snd_pcm
ghash_clmulni_intel    16384  0
ecdh_generic           16384  1 bluetooth
mc                     90112  6 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common
ecc                    49152  1 ecdh_generic
rapl                   20480  0
psmouse               229376  0
onboard_usb_dev        24576  0
roles                  16384  1 typec_ucsi
tpm_crb                28672  0
i2c_hid_acpi           12288  0
libphy                237568  6 r8169,mdio_devres,fwnode_mdio,of_mdio,realtek,fixed_phy
soundcore              16384  2 snd_ctl_led,snd
snd_pci_acp3x          20480  0
crc16                  12288  2 bluetooth,amdgpu
battery                28672  1 thinkpad_acpi
ac                     16384  0
rtc_cmos               28672  1
video                  81920  2 thinkpad_acpi,amdgpu
i2c_hid                45056  1 i2c_hid_acpi
typec                 118784  1 typec_ucsi
cfg80211             1413120  2 ath11k,mac80211
hid                   270336  3 i2c_hid,hid_multitouch,hid_generic
tpm_tis                16384  0
tpm_tis_core           36864  1 tpm_tis
thermal                28672  0
evdev                  28672  16
sp5100_tco             20480  0
mac_hid                12288  0
rfkill                 40960  6 bluetooth,thinkpad_acpi,cfg80211
watchdog               49152  1 sp5100_tco
tiny_power_button      12288  0
qmi_helpers            40960  1 ath11k
mhi                   155648  2 ath11k_pci,qrtr_mhi
wmi                    28672  3 video,wmi_bmof,think_lmi
fan                    28672  0
libarc4                12288  1 mac80211
i2c_piix4              36864  0
acpi_tad               20480  0
amd_pmc                61440  0
k10temp                16384  0
xt_conntrack           12288  2
i2c_smbus              20480  1 i2c_piix4
button                 24576  0
serio_raw              20480  0
nf_conntrack          200704  1 xt_conntrack
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         12288  1 nf_conntrack
ip6t_rpfilter          12288  1
ipt_rpfilter           12288  1
xt_pkttype             12288  2
xt_LOG                 16384  2
nf_log_syslog          24576  2
xt_tcpudp              16384  3
nft_compat             24576  11
x_tables               53248  7 xt_conntrack,ip6t_rpfilter,nft_compat,xt_LOG,xt_tcpudp,ipt_rpfilter,xt_pkttype
nf_tables             393216  101 nft_compat
libcrc32c              12288  2 nf_conntrack,nf_tables
crc32c_generic         12288  0
sch_fq_codel           20480  2
loop                   45056  0
kvm_amd               249856  0
ccp                   180224  1 kvm_amd
kvm                  1372160  1 kvm_amd
irqbypass              12288  1 kvm
fuse                  229376  3
configfs               69632  1
efi_pstore             12288  0
nfnetlink              20480  3 nft_compat,nf_tables
efivarfs               32768  1
dmi_sysfs              28672  0
autofs4                65536  0
dm_crypt               73728  1
cbc                    12288  0
encrypted_keys         28672  1 dm_crypt
trusted                49152  2 encrypted_keys,dm_crypt
asn1_encoder           12288  1 trusted
tee                    49152  1 trusted
tpm                   122880  4 tpm_tis,trusted,tpm_crb,tpm_tis_core
rng_core               20480  2 ccp,tpm
crc32c_intel           16384  1
input_leds             12288  0
sha512_ssse3           53248  0
led_class              20480  6 r8169,snd_hda_codec_generic,videodev,input_leds,libphy,thinkpad_acpi
sha256_ssse3           36864  1
sha1_ssse3             32768  0
aesni_intel           122880  6
atkbd                  40960  0
gf128mul               16384  2 polyval_generic,aesni_intel
libps2                 20480  2 atkbd,psmouse
vivaldi_fmap           12288  1 atkbd
crypto_simd            16384  1 aesni_intel
xhci_pci               24576  0
i8042                  57344  0
nvme                   69632  2
cryptd                 28672  3 crypto_simd,ghash_clmulni_intel
thunderbolt           585728  0
serio                  28672  7 amd_pmc,serio_raw,atkbd,psmouse,i8042
xhci_hcd              397312  1 xhci_pci
nvme_core             253952  3 nvme
nvme_auth              24576  1 nvme_core
zfs                  6631424  15
spl                   155648  1 zfs
dm_snapshot            73728  0
dm_bufio               57344  1 dm_snapshot
dm_mod                221184  12 dm_crypt,dm_snapshot,dm_bufio
dax                    53248  1 dm_mod

hardware-configuration.nix:

{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" ];
  boot.initrd.kernelModules = [ "dm-snapshot" ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];

# [A lot of ZFS and filesystem stuff]

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

configuration.nix (I anynomized stuff, removed comments and restructured to make it more readable):

{ config, lib, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      <nixpkgs/nixos/modules/profiles/base.nix> #For testing as it is included in the live ISO
    ];

  # My current testing
  hardware.enableAllHardware = true;
  services.xserver.enable = true;
  environment.sessionVariables.NIXOS_OZONE_WL = "1";
  services.desktopManager.plasma6.enable = true;
  services.xserver.videoDrivers = [ "modesetting" ];
  services.xserver.displayManager.lightdm.enable = true;
  hardware.graphics.enable=true;
  hardware.firmware = [ pkgs.linux-firmware ];
  hardware.enableRedistributableFirmware = true;

  # keyboard layout and timezone
  i18n.defaultLocale = #[...];
  console = {
    #[...]
  };
  time.timeZone = #[...];
  services.xserver.xkb.layout =  #[...];
  services.xserver.xkb.options = "";

  #Some basic programs I kept to be at least able to debug properly
  environment.systemPackages = with pkgs; [
    librewolf
    qalculate-gtk
    mesa-demos vulkan-tools
     inetutils #e.g. telnet
    git
    htop
    wget
    curl
    screen
    iftop
    iotop
    vim
    unzip
    whois
    nmap
    traceroute
    fdupes
    file
    dnsutils
    python3
    usbutils
    lsof
    smartmontools
 ];

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  boot.initrd.luks.devices.[...] = {
        device = "...";
        preLVM = true;
  };

  boot.loader.systemd-boot.configurationLimit = 5;
  boot.loader.generationsDir.copyKernels = true;
  boot.kernelPackages = pkgs.linuxPackages_6_12;
  boot.supportedFilesystems = [ "zfs" ];
  boot.initrd.supportedFilesystems = [ "zfs" ];
  boot.zfs.forceImportAll = false;

  networking.hostName = "...";
  networking.hostId = "...";

  networking.networkmanager.enable = true;
  programs.nm-applet.enable = true;

  users.users.myuser1 = {
     isNormalUser = true;
     extraGroups = [ "networkmanager" "wheel" "sudo" "adbusers" "wireshark" ];
  };
  users.users.myuser2 = {
     isNormalUser = true;
     extraGroups = [ "networkmanager" "wheel" "sudo" ];
  };

  system.stateVersion = "24.05"; # Did you read the comment?
}

Any ideas? Thanks already!
Thomas

(@vcunat I reverted your edit: The ISO works, my system doesn’t work and I don’t know why. Sorry if I didn’t communicate that clearly)

can you post the output of sudo dmesg | grep amdgpu?

I’d also try deleting this:

  services.xserver.videoDrivers = [ "modesetting" ];

Thanks! I will reboot and try without modesetting. Before quickly the requested logs:

[   11.305155] [drm] amdgpu kernel modesetting enabled.
[   11.408054] amdgpu: Virtual CRAT table created for CPU
[   11.408099] amdgpu: Topology: Add CPU node
[   11.408356] amdgpu 0000:74:00.0: enabling device (0006 -> 0007)
[   11.429681] amdgpu 0000:74:00.0: amdgpu: Fetched VBIOS from VFCT
[   11.429686] amdgpu: ATOM BIOS: 113-REMBRANDT-X37
[   11.478146] amdgpu 0000:74:00.0: vgaarb: deactivate vga console
[   11.478153] amdgpu 0000:74:00.0: amdgpu: Trusted Memory Zone (TMZ) feature disabled as experimental (default)
[   11.478241] amdgpu 0000:74:00.0: amdgpu: VRAM: 1024M 0x000000F400000000 - 0x000000F43FFFFFFF (1024M used)
[   11.478244] amdgpu 0000:74:00.0: amdgpu: GART: 1024M 0x0000000000000000 - 0x000000003FFFFFFF
[   11.478449] [drm] amdgpu: 1024M of VRAM memory ready
[   11.478453] [drm] amdgpu: 7371M of GTT memory ready.
[   11.504788] amdgpu 0000:74:00.0: amdgpu: reserve 0xa00000 from 0xf43e000000 for PSP TMR
[   11.670045] amdgpu 0000:74:00.0: amdgpu: RAS: optional ras ta ucode is not available
[   11.682827] amdgpu 0000:74:00.0: amdgpu: RAP: optional rap ta ucode is not available
[   11.682835] amdgpu 0000:74:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available
[   11.684520] amdgpu 0000:74:00.0: amdgpu: SMU is initialized successfully!
[   11.689346] snd_hda_intel 0000:74:00.1: bound 0000:74:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
[   11.850342] kfd kfd: amdgpu: Allocated 3969056 bytes on gart
[   11.850359] kfd kfd: amdgpu: Total number of KFD nodes to be created: 1
[   11.850589] amdgpu: Virtual CRAT table created for GPU
[   11.851238] amdgpu: Topology: Add dGPU node [0x1681:0x1002]
[   11.851241] kfd kfd: amdgpu: added device 1002:1681
[   11.851251] amdgpu 0000:74:00.0: amdgpu: SE 1, SH per SE 2, CU per SH 6, active_cu_number 6
[   11.851256] amdgpu 0000:74:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[   11.851258] amdgpu 0000:74:00.0: amdgpu: ring gfx_0.1.0 uses VM inv eng 1 on hub 0
[   11.851259] amdgpu 0000:74:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 4 on hub 0
[   11.851261] amdgpu 0000:74:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 5 on hub 0
[   11.851262] amdgpu 0000:74:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[   11.851264] amdgpu 0000:74:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[   11.851265] amdgpu 0000:74:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[   11.851267] amdgpu 0000:74:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[   11.851268] amdgpu 0000:74:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[   11.851270] amdgpu 0000:74:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[   11.851271] amdgpu 0000:74:00.0: amdgpu: ring kiq_0.2.1.0 uses VM inv eng 12 on hub 0
[   11.851272] amdgpu 0000:74:00.0: amdgpu: ring sdma0 uses VM inv eng 13 on hub 0
[   11.851274] amdgpu 0000:74:00.0: amdgpu: ring vcn_dec_0 uses VM inv eng 0 on hub 8
[   11.851275] amdgpu 0000:74:00.0: amdgpu: ring vcn_enc_0.0 uses VM inv eng 1 on hub 8
[   11.851277] amdgpu 0000:74:00.0: amdgpu: ring vcn_enc_0.1 uses VM inv eng 4 on hub 8
[   11.851278] amdgpu 0000:74:00.0: amdgpu: ring jpeg_dec uses VM inv eng 5 on hub 8
[   11.856502] amdgpu 0000:74:00.0: amdgpu: Runtime PM not available
[   11.862163] [drm] Initialized amdgpu 3.61.0 for 0000:74:00.0 on minor 1
[   11.869855] fbcon: amdgpudrmfb (fb0) is primary device
[   11.906559] amdgpu 0000:74:00.0: [drm] fb0: amdgpudrmfb frame buffer device
[ 8494.174266] amdgpu 0000:74:00.0: amdgpu: SMU is resuming...
[ 8494.176596] amdgpu 0000:74:00.0: amdgpu: SMU is resumed successfully!
[ 8494.294991] amdgpu 0000:74:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[ 8494.295000] amdgpu 0000:74:00.0: amdgpu: ring gfx_0.1.0 uses VM inv eng 1 on hub 0
[ 8494.295003] amdgpu 0000:74:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 4 on hub 0
[ 8494.295006] amdgpu 0000:74:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 5 on hub 0
[ 8494.295009] amdgpu 0000:74:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[ 8494.295011] amdgpu 0000:74:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[ 8494.295013] amdgpu 0000:74:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[ 8494.295016] amdgpu 0000:74:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[ 8494.295018] amdgpu 0000:74:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[ 8494.295021] amdgpu 0000:74:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[ 8494.295023] amdgpu 0000:74:00.0: amdgpu: ring kiq_0.2.1.0 uses VM inv eng 12 on hub 0
[ 8494.295026] amdgpu 0000:74:00.0: amdgpu: ring sdma0 uses VM inv eng 13 on hub 0
[ 8494.295028] amdgpu 0000:74:00.0: amdgpu: ring vcn_dec_0 uses VM inv eng 0 on hub 8
[ 8494.295031] amdgpu 0000:74:00.0: amdgpu: ring vcn_enc_0.0 uses VM inv eng 1 on hub 8
[ 8494.295033] amdgpu 0000:74:00.0: amdgpu: ring vcn_enc_0.1 uses VM inv eng 4 on hub 8
[ 8494.295036] amdgpu 0000:74:00.0: amdgpu: ring jpeg_dec uses VM inv eng 5 on hub 8

Sorry, no progress :frowning:

Oh, I thought it’s about acceleration when running from the ISO itself. It confused me that you include the ISO profile in your non-ISO config, but I see nothing risky in this base.nix.

Anyway, the non-existence of /run/opengl-driver/ sounds likely a key part. I don’t think you can get a proper OpenGL by default without it in default nixpkgs.

But I don’t get why. You have explicit hardware.graphics.enable=true, so it should be there. I see that nowadays that symlink is setup by a systemd tmpfiles rule, but no idea where this goes wrong in your case.

I wouldn’t look at kernel stuff yet, as the symlink should point to mesa files regardless of that.