Le jeudi 21 septembre 2023 à 18:13 +1000, Jonathan Gray a écrit :
> On Thu, Sep 21, 2023 at 09:55:44AM +0200, Solène Rapenne wrote:
> > Le jeudi 21 septembre 2023 à 17:50 +1000, Jonathan Gray a écrit :
> > > On Thu, Sep 21, 2023 at 09:05:50AM +0200, Solène Rapenne wrote:
> > > > > Synopsis:       my GPU AMD Sapphire RX 6600 isn't recognized
> > > > > Category:       kernel
> > > > > Environment:
> > > >         System      : OpenBSD 7.4
> > > >         Details     : OpenBSD 7.4-beta (GENERIC.MP) #1372: Wed
> > > > Sep
> > > > 20 09:43:54 MDT 2023
> > > >                         
> > > > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENER
> > > > IC.MP
> > > > 
> > > >         Architecture: OpenBSD.amd64
> > > >         Machine     : amd64
> > > > > Description:
> > > >         I can't get accelerated graphics with a Sapphire RX
> > > > 6600.
> > > >         The amdgpu firmware is correctly installed after
> > > > running
> > > > fw_update
> > > 
> > > > [drm] *ERROR* visible_vram_size 1ff000000 or aper_base_kaddr
> > > > 0x0 is
> > > > not initialized.
> > > > [drm] *ERROR* Failed to process memory training!
> > > > [drm] *ERROR* sw_init of IP block <psp> failed -22
> > > > drm:pid0:amdgpu_device_init *ERROR* amdgpu_device_ip_init
> > > > failed
> > > > drm:pid0:amdgpu_attachhook *ERROR* Fatal error during GPU init
> > > > efifb0 at mainbus0: 1920x1080, 32bpp
> > > 
> > > Does the bios have an option to disable resizable pci bar?
> > > 
> > > Doing an install with csm enabled (vga instead of efifb)
> > > may also change things.
> > 
> > I have resizable pci bar enabled, I'll try to disable it.
> 
> There are also variables to limit the size of the window and the
> total,
> which correspond to module parameters on linux.
> 
> amdgpu_vis_vram_limit
> 
> amdgpu_vram_limit
> 
> documented in
> sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c
> 
> Perhaps this (untested) diff to limit to 512M would help.
> 
> Index: sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 amdgpu_ttm.c
> --- sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c     13 Aug 2023 10:36:26
> -0000      1.14
> +++ sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c     21 Sep 2023 08:05:19
> -0000
> @@ -1792,6 +1792,7 @@ int amdgpu_ttm_init(struct amdgpu_device
>         }
>  
>         /* Reduce size of CPU-visible VRAM if requested */
> +amdgpu_vis_vram_limit = 512;
>         vis_vram_limit = (u64)amdgpu_vis_vram_limit * 1024 * 1024;
>         if (amdgpu_vis_vram_limit > 0 &&
>             vis_vram_limit <= adev->gmc.visible_vram_size)

with this change, the card is recognized correctly without having to
disable pci bar in the bios

Reply via email to