Auto-flash AMD/ATI video card firmware: Difference between revisions

From lurkmore wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
This page contains a PHP script for auto-flashing an AMD or ATI video card's (GPU) firmware using a simple command line:
This page contains a PHP script for auto-flashing an [[AMD]] (ATI) video card's (GPU) firmware using a simple command line through Linux:


<code>
<pre>
<?php
<?php
 
//created by ugtarmas  
//created by ugtarmas  
//'''if this is useful, donate to LRv8b23mQSZah7bg16n7tjT5RVDnZtMi4Z'''
//'''if this is useful, donate to LRv8b23mQSZah7bg16n7tjT5RVDnZtMi4Z'''
 
//atiflash must be located in /usr/local/bin
//you must download atiflash from http://liteshack.com/files/atiflash and put into /usr/local/bin/ dir
//download from http://www.techpowerup.com/downloads/2230/atiflash-4-07/
//or try your luck here: https://www.google.com/search?q=atiflash+for+linux
 
//usage:
//usage:
//php flash.php 035
//php flash.php 035
 
//this will flash gpu 0, 3 and 5.
//this will flash gpu 0, 3 and 5.
//php cli must be installed
 
//edit this
//edit this
$path_to_rom = "/home/user/msi.radeon.7950.TF.3GD5.BE.SILVER.V276-18S.voltage.1050.rom";
$path_to_rom = "/home/user/firmware/gpufirmware.rom";
 
//edit below at your own risk
 
//edit below at your own risk
$gpu_count = $argv[1];
 
if(!$argv[1] && $argv[1] != 0){ exit ("\nopen this file and read the instructions\n\n"); }
$gpu_array = str_split($gpu_count);
 
$gpu_count = $argv[1];
foreach($gpu_array as $gpu){
if(is_numeric($gpu)){
$gpus = str_split($gpu_count);
$gpus[] = $gpu;
}
echo "attempting to flash $gpu_count:\n";
}
 
foreach($gpus as $gpu){  
$gpu_string = implode(",",$gpus);
$count = count($gpus);
while(true){
 
if($count < 1){ exit ("\nyou need to specify the gpus that you want to flash\n\n"); }
        `atiflash -f -p $gpu $path_to_rom > /tmp/flash_$gpu`;
if(!file_exists($path_to_rom)){ exit("\nthe file $path_to_rom does not exist\n\n"); }
 
        $result = file_get_contents("/tmp/flash_$gpu");
echo "\nattempting to flash $path_to_rom to gpus $gpu_string:\n\n";
 
        if(eregi("20000/20000h",$result)) { echo "\ndone flashing gpu $gpu\n\n"; break;}
foreach($gpus as $gpu){  
        echo "\nfailed to flash gpu $gpu";
 
`atiflash -unlockrom $gpu`;
        }
echo "unlocked rom on gpu $gpu, attempting to flash bios...\n";
 
}
while(true){
 
?>
        `atiflash -f -p $gpu $path_to_rom > /tmp/flash_$gpu`;
</code>
 
        $result = file_get_contents("/tmp/flash_$gpu");
 
        if(eregi("20000/20000h",$result)) { echo " done flashing gpu $gpu\n"; break;}
        echo "|";
 
        }
}
?></pre>


[[Category:Hardware]][[Category:Software]]
[[Category:Hardware]][[Category:Software]]

Revision as of 15:31, 2 October 2013

This page contains a PHP script for auto-flashing an AMD (ATI) video card's (GPU) firmware using a simple command line through Linux:

<?php

//created by ugtarmas 
//'''if this is useful, donate to LRv8b23mQSZah7bg16n7tjT5RVDnZtMi4Z'''

//you must download atiflash from http://liteshack.com/files/atiflash and put into /usr/local/bin/ dir
//or try your luck here: https://www.google.com/search?q=atiflash+for+linux

//usage:
//php flash.php 035

//this will flash gpu 0, 3 and 5.

//edit this
$path_to_rom = "/home/user/msi.radeon.7950.TF.3GD5.BE.SILVER.V276-18S.voltage.1050.rom";

//edit below at your own risk

$gpu_count = $argv[1];

$gpu_array = str_split($gpu_count);

foreach($gpu_array as $gpu){
	if(is_numeric($gpu)){
		$gpus[] = $gpu;
	}
}

$gpu_string = implode(",",$gpus);
$count = count($gpus);

if($count < 1){ exit ("\nyou need to specify the gpus that you want to flash\n\n"); }
if(!file_exists($path_to_rom)){ exit("\nthe file $path_to_rom does not exist\n\n"); }

echo "\nattempting to flash $path_to_rom to gpus $gpu_string:\n\n";

foreach($gpus as $gpu){ 

	`atiflash -unlockrom $gpu`;
	echo "unlocked rom on gpu $gpu, attempting to flash bios...\n";

	while(true){

        	`atiflash -f -p $gpu $path_to_rom > /tmp/flash_$gpu`;

	        $result = file_get_contents("/tmp/flash_$gpu");

	        if(eregi("20000/20000h",$result)) { echo " done flashing gpu $gpu\n"; break;}
	
	        echo "|";

	        }
}
?>