OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:07 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Question about Intel and AMD GPU documentation
PostPosted: Tue May 11, 2021 12:32 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
So, I'm kinda confused about the Intel and AMD GPU documentation. For the Intel documentation over here, I notice that there's documentation for various architectures like Skylake, Ice Lake, and DG1, but for others like Coffee Lake there's only a volume about "Configurations". My question regarding those is: is there some kind of inheritance kind of thing going on, where for example Ice Lake is its own independent architecture but others like Whiskey Lake depend on something like Ice Lake?
For the amd documentation -- for up-to-date documentation anyway -- I was only able to find this. There is, of course, this page for general ISA documentation, but the Open GPU documentation there appears to be for much older GPUs.
Am I missing something? Is there a website that I'm not aware of that contains GPU documentation like PCIe information and such? Or is this all that's available? I know that AMD has their BIOS and Kernel Developer Guides (BKDGs), and while some of those contain "integrated" graphics, I'm wondering if there's a more "authoritative" reference that doesn't depend so heavily on the particular processor.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Tue May 11, 2021 2:10 pm 
Offline
Member
Member
User avatar

Joined: Mon Sep 03, 2018 2:25 am
Posts: 66
I don't know about AMD, but for Intel you're spot on, for example Coffee Lake is mostly similar to Skylake.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Tue May 11, 2021 2:30 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
The abbreviations in the configuration table tell you that, for example, Whiskey Lake inherits its GPU from Coffee Lake (CFL) and Kaby Lake (KBL).

I can't find any register-level documentation for recent AMD GPUs either, but they are at least nice enough to provide source code for an entire Linux driver.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Tue May 11, 2021 3:56 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
Thanks for your answers! I was going to ask about PCIe but I just grepped the documents and found it -- it seems to be all over the place depending on the generation. I assume GPU initialization and setup is also like that?


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Tue May 11, 2021 4:35 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
Okay, so I'm definitely confused. What does Intel call the MMIO BAR? I've found the I/O BAR but that appears to be BAR 4. I can't find anything about what BARs 0-3 are, or what BAR 5 is. This is the skylake PRM but if they call it the same on everything then that would work. It'd be a lot nicer if PCI/PCIe registers were separate from GPU registers because I seriously have no idea how to initialize the GPU or what BAR gives me access to GPU configuration or anything like that. The Intel graphics article isn't very useful, unfortunately.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Tue May 11, 2021 9:10 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Why on earth did Intel choose to alphabetize all of the registers instead of sorting by address? Anyway, you can find the configuration space registers by searching for "PCI: 0/2/0". (The registers listed as "PCI: 0/0/0" seem to belong to the memory controller instead of the GPU.)

BAR0 is GTTMMADR_0_2_0_PCI - Graphics Translation Table Memory Mapped Range Address.
BAR2 is GMADR_0_2_0_PCI - Graphics Memory Range Address.
BAR4 is IOBAR_0_2_0_PCI - I/O Base Address.
BAR1 and BAR3 are the upper bits of BAR0 and BAR2, since they're 64-bit. BAR5 doesn't seem to be used.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Thu May 13, 2021 10:58 am 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
Octocontrabass wrote:
Why on earth did Intel choose to alphabetize all of the registers instead of sorting by address? Anyway, you can find the configuration space registers by searching for "PCI: 0/2/0". (The registers listed as "PCI: 0/0/0" seem to belong to the memory controller instead of the GPU.)

BAR0 is GTTMMADR_0_2_0_PCI - Graphics Translation Table Memory Mapped Range Address.
BAR2 is GMADR_0_2_0_PCI - Graphics Memory Range Address.
BAR4 is IOBAR_0_2_0_PCI - I/O Base Address.
BAR1 and BAR3 are the upper bits of BAR0 and BAR2, since they're 64-bit. BAR5 doesn't seem to be used.

Thanks for that! What about GPU initialization and such? Is there a specific volume that covers that or is there a guide I can find, or will I just have to play with it? (Also, what can I use to emulate the graphics? I could use PCIe passthrough -- I do have an Intel HD 620 GPU (Linux says its a Skylake GPU) but I'm hesitant to do that since its my primary GPU).


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Thu May 13, 2021 2:25 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Ethin wrote:
What about GPU initialization and such? Is there a specific volume that covers that or is there a guide I can find, or will I just have to play with it?

It looks like volume 12 explains at least part of how to get the GPU up and displaying things, but you'll have to cross-reference information across other volumes to find everything you need, and I'm not sure where you're supposed to start. You might want to look at the Linux drivers for guidance here.

Ethin wrote:
Also, what can I use to emulate the graphics?

There's no emulator that I know of. If you can convince the host OS to give up control of the GPU, you can try PCIe passthrough, but there's no guarantee it'll work.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Thu May 13, 2021 9:16 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
Octocontrabass wrote:
Ethin wrote:
What about GPU initialization and such? Is there a specific volume that covers that or is there a guide I can find, or will I just have to play with it?

It looks like volume 12 explains at least part of how to get the GPU up and displaying things, but you'll have to cross-reference information across other volumes to find everything you need, and I'm not sure where you're supposed to start. You might want to look at the Linux drivers for guidance here.

Ethin wrote:
Also, what can I use to emulate the graphics?

There's no emulator that I know of. If you can convince the host OS to give up control of the GPU, you can try PCIe passthrough, but there's no guarantee it'll work.

Ugh. That might make writing GPU drivers pointless for now then, especially because I wouldn't really be able to see if I'm making any progress or not in terms of actually displaying anything. I also don't have an external GPU or thunderbolt support, so...


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Wed Mar 16, 2022 3:46 pm 
Offline

Joined: Wed Mar 16, 2022 3:38 pm
Posts: 1
You can try creating a uefi boot loader to test your gpu driver on real hardware.


Top
 Profile  
 
 Post subject: Re: Question about Intel and AMD GPU documentation
PostPosted: Mon Mar 21, 2022 4:43 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
Octocontrabass wrote:
There's no emulator that I know of. If you can convince the host OS to give up control of the GPU, you can try PCIe passthrough, but there's no guarantee it'll work.


It does work on Linux (in combination with Qemu). I use it everyday to test my GPU code. Let me know if you need any specifics.

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group