Question about Intel and AMD GPU documentation

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Question about Intel and AMD GPU documentation

Post by Ethin »

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.
User avatar
thomtl
Member
Member
Posts: 66
Joined: Mon Sep 03, 2018 2:25 am

Re: Question about Intel and AMD GPU documentation

Post by thomtl »

I don't know about AMD, but for Intel you're spot on, for example Coffee Lake is mostly similar to Skylake.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Question about Intel and AMD GPU documentation

Post by Octocontrabass »

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.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Question about Intel and AMD GPU documentation

Post by Ethin »

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?
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Question about Intel and AMD GPU documentation

Post by Ethin »

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.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Question about Intel and AMD GPU documentation

Post by Octocontrabass »

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.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Question about Intel and AMD GPU documentation

Post by Ethin »

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).
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Question about Intel and AMD GPU documentation

Post by Octocontrabass »

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.
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: Question about Intel and AMD GPU documentation

Post by Ethin »

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...
DiamondMenMaster
Posts: 1
Joined: Wed Mar 16, 2022 3:38 pm

Re: Question about Intel and AMD GPU documentation

Post by DiamondMenMaster »

You can try creating a uefi boot loader to test your gpu driver on real hardware.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: Question about Intel and AMD GPU documentation

Post by Octacone »

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
Post Reply