What I'm doing here is insane GPU driver prototype for @GreenteaOS

NjRAA Work-in-progress Driver Foundation

[nee-jee-ray]

What I'm doing here is a GPU driver for Linux as a prototype for future graphics stack of the @GreenteaOS

NjRAA Logo

Aim

To support AMD GCN 1.0+ GPUs. And Intel/Nvidia ones that conform to Resource binding Tier 3 and Resource heap Tier 2.

This project is a part of future Driver Reusability Initiative (to be announced).

Supported GPUs

Later GCN/RDNA GPUs will reuse huge parts of GCN 1.0 code.

Step by step

  • Create IOCTL API to control driver from userspace
  • Init GPU engine and setup command buffer
  • Mode setting
  • Draw anything on screen

Limitations

Only fullscreen applications supported, no desktop GUI! Use only for secondary GPU with extra screen (or use extra inputs and switch dynamically).

Build

Use make to build kmodule kernel mode driver.

License

GNU LESSER GENERAL PUBLIC LICENSE Version 3

Owner
Miraculous Ladybugreport
Open-source enthusiast! Apps, toolkits and games developer.
Miraculous Ladybugreport
Comments
  • Find out which firmware files are important for a GCN (SI+) GPU

    Find out which firmware files are important for a GCN (SI+) GPU

    Note that we do not need a KMS (kernel mode setting) part (which supposedly runs at bootloader stage to show a boot logo and that's it), only actual thing that enables GCN "engines" and whole functionality.

    Notice: GCN aliased as "SI" (Southern Islands, Sea Islands) and GFX6 (gfx601), our point of interest is Oland CPU only for now.

    Find out what is the difference between uppercase & lowercase firmware files, and radeon vs amdgpu ones:

    • https://github.com/endlessm/linux-firmware/tree/master/amdgpu
    • https://github.com/endlessm/linux-firmware/tree/master/radeon

    DRM code is here linux\drivers\gpu\drm

    Points of interest:

    • amd\amdgpu\gfx_v6_0.c line MODULE_FIRMWARE("amdgpu/oland_pfp.bin"); (note amdgpu/ part)
    • amd\amdgpu\amdgpu_cgs.c line trcpy(fw_name, "radeon/oland_k_smc.bin"); (note radeon/ part)
    • radeon\si.c line MODULE_FIRMWARE("radeon/OLAND_smc.bin"); and lowercase MODULE_FIRMWARE("radeon/oland_smc.bin"); (note radeon/ part)
  • Learn from basic Intel driver implementation

    Learn from basic Intel driver implementation

    • [ ] Understand how https://github.com/pdoane/osdev/tree/master/gfx implementation works

    Must be checked against Intel Ivy Bridge w/ HD Graphics 4000 spec (supposedly Gen 7, pre-DX12 GPU) PCI\VEN_8086\DEV_0162

    • Intel OpenSource HD Graphics Programmer's Reference Manual (supposedly https://github.com/Igalia/intel-osrc-gfx-prm/tree/master/004_ivb_-_2012)

    • Intel Integrated Graphics Device OpRegion Specification

    • [ ] Understand how it differs from HD 500+ devices, by checking corresponding specs

    What experience we can reuse? Command ring/buffer layout, memory allocation, DMA mapping, etc

  • Find GPU specs and DRM for Intel 500/630/750

    Find GPU specs and DRM for Intel 500/630/750

    Elaborate:

    • [ ] Correct PCI IDs and generation aliases/common names/mesa|drm names for the provided GPUs
    • [ ] Find correct firmware in linux-firmware

    Devices:

    • [ ] Intel HD Graphics 500 (Gen. 9 (Skylake))
    • [ ] Intel UHD Graphics 630 (Gen. 9.5 (Kaby Lake))
    • [ ] Intel UHD Graphics 750 (Gen. 12 (Rocket Lake-S))
    • [ ] Iris Xe Graphics G7 (Gen. 12 (Tiger Lake-U))

    PDF's must contain:

    • [ ] List of GPU registers (at least, ones from Mesa code)
    • [ ] List of packets for GPU engine
    • [ ] Optionally: init routine, memory management, whatever

    Code must contain:

    • [ ] Linux DRM part related to the exact GPU generation linux\drivers\gpu\drm
    • [ ] Mesa counterpart
  • Find out how to compile shader bytecode with LLVM and Intel

    Find out how to compile shader bytecode with LLVM and Intel

    Reference:

    • AMD https://llvm.org/docs/AMDGPUUsage.html
    • Intel https://github.com/pdoane/osdev/blob/master/gfx/shaders/make_shaders.sh#L2

    Goals:

    • [ ] Generate shader binary to be uploaded into GPU for quick testing. Not SPIR-V/etc. It must be CPU/model specific.

    • [ ] Check if its possible to decompile shader / output ASM with -S flag.

    • [ ] Find shader decompilers, so we can decompile shaders binaries generated by the NjRAA for verification

    • Oland (GCN 1)

    • Intel 630/750 of @Samsuper12's

  • Create initial Linux PCI driver

    Create initial Linux PCI driver

    Note: only raw PCI driver required, not DRI/DRM.

    It must also create some APIs to be controlled from users pace.

    It must use WDF-like framework for PNP, so we don't have to implement power management manually.

    Reference:

    • https://www.kernel.org/doc/html/latest/PCI/pci.html
    • http://www.embeddedlinux.org.cn/essentiallinuxdevicedrivers/final/ch10lev1sec5.html
    • https://olegkutkov.me/2021/01/07/writing-a-pci-device-driver-for-linux/
    • https://habr.com/ru/post/348042/
    • https://habr.com/ru/post/431372/
    • https://qna.habr.com/q/229124
  • Find out what implements WDF on Linux

    Find out what implements WDF on Linux

    https://www.codeproject.com/Articles/13090/Building-and-deploying-a-basic-WDF-Kernel-Mode-Dri

    For those of you who don't know what WDF is: it is the best invention since sliced bread. Until recently, if you needed a device driver, you had to use the Windows Driver Model (WDM). WDM provides a low level framework for creating device drivers. Using this framework, your driver had to accept PNP, Power management, and IO requests, and figure out what to do with them, based on the state of your driver.

Dissecting the M1's GPU for 3D acceleration

Asahi GPU Research for an open source graphics stack for Apple M1. wrap Build with the included makefile make wrap.dylib, and insert in any Metal appl

Sep 22, 2022
nsfminer is an Ethash GPU mining application: with nsfminer you can mine every coin which relies on an Ethash Proof of Work.

nsfminer (no stinkin' fees) Ethereum (ethash) miner with OpenCL, CUDA and stratum support nsfminer is an Ethash GPU mining application: with nsfminer

Sep 2, 2022
Software ray tracer written from scratch in C that can run on CPU or GPU with emphasis on ease of use and trivial setup
Software ray tracer written from scratch in C that can run on CPU or GPU with emphasis on ease of use and trivial setup

A minimalist and platform-agnostic interactive/real-time raytracer. Strong emphasis on simplicity, ease of use and almost no setup to get started with

Sep 19, 2022
2D GPU renderer for dynamic UIs
2D GPU renderer for dynamic UIs

vger vger is a vector graphics renderer which renders a limited set of primitives, but does so almost entirely on the GPU. Works on iOS and macOS. API

Sep 17, 2022
A Hydra-enabled GPU path tracer that supports MaterialX.
A Hydra-enabled GPU path tracer that supports MaterialX.

A Hydra-enabled GPU path tracer that supports MaterialX.

Sep 22, 2022
Legion Low Level Rendering Interface provides a graphics API agnostic rendering interface with minimal CPU overhead and low level access to verbose GPU operations.
Legion Low Level Rendering Interface provides a graphics API agnostic rendering interface with minimal CPU overhead and low level access to verbose GPU operations.

Legion-LLRI Legion-LLRI, or “Legion Low Level Rendering Interface” is a rendering API that aims to provide a graphics API agnostic approach to graphic

Aug 13, 2022
A low-level, cross-platform GPU library

vgpu is cross-platform low-level GPU library. Features Support for Windows, Linux, macOS. Modern rendering using Vulkan and Direct3D12. Dependencies U

Jul 28, 2022
GPU cloth with OpenGL Compute Shaders
 GPU cloth with OpenGL Compute Shaders

GPU cloth with OpenGL Compute Shaders This project in progress is a PBD cloth simulation accelerated and parallelized using OpenGL compute shaders. Fo

Jul 27, 2022
GPU Texture Generator
GPU Texture Generator

Imogen GPU/CPU Texture Generator GPU Texture generator using dear imgui for UI. Not production ready and a bit messy but really fun to code. This is a

Oct 2, 2022
Optimized GPU noise functions and utilities

Optimized GPU noise functions and utilities

Sep 28, 2022
SMAA is a very efficient GPU-based MLAA implementation (DX9, DX10, DX11 and OpenGL)

SMAA is a very efficient GPU-based MLAA implementation (DX9, DX10, DX11 and OpenGL), capable of handling subpixel features seamlessly, and featuring an improved and advanced pattern detection & handling mechanism.

Oct 1, 2022
Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way created by Very Good Ventures 🦄
Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way created by Very Good Ventures 🦄

Very Good Performance Developed with ?? by Very Good Ventures ?? Utility on top of the Flutter Driver API that facilitates measuring the performance o

Sep 19, 2022
A beginner friendly repo in the world of open source. Contribute here to add here project in any languages.
A beginner friendly repo in the world of open source. Contribute here to add here project in any languages.

Hacktober Fest 2021 Heyy There (●'◡'●) Here you can contribute to opensource project in any valid language and project. Just follow the contribution g

May 24, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

Sep 20, 2022
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Sep 27, 2022
Trading bot who's doing transaction between different money.

CNA - TRADE Since 2002, trading robots, AKA algorithmic trading, are considered to be one of the major breakthroughs on financial markets over the las

Nov 8, 2021
A memory allocation program, it is used for doing an experiment to find out the detail of Microsoft Windows taskmgr performance information
A memory allocation program, it is used for doing an experiment to find out the detail of Microsoft Windows taskmgr performance information

memory-allocation-test A memory allocation program, it is used for doing an experiment to find out the detail of Microsoft Windows taskmgr performance

Jul 28, 2022
🧼 Cleanly pause and play your YouTube videos while cooking/crafting/doing your makeup by waving your hand over a proximity sensor!

?? Cleanly pause and play your YouTube videos while cooking/crafting/doing your makeup by waving your hand over a proximity sensor!

May 1, 2022
Program that allows you to get the source code of a website's home page without doing it manually. Use it at your own risk.

Website-Homepage-Grabber Install one of the folders x64 or x32 if the program doesn't work(probably because you don't have visual studio installed) If

Feb 19, 2022