NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.04k forks source link

fullscreen opengl does not work, leads to hang #37673

Closed cx405 closed 6 years ago

cx405 commented 6 years ago

Issue description

Updated:

I am on nixos 18.03, but experienced it with 17.09 too.
Openarena and urbanterror install, but upon starting them - the screen blacks out and appears to hang. Switching to tty1 does not help, although I can blindly login, enter pass and initiate reboot. The bug also corrupts plasma5 logs (Kscreen), so I have to remove the settings file to be able to log back. After reboot, they leave no logs.

I tried "sleep 10 && openarena", while switching to tty - however they do not start until I switch back.
I have R9 280 gpu with radeon driver. glxgears works. glxinfo shows direct rendering and opengl 4.5 support. freeorion game works. Plasma5 opengl compositor works fine.

Update:
I have traced issue a bit further and apparently it happens the moment opengl application tries to grab fullscreen. I installed zandronum+doomseeker and was able to enter online game. Everything worked fine, until I entered Video options inside the game (the video modes were correctly listed) and switched Fullscreen to ON.
Difference here is that upon reboot, the plasma5 Kscreen applied correct resolution and deletion of the Kscreen configuration was not necessary to login.

Update 2: I set following: hardware.enableAllFirmware = true; hardware.cpu.amd.updateMicrocode = true; hardware.cpu.intel.updateMicrocode = true; boot.kernelPackages = pkgs.linuxPackages_latest;

"uname --all" says I am using 4.15 kernel. Yet nothing changed.

I also noticed that monitor reports very strange resolution: "866 x 961 x 60 hz" (its 1920x1080 monitor, that has hdmi connection).

Extract from configuration.nix:

nixpkgs.config.allowUnfree = true; 
services.kmscon.hwRender = true;
services.xserver.videoDrivers = [ "radeon" ];
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.support32Bit = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.s3tcSupport = true;
hardware.opengl.extraPackages = with pkgs; [ vaapiIntel vaapiVdpau libvdpau-va-gl ];
hardware.opengl.extraPackages32 = with pkgs; [ vaapiIntel vaapiVdpau libvdpau-va-gl ];

Steps to reproduce

have openarena or urbanterror(unfree) in configuration nix.
start any one.

Technical details

cx405 commented 6 years ago

Ok, I solved this! I tried everything, but then I was reading "journalctl", I noticed that Xorg complains that it can't find "ati" and "vesa" - although it then starts "radeon" normally.

I thought that "ati" was actually driver for old amd cards, so I was surprised that it is actually part of Xorg DDE driver (xf86-ati). So, when I added "ati" and "vesa":

services.xserver.videoDrivers = [ "radeon" "ati" "vesa" ];

after reboot the problem is gone!