nix-community / nixGL

A wrapper tool for nix OpenGL application [maintainer=@guibou]
681 stars 78 forks source link

nixGL with AMD hardware: my hardware info #5

Closed cx405 closed 6 years ago

cx405 commented 6 years ago

My environment (updated):

system: "x86_64-linux",  
multi-user?: yes,  
version: nix-env (Nix) 2.0,  
channels(root): "nixos-18.03pre131327.0e7c9b32817",  
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs

My hardware:

./inxi -Fx
Resuming in non X mode: xdpyinfo not found. For package install advice run: inxi --recommends
System:    Host: nix01 Kernel: 4.9.86 x86_64 bits: 64 gcc: 7.3.0 Desktop: KDE Plasma 5.10.5 (Qt 5.9.1)
           Distro: NixOS 17.09.3159.c665fcca9e7 (Hummingbird)
Machine:   Device: desktop Mobo: Intel model: DH67CL v: AAG10212-208 serial: N/A
           BIOS: Intel v: BLH6710H.86A.0160.2012.1204.1156 date: 12/04/2012
CPU:       Quad core Intel Core i5-2500 (-MCP-) arch: Sandy Bridge rev.7 cache: 6144 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 26340
           clock speeds: max: 3700 MHz 1: 1888 MHz 2: 1900 MHz 3: 1940 MHz 4: 1984 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Tahiti PRO [Radeon HD 7950/8950 OEM / R9 280] bus-ID: 01:00.0
           Display Server: x11 (X.org 1.19.5 ) driver: radeon tty size: 129x53
Audio:     Card-1 Advanced Micro Devices [AMD/ATI] Tahiti HDMI Audio [Radeon HD 7870 XT / 7950/7970]
           driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Intel 6 Series/C200 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-3 Creative Labs EMU10k1 [Sound Blaster Live! Series]
           driver: snd_emu10k1 port: d000 bus-ID: 03:02.0
           Sound: Advanced Linux Sound Architecture v: k4.9.86
Network:   Card: Intel 82579V Gigabit Network Connection driver: e1000e v: 3.2.6-k port: f040 bus-ID: 00:19.0
           IF: eno1 state: up speed: 100 Mbps duplex: half mac: 38:60:77:9c:26:73
Drives:    HDD Total Size: 1500.3GB (22.7% used)
           ID-1: /dev/sda model: WDC_WD5000AAKS size: 500.1GB
           ID-2: /dev/sdb model: ST1000DM010 size: 1000.2GB
Partition: ID-1: / size: 67G used: 12G (18%) fs: ext4 dev: /dev/sdb2
           ID-2: swap-1 size: 17.18GB used: 0.00GB (0%) fs: swap dev: /dev/sdb1
Sensors:   None detected - is lm-sensors installed and configured?
Info:      Processes: 161 Uptime: 6:07 Memory: 1357.4/16031.1MB Init: systemd Gcc sys: N/A
           Client: Shell (bash 4.4.121) inxi: 2.3.56 

glxinfo (without extensions):

name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
...
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
...
GLX version: 1.4
GLX extensions:
...
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD TAHITI (DRM 2.49.0 / 4.9.86, LLVM 4.0.1) (0x679a)
    Version: 17.1.8
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TAHITI (DRM 2.49.0 / 4.9.86, LLVM 4.0.1)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.1.8
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
...
OpenGL version string: 3.0 Mesa 17.1.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
...
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.1.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
...
480 GLX Visuals

dmesg|grep -i radeon:

[   29.217365] [drm] radeon kernel modesetting enabled.
[   29.294661] radeon 0000:01:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
[   29.294878] radeon 0000:01:00.0: VRAM: 3072M 0x0000000000000000 - 0x00000000BFFFFFFF (3072M used)
[   29.294879] radeon 0000:01:00.0: GTT: 2048M 0x00000000C0000000 - 0x000000013FFFFFFF
[   29.294935] [drm] radeon: 3072M of VRAM memory ready
[   29.294935] [drm] radeon: 2048M of GTT memory ready.
[   29.571904] [drm] radeon: dpm initialized
[   29.610001] radeon 0000:01:00.0: WB enabled
[   29.610003] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x00000000c0000c00 and cpu addr 0xffff8b6e133a2c00
[   29.610004] radeon 0000:01:00.0: fence driver on ring 1 use gpu addr 0x00000000c0000c04 and cpu addr 0xffff8b6e133a2c04
[   29.610005] radeon 0000:01:00.0: fence driver on ring 2 use gpu addr 0x00000000c0000c08 and cpu addr 0xffff8b6e133a2c08
[   29.610006] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x00000000c0000c0c and cpu addr 0xffff8b6e133a2c0c
[   29.610007] radeon 0000:01:00.0: fence driver on ring 4 use gpu addr 0x00000000c0000c10 and cpu addr 0xffff8b6e133a2c10
[   29.610217] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000075a18 and cpu addr 0xffffa0e542a35a18
[   29.630324] radeon 0000:01:00.0: fence driver on ring 6 use gpu addr 0x00000000c0000c18 and cpu addr 0xffff8b6e133a2c18
[   29.630325] radeon 0000:01:00.0: fence driver on ring 7 use gpu addr 0x00000000c0000c1c and cpu addr 0xffff8b6e133a2c1c
[   29.630354] radeon 0000:01:00.0: radeon: MSI limited to 32-bit
[   29.630386] radeon 0000:01:00.0: radeon: using MSI.
[   29.630404] [drm] radeon: irq initialized.
[   31.766872] [drm] Radeon Display Connectors
[   31.861706] fbcon: radeondrmfb (fb0) is primary device
[   31.879016] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
[   31.888557] [drm] Initialized radeon 2.49.0 20080528 for 0000:01:00.0 on minor 0

The link to card.

cx405 commented 6 years ago

Erm, @guibou ? :)

guibou commented 6 years ago

Thank you for the repport (Sorry for the delay, you know, life, bla bla bla ;)

I'll have a look tomorrow. I don't have this hardware, so I'll do a branch with guess work and ask for your tests. Thank you.

cx405 commented 6 years ago

@guibou Hello, thank you very very much for giving the status update. Ofc, life.so is max priority, no questions. :)

Small status update: I have upgraded to 18.03 properly (through bricking, having nice guidance and then reinstalling), so I will update the issue above with newer cfg and then hibernate to life.so until I could be of assistance to you. :) :)
Until then!

guibou commented 6 years ago

I wonder something stupid. It seems that you are using the mesa driver? Did you tried nixGLIntel which uses the mesa driver and may in fact works for your ati?

guibou commented 6 years ago

If I'm wrong and you are using the proprietary driver, have a look at PR #6.

cx405 commented 6 years ago

Well, this is correct, if you mean the "radeon"(d1) driver, which uses mesa opengl library.
There is also "amdgpu"(d2) driver which also uses opengl library, and new "amdgpu-pro"(d3) driver that uses amd's own proprietary opengl library. The (d3) uses the same kernel driver as fully open (d2). If you don't count firmware, which all (d1,d2,d3) use.

I am willing to test any driver which can run on my card, however, to improve experience of nixos users. Open or not.

Now as to why I have found my way to nixGL - encountered #9415 *: I am (still) a rookie/newbie in nixos and first thing I discovered is that:
1) Openarena
2) Urban Terror

games do not work properly.

They are both idtech-based, however (1) uses ioquake engine and (2) uses original idtech engine. The symptoms are similar:
1) starts in a window and immediately sets the screen into 1024x768 resolution (I have a 1920 24" monitor via hdmi here). The screen image does not seem to change at all.
After a minute the screen turns off and I can't even switch to tty (ctrl+f1) - however, I can blindly switch, blindly login and blindly reboot (init 6).
2) looks like it immediately starts in full screen and screen goes immediatly black with same symptoms.

Shared 1+2: if I reboot, the screen is ok until I login into kde (plasma5). The sddm(login manager) is ok, but after I put my credentials and hit enter - screen turns black and stays so even if I switch to tty. It could be said 1+2 brick kde resolution settings too.

I have written a script, that allows me to switch into tty after reboot, log in tty and clean the plasma5 kscreen configuration file. After that, screen is back to normal in plasma5.

Here it is: https://gist.github.com/cx405/701f3f36afe428fcf2cf8b235667ddc7

*| https://github.com/NixOS/nixpkgs/issues/9415

abbradar commented 6 years ago

@cx405 Do I get it correctly that you use NixOS (not e.g. Nix on Ubuntu)? Because if you do nixGL shouldn't be applicable for you -- you should set your drivers in services.xserver.videoDrivers and it should Just Work. Given, last time I heard situation with closed-source AMD drivers on NixOS is dire (maybe situation has improved since) -- having somebody to at least test and report stuff would certainly be helpful.

cx405 commented 6 years ago

@abbradar Yes, this is correct. I have this driver set. More precisely, I have this:

services.kmscon.hwRender = true;  
services.xserver.videoDrivers = [ "radeon" ];   
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 ];
..
users.extraUsers.userp.extraGroups = 
[ "audio" "disk" "video" "wheel" "networkmanager" "systemd-journal" ];

...and I have the problems above :)

abbradar commented 6 years ago

@cx405 Hm, it seems that this problem is not because your video drivers cannot be found but because something is broken in video drivers.

  1. Have you tried using amdgpu (replace radeon with amdgpu in videoDrivers)? If not, try this and post your new glxinfo results and check the games.
  2. Do glxgears work?

Also we should probably move away from this issue into a separate one in nixpkgs. Can you create one?

cx405 commented 6 years ago

@abbradar 1. thanks for suggesting, I will try this today and report in 24hours. 2. yes, glxgears works. The openarena issue I posted, is the issue in my case. I though that this is the project to solve it.

Well, I have ubuntu, debian, arch and gentoo experience. I am pretty sure that I can find time to throw latest of ubuntu on spare hard drive, install nix and help you out with the tests.

cx405 commented 6 years ago

@abbradar Sorry for the delay, it was something different! I have asked numerous people on #nixos IRC, nobody had a clue and researched web with no results. The solution is weird, one needs "ati" into

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

this "ati" is not an old driver, but xorg DDE driver (xf86-video-ati). Also weird that Xorg could boot without it and used "radeon" driver normally after failing to find it.


Well, I still have hardware and willing to contribute to nixGL, once you guys tell me which OS+driver combo I should install and the task to do, that is.

abbradar commented 6 years ago

@cx405 Ouch, turns out there is no "radeon" videoDrivers entry at all! We have an old bug which is difficult to fix that allows one to specify a non-existent driver which is then silently ignored.

cx405 commented 6 years ago

@abbradar Fair enough. However people would add less entries to that section, if it would be documented in the Nix wiki (or anywhere). Also wiki is not listed in https://nixos.org/nixos/support.html. At least a reference would be nice. :/

abbradar commented 6 years ago

@cx405 Good call, can you open an issue for those?

cx405 commented 6 years ago

@abbradar Sure, I am on it :)

xCuri0 commented 6 years ago

NixGL Intel works perfectly for me with AMD

guibou commented 6 years ago

@xCuri0 Thank you, I suppose you use the open source AMD driver which comes with MESA. I updated a bit the README to explain that nixGLIntel works for most mesa drivers.

guibou commented 6 years ago

I'm closing this bug as it appears that the problem you have is more related to the support of AMD by NixOS rather of the support of AMD by nixGL outside ouf NixOS.

Please, if you try your card outside of NixOS, have a look at pull request #6 to test the AMD support.

xCuri0 commented 6 years ago

@guibou Yes I am using the Mess drivers since my GPU doesn't support AMDGPU-PRO and fglrx is no longer supported (it was filled with bugs anyways).

Someone needs to test with AMDGPU-PRO too