kobalicek / amdtweak

A library that can be used to manipulate ATOM and PowerPlay (PP) tables of AMDGPUs
71 stars 20 forks source link

print bios and other information #16

Open logicminds opened 6 years ago

logicminds commented 6 years ago

I am interested in the non power_play table information like bios info and vram module info.

I can't seem to print this information out though.

Below is the code that I used to test this with:

const binlib = require("./lib/binlib.js");
const iofs = require("./lib/iofs.js");
const vbios = require("./lib/vbios.js");
const CARD_ID = 0;
const DUMP = true;
const OVERWRITE = false;
const CARD_PP = `/sys/class/drm/card${CARD_ID}/device/pp_table`;
const buf = fs.readFileSync(CARD_PP);
console.log(JSON.stringify(vbios.$readObject({ buffer: buf, type: vbios.VRAMModule }), null, 2));
{}
Lucie2A commented 6 years ago

This code read and decode the PP table from the bios, not the full bios. You can access other parts of the bios in binary mode (directly from /sys/ tree) but there isn't any method in 'amdtweak' to decode the bios outside the PP tables.