在APU-AMD3670K上安装catalyst12.6显卡驱动经验(3.4内核)

CPU/显卡/打印机/USB设备等硬件问题
头像
rapistor
帖子: 1983
注册时间: 2009-01-19 15:09

在APU-AMD3670K上安装catalyst12.6显卡驱动经验(3.4内核)

#1

帖子 rapistor » 2012-07-01 17:25

catalyst12.6于6.30日正式发布,官方说支持3.4内核。
本人使用APU 3670K,升级到3.4内核,直接安装12.6驱动失败。
经过Robber Phex高人指点,经这不懈努力,终于找到问题所在。
最后在Ubuntu12.04系统上,3.4内核成功安装了12.6内核。
经验总结于下,献出来和大家共享。
因本人不会制作补丁,只能教大家手动修改文件。


下载官方12.6驱动,保存于家目录下。执行
./amd-driver-installer-12-6-x86.x86_64.run --extract amd.8.98
解压安装包
然后打开
/home/你的用户名/amd.8.98/common/lib/modules/fglrx/build_mod

修改common/lib/modules/fglrx/build_mod/firegl_public.c和kcl_ioctl.c文件。
分别用gedit打开firegl_public.c和kcl_ioctl.c文件。
(建议修改前做个备份,这样也方便找行数的位置)

先修改firegl_public.c把原来34行附近 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
#include <generated/autoconf.h>
#else
#include <linux/autoconf.h>
#endif

#if !defined(CONFIG_X86)
#if !defined(CONFIG_X86_PC)

修改成
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
#include <generated/autoconf.h>
#else
#include <linux/autoconf.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
#define cpu_possible_map (*(cpumask_t *)cpu_possible_mask)
#define cpu_online_map (*(cpumask_t *)cpu_online_mask)
#endif

#if !defined(CONFIG_X86)
#if !defined(CONFIG_X86_PC)


184行附近 
#include <linux/kmod.h>
#include <linux/sysrq.h>
#include <linux/string.h>
#include <linux/gfp.h>
#include <linux/swap.h>
#include "asm/i387.h"

#include "firegl_public.h"
#include "kcl_osconfig.h"

修改成
#include <linux/kmod.h>
#include <linux/sysrq.h>
#include <linux/string.h>
#include <linux/gfp.h>
#include <linux/swap.h>
#include "asm/i387.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
#include <asm/fpu-internal.h>
#endif

#include "firegl_public.h"
#include "kcl_osconfig.h"


把原来4168行附近
static int kasInitExecutionLevels(unsigned long level_init)
{
unsigned int p;
KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
for_each_cpu_mask(p, cpu_possible_map)
{
KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
preempt_disable();
per_cpu(kasExecutionLevel, p) = level_init;
preempt_enable();
}

修改成
static int kasInitExecutionLevels(unsigned long level_init)
{
unsigned int p;
KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
for_each_possible_cpu(p)
#else
for_each_cpu_mask(p, cpu_possible_map)
#endif
{
KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
preempt_disable();
per_cpu(kasExecutionLevel, p) = level_init;
preempt_enable();
}

昨天忘记这个地方了,现加进去!!

把原5825行

struct task_struct *cur_task = current;
preempt_disable();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
/* The thread structure is changed with the commit below for kernel 3.3:

修改成 

struct task_struct *cur_task = current;
preempt_disable();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
/* The thread structure is changed with the commit below for kernel 3.3:

也就是3,3,0改成3,4,0。

再修改/common/lib/modules/fglrx/build_mod/kcl_ioctl.c
把原来217行附近

* \param size [in] Number of bytes to allocate
* \return Pointer to allocated memory
*/
void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
{
void __user *ret = COMPAT_ALLOC_USER_SPACE(size);

修改成
* \param size [in] Number of bytes to allocate
* \return Pointer to allocated memory
*/
#ifndef CONFIG_X86_X32
DEFINE_PER_CPU(unsigned long, old_rsp);
#endif
void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
{
void __user *ret = COMPAT_ALLOC_USER_SPACE(size);
然后用

cd '/home/你的用户名/amd.8.98'
./ati-installer.sh 8.98 --buildpkg Ubuntu/precise

建立deb安装包。

cd ~
sudo dpkg -i fglrx*.deb

安装所建立的deb包。
如果你想硬解,必须用deb包安装。
这样才能安装硬解所需的xvba什么的软件。
当然如果你不想开硬解可以直接命令安装

sudo ./ati-installer.sh 8.98 --install

这样安装在新立得中找不到fglrx.deb的,(这个包是xvba所依赖的)
我12.04安装gnome-shell的,所以有新立得。

教程已发完,辛苦了好几天,得好好休息下了,如果有什么疑问可以共同研究。
上次由 rapistor 在 2012-07-02 13:34,总共编辑 3 次。
坚守在linux的天堂!
头像
qy117121
论坛版主
帖子: 50538
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#2

帖子 qy117121 » 2012-07-01 17:30

学习下,说不定会用到
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
jtshs256
帖子: 22323
注册时间: 2010-07-19 21:41
系统: OS X

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#3

帖子 jtshs256 » 2012-07-01 17:30

技术帖
躺平
头像
rapistor
帖子: 1983
注册时间: 2009-01-19 15:09

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#4

帖子 rapistor » 2012-07-01 17:34

搞了好多天,快晕了。
幸得高人指点,学会看日志,定位错误,才能搞定。 :em11
12.04系统的APU或ATI显卡的可能有用。
http://opendhu.is-great.org/2012/06/105/#comment-8
此网站有较多的AMD显卡的安装经验,我也是经本文作者指点才能成功,特别感谢。
一个大一的学生,感觉很不错的水平。
坚守在linux的天堂!
头像
rapistor
帖子: 1983
注册时间: 2009-01-19 15:09

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#5

帖子 rapistor » 2012-07-01 19:22

怪了,为什么我在查看新帖中竟然找不到,自己的东西?
是因为今天时间闰秒的原因吗?
坚守在linux的天堂!
头像
iamond
帖子: 719
注册时间: 2010-03-23 12:40

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#6

帖子 iamond » 2012-07-02 6:00

这么烦人?......为什么不能直接装上就用呢?
I Kubuntu U
头像
wjchen
帖子: 583
注册时间: 2011-05-02 19:08
系统: ubuntu 12.04

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#7

帖子 wjchen » 2012-07-02 9:29

mark下,说不定会用到。
767344148
帖子: 23
注册时间: 2010-08-17 15:46

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#8

帖子 767344148 » 2012-07-02 12:32

上patch啦。。。

使用说明:
cd 到解压目录,执行:
patch -p1 -i [path of patch file]

不要下载此补丁,请移步至12楼下载!
附件
amd.ubuntu.txt
按照楼主的改的patch文件哦。
(1.42 KiB) 已下载 87 次
上次由 767344148 在 2012-07-02 22:15,总共编辑 1 次。
头像
rapistor
帖子: 1983
注册时间: 2009-01-19 15:09

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#9

帖子 rapistor » 2012-07-02 13:13

还有个地方忘记修改了。
我修改一下,请8楼再修改下补丁。

把原5825行

struct task_struct *cur_task = current;
preempt_disable();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
/* The thread structure is changed with the commit below for kernel 3.3:

修改成 

struct task_struct *cur_task = current;
preempt_disable();
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
/* The thread structure is changed with the commit below for kernel 3.3:

也就是3.3改成3.4
坚守在linux的天堂!
头像
rapistor
帖子: 1983
注册时间: 2009-01-19 15:09

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#10

帖子 rapistor » 2012-07-02 13:18

iamond 写了:这么烦人?......为什么不能直接装上就用呢?
12.04默认的3.2内核可以直接安装,不用打补丁。
坚守在linux的天堂!
头像
rapistor
帖子: 1983
注册时间: 2009-01-19 15:09

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#11

帖子 rapistor » 2012-07-02 13:21

767344148 写了:上patch啦。。。

使用说明:
cd 到解压目录,执行:
patch -p1 -i [path of patch file]

谢谢,我自己先收藏了,以备重装之用。 :em11
怎么不是.patch文件,是忘记改名了?还是论坛不支持?
坚守在linux的天堂!
767344148
帖子: 23
注册时间: 2010-08-17 15:46

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验

#12

帖子 767344148 » 2012-07-02 22:12

rapistor 写了:
767344148 写了:上patch啦。。。

使用说明:
cd 到解压目录,执行:
patch -p1 -i [path of patch file]

谢谢,我自己先收藏了,以备重装之用。 :em11
怎么不是.patch文件,是忘记改名了?还是论坛不支持?
论坛不支持。

新的补丁在此!
附件
amd.ubuntu.txt
(1.78 KiB) 已下载 82 次
xiaomifeng
帖子: 42
注册时间: 2012-07-05 16:01

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验(3.4内核)

#13

帖子 xiaomifeng » 2012-07-23 17:25

lz,你是怎么升到3.4的?
我按照网上的升3.4,结果就是和以前升级补丁一样,到了图形登录界面就死机了。
xiaomifeng
帖子: 42
注册时间: 2012-07-05 16:01

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验(3.4内核)

#14

帖子 xiaomifeng » 2012-07-24 0:52

Detected a previous installation, /usr/share/ati/amd-uninstall.sh
Installation with force option.
Check if system has the tools required for installation.
fglrx installation is being forced. Installation will proceed without the required tools on the system.
Uninstalling any previously installed drivers.
Forcing uninstall of AMD Catalyst(TM) Proprietary Driver.
No integrity verification is done.
restore of system environment completed
Uninstall fglrx driver complete.
For detailed log of uninstall, please see /etc/ati/fglrx-uninstall.log
System must be rebooted to avoid system instability and potential data loss.
/usr/share/ati/amd-uninstall.sh completed with 0
[Message] Kernel Module : Trying to install a precompiled kernel module.
[Message] Kernel Module : Precompiled kernel module version mismatched.
[Message] Kernel Module : Found kernel module build environment, generating kernel module now.
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.4.6/build SUBDIRS=/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-3.4.6'
CC [M] /lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_agp.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_debug.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_ioctl.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_io.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_pci.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_str.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_iommu.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl.o
CC [M] /lib/modules/fglrx/build_mod/2.6.x/kcl_wait.o
LD [M] /lib/modules/fglrx/build_mod/2.6.x/fglrx.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "old_rsp" [/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko] undefined!
CC /lib/modules/fglrx/build_mod/2.6.x/fglrx.mod.o
LD [M] /lib/modules/fglrx/build_mod/2.6.x/fglrx.ko
make[1]: Leaving directory `/usr/src/linux-3.4.6'
build succeeded with return value 0
duplicating results into driver repository...
done.
You must change your working directory to /lib/modules/fglrx
and then call ./make_install.sh in order to install the built module.
- recreating module dependency list
- trying a sample load of the kernel modules
failed.
[Error] Kernel Module : Failed to install compiled kernel module - please consult readme.
[Reboot] Kernel Module : update-initramfs


好像编译成功,但不能安装
xiaomifeng
帖子: 42
注册时间: 2012-07-05 16:01

Re: 在APU-AMD3670K上安装catalyst12.6显卡驱动经验(3.4内核)

#15

帖子 xiaomifeng » 2012-07-24 16:25

代码: 全选

再修改/common/lib/modules/fglrx/build_mod/kcl_ioctl.c
把原来217行附近

* \param size [in] Number of bytes to allocate
* \return Pointer to allocated memory
*/
void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
{
void __user *ret = COMPAT_ALLOC_USER_SPACE(size);

修改成
* \param size [in] Number of bytes to allocate
* \return Pointer to allocated memory
*/
#ifndef CONFIG_X86_X32
DEFINE_PER_CPU(unsigned long, old_rsp);
#endif
void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
{
void __user *ret = COMPAT_ALLOC_USER_SPACE(size);
然后用
#ifndef CONFIG_X86_X32
DEFINE_PER_CPU(unsigned long, old_rsp);
#endif
吧下划线那两行删除,终于搞定了。
回复