Framework 16 LUKS Password Monitor Selection

Hi all!

I recently installed Manjaro Linux with full disk encryption using LUKS. I generally leave my laptop hooked up to external monitors with the lid closed, and everything has been working great. However, when I reboot, I need to be able to enter the LUKS password. This only shows up on the integrated monitor, so I have to open it up to get past this. Not a huge deal, but it would be nice if I could configure initial output to go to all screens, not just the integrated monitor. Similarly, it would be great if I could get into the UEFI via the external monitor as well, just for ease of use when needed.

Is there some way I can configure that? My google-fu hasn’t come up with anything. My external setup is via USB-C to a dock that has two HDMI ports (one going to each of a KVM, and ultimately to two monitors). I have tried plugging the USB-C both into the dedicated dGPU port as well as one of the rear-most USB-C ports on the side (in hopes it was a dGPU/iGPU issue). Any pointers or thoughts on how to configure it would be greatly appreciated!

1 Like

Linux monitor output is generally driven by the “amdgpu” driver (except early in the boot process when it uses the provided UEFI frame buffer). I recommend adding “amdgpu” to the “MODULES” section of “mkinitcpio.conf” because that will ensure that it gets loaded before the LUKS encryption items go off. You might also need to research the “amdgpu” kernel driver options to determine the right sequence of kernel parameters. I also add “tpm_crb” to the modules list because my LUKS scheme depends on TPM2 shenanigans for a more “Bitlocker” like experience.

As far as I know, there’s no way to change the UEFI frame buffer output destination. Changing it would likely require a Frameworks sponsored engineering project to implement.

Hmm, no joy. Before any update, my MODULES were:

MODULES=""

After:

MODULES=(amdgpu radeon)

I then ran

sudo mkinitcpio -P && sudo grub-mkconfig -o /boot/grub/grub.cfg 

(on the plus side, this actually picked up my new 6.8 kernel that somehow didn’t get loaded when I installed it the other day).

But in any case, no change in behavior. I did try moving from the GPU’s dedicated port to one of the standard ports. No change (in both cases, when it is connected to the dedicated port, I don’t get any output to the monitors until I log in, but when I connect to the standard port, I get output after I get past LUKS).

I thought about doing a TPM2 setup, but I personally prefer requiring a password be entered in order to decrypt. I haven’t gone through a Secure Boot setup yet, and it probably doesn’t make much sense until then.

If there is a USB-C dock involved, there are probably some other kernel modules that need to be preloaded with “amdgpu”. You might be able to use “lsmod” while the system is running from the dock to figure out what module is missing.

Hmm, actually I seem to be getting a stack trace in my dmesg during boot. It appears to be associated with the 7700S

$ lspci | grep VGA
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 33 [Radeon RX 7700S/7600/7600S/7600M XT/PRO W7600] (rev c1)
c4:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 (rev c1)

From dmesg:

...
[    2.183901] amdgpu 0000:03:00.0: [drm] Unsupported pwrseq engine id: 2!
[    2.183909] ------------[ cut here ]------------
[    2.183910] WARNING: CPU: 11 PID: 192 at drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_panel_cntl.c:172 dcn31_panel_cntl_construct+0x49/0x60 [amdgpu]
[    2.184132] Modules linked in: amdgpu(+) amdxcp drm_exec gpu_sched drm_buddy drm_ttm_helper ttm video wmi i2c_algo_bit drm_suballoc_helper drm_display_helper cec usbhid
[    2.184142] CPU: 11 PID: 192 Comm: modprobe Not tainted 6.8.5-1-MANJARO #1 1ce495db2fdecc34943a97e7c09301e836b40d86
[    2.184145] Hardware name: Framework Laptop 16 (AMD Ryzen 7040 Series)/FRANMZCP09, BIOS 03.02 01/23/2024
[    2.184146] RIP: 0010:dcn31_panel_cntl_construct+0x49/0x60 [amdgpu]
[    2.184330] Code: 57 10 8b 56 0c 85 d2 74 28 83 fa 01 74 23 48 8b 40 10 48 8b 38 48 85 ff 74 04 48 8b 7f 08 48 c7 c6 d8 f1 f4 c0 e8 77 42 5b cc <0f> 0b ba 0f 00 00 00 89 53 14 5b e9 d2 fd b6 cc 0f 1f 80 00 00 00
[    2.184331] RSP: 0018:ffff95e88424f340 EFLAGS: 00010246
[    2.184333] RAX: 0000000000000000 RBX: ffff8abad5617140 RCX: ffffffff8e4ca688
[    2.184334] RDX: 0000000000000000 RSI: 00000000ffffefff RDI: 0000000000000001
[    2.184335] RBP: ffff95e88424f380 R08: 0000000000000000 R09: ffff95e88424f108
[    2.184336] R10: ffff95e88424f100 R11: 0000000000000003 R12: ffff95e88424f3d4
[    2.184337] R13: ffffffffc0df92e0 R14: ffff95e88424f730 R15: ffff8abad56bd800
[    2.184338] FS:  000074d6fec93740(0000) GS:ffff8ac9220c0000(0000) knlGS:0000000000000000
[    2.184339] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.184340] CR2: 0000000000000000 CR3: 0000000104a7a000 CR4: 0000000000f50ef0
[    2.184341] PKRU: 55555554
[    2.184342] Call Trace:
[    2.184343]  <TASK>
[    2.184344]  ? dcn31_panel_cntl_construct+0x49/0x60 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.184512]  ? __warn+0x81/0x130
[    2.184516]  ? dcn31_panel_cntl_construct+0x49/0x60 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.184686]  ? report_bug+0x171/0x1a0
[    2.184691]  ? handle_bug+0x3c/0x80
[    2.184693]  ? exc_invalid_op+0x17/0x70
[    2.184694]  ? asm_exc_invalid_op+0x1a/0x20
[    2.184698]  ? dcn31_panel_cntl_construct+0x49/0x60 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.184867]  dcn32_panel_cntl_create+0x37/0x50 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.185052]  construct_phy+0xaca/0xd30 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.185246]  link_create+0x1b2/0x210 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.185421]  create_links+0x135/0x420 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.185603]  dc_create+0x318/0x650 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.185775]  amdgpu_dm_init.isra.0+0x2d5/0x2070 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.185961]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.185963]  ? prb_read_valid+0x1b/0x30
[    2.185966]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.185967]  ? console_unlock+0x78/0x120
[    2.185970]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.185971]  ? vprintk_emit+0x175/0x2b0
[    2.185973]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.185974]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.185976]  ? dev_printk_emit+0xa5/0xd0
[    2.185978]  ? asm_sysvec_apic_timer_interrupt+0x1a/0x20
[    2.185984]  dm_hw_init+0x12/0x30 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.186154]  amdgpu_device_init+0x1e50/0x2500 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.186294]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.186296]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.186299]  amdgpu_driver_load_kms+0x19/0x190 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.186438]  amdgpu_pci_probe+0x18b/0x510 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.186576]  local_pci_probe+0x42/0xa0
[    2.186579]  pci_device_probe+0xc1/0x260
[    2.186582]  ? sysfs_do_create_link_sd+0x6e/0xe0
[    2.186585]  really_probe+0x19b/0x3e0
[    2.186587]  ? __pfx___driver_attach+0x10/0x10
[    2.186589]  __driver_probe_device+0x78/0x160
[    2.186591]  driver_probe_device+0x1f/0x90
[    2.186592]  __driver_attach+0xd2/0x1c0
[    2.186594]  bus_for_each_dev+0x85/0xd0
[    2.186596]  bus_add_driver+0x116/0x220
[    2.186598]  driver_register+0x59/0x100
[    2.186600]  ? __pfx_amdgpu_init+0x10/0x10 [amdgpu 8f807b45e3fa69b3f417f6a6aa721b68612ce46a]
[    2.186737]  do_one_initcall+0x58/0x320
[    2.186741]  do_init_module+0x60/0x240
[    2.186744]  init_module_from_file+0x89/0xe0
[    2.186747]  idempotent_init_module+0x120/0x2b0
[    2.186750]  __x64_sys_finit_module+0x5e/0xb0
[    2.186752]  do_syscall_64+0x83/0x170
[    2.186754]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.186755]  ? do_syscall_64+0x90/0x170
[    2.186756]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.186758]  ? do_syscall_64+0x90/0x170
[    2.186759]  ? do_syscall_64+0x90/0x170
[    2.186760]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.186761]  ? do_syscall_64+0x90/0x170
[    2.186763]  ? do_syscall_64+0x90/0x170
[    2.186764]  ? srso_alias_return_thunk+0x5/0xfbef5
[    2.186765]  entry_SYSCALL_64_after_hwframe+0x78/0x80
[    2.186767] RIP: 0033:0x74d6feda288d
[    2.186770] Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 63 14 0d 00 f7 d8 64 89 01 48
[    2.186771] RSP: 002b:00007fffc834bb98 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[    2.186773] RAX: ffffffffffffffda RBX: 000064b6a0eb8ac0 RCX: 000074d6feda288d
[    2.186774] RDX: 0000000000000000 RSI: 000064b6a0ac048d RDI: 000000000000000f
[    2.186775] RBP: 000064b6a0ac048d R08: 0000000000000070 R09: ffffffffffffff88
[    2.186775] R10: 0000000000000050 R11: 0000000000000246 R12: 0000000000060000
[    2.186776] R13: 000064b6a0eb8b40 R14: 0000000000000000 R15: 000064b6a0ebbcf0
[    2.186779]  </TASK>
[    2.186780] ---[ end trace 0000000000000000 ]---
...

Eventually I do see it explicitly selecting the frame buffer that it implied was allocated to the iGPU:

$ sudo dmesg --color=always | grep -E '(fb0|fb1)'
[    0.003516] NODE_DATA(0) allocated [mem 0xf9e2fb000-0xf9e2fffff]
[    0.533856] simple-framebuffer simple-framebuffer.0: [drm] fb0: simpledrmdrmfb frame buffer device
[    5.158647] amdgpu 0000:03:00.0: [drm] fb0: amdgpudrmfb frame buffer device
[    5.762478] fbcon: amdgpudrmfb (fb1) is primary device
[    5.762483] amdgpu 0000:c4:00.0: [drm] fb1: amdgpudrmfb frame buffer device

Not sure if it indicates an issue, but at a minimum I think this is saying that it is selecting the iGPU framebuffer. When I plug my dock directly into the dGPU USB-C port, I only get output after login. If I plug it in to the back USB-C port, it shows up earlier (after GRUB, but before login).

Hmm, actually I seem to be getting a stack trace in my dmesg during boot. It appears to be associated with the 7700S

Known issue. The message does not seem to be impacting anything. See: Linux 6.8.1 boot time error with RX 7700S: amdgpu 0000:03:00.0: [drm] Unsupported pwrseq engine id: 2! (#3279) · Issues · drm / amd · GitLab

Not sure if it indicates an issue, but at a minimum I think this is saying that it is selecting the iGPU framebuffer. When I plug my dock directly into the dGPU USB-C port, I only get output after login. If I plug it in to the back USB-C port, it shows up earlier (after GRUB, but before login).

I am not certain how Linux selects the active frame buffer device. The documentation might offer more clues here.

AFAIK: Linux only supported hybrid display mode via the IGPU at this point. The hardware is capable of switching to DGPU exclusive mode but the Linux driver does not support that feature yet.