GPU driver does not work properly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPU driver does not work properly

2,856 Views
changshui
Contributor I

我在使用imx-yocto-L4.14.98_2.0.0_ga构建系统时遇到了问题, 我所使用的硬件平台使用的是imx6q,
yocto执行配置是MACHINE=imx6qsabresd DISTRO=fsl-imx-wayland source fsl-setup-release.sh -b build_wayland,
构建目标为fsl-image-gui

构建完成后,我发现这版Linux内核配置没有使能imx6q gpu驱动,我对配置进行了修改,设置CONFIG_MXC_GPU_VIV=y,重新生成了镜像

系统在板子上能正常允许,但是使用根目录下unit_tests/GPU中的脚本测试gpu时,出现了错误
执行guninfo.sh时出现下面错误提示
---- Running < gpuinfo.sh > test ----
GPU Info
cat: /sys/kernel/debug/gc/info: No such file or directory
cat: /sys/kernel/debug/gc/meminfo: No such file or directory
CMA memory info
cat: /sys/kernel/debug/gc/allocators/cma/cmausage: No such file or directory
cat: /sys/kernel/debug/gc/idle: No such file or directory
cat: /sys/kernel/debug/gc/clients: No such file or directory
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
cat: /sys/kernel/debug/gc/idle: No such file or directory
Idle percentage:%

执行gpu.sh出现下面错误提示
[ 1] Failed to open device: No such file or directory, Try again...
[ 2] Failed to open device: No such file or directory, Try again...
[ 3] Failed to open device: No such file or directory, Try again...
[ 4] Failed to open device: No such file or directory, Try again...
[ 5] _OpenDevice(1228): FATAL: Failed to open device, errno=No such file or directory.
貌似imx6q的gpu驱动还是不能正常工作,如何解决这个问题呢?请帮忙提供一些帮助信息或者解决思路?

Labels (3)
0 Kudos
Reply
14 Replies

2,845 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello changshui,

 

The yocto bsp include by defaut support for the GPU on MX6SABRE board you don't have to select in kernel. please build the yocto from default.

Regards

0 Kudos
Reply

2,839 Views
changshui
Contributor I

感谢你百忙之中的回复!我按照你的方法,使用了yocto的默认构建,现在imx6q的GPU仍然不能工作!
同时,我进一步阅读了yocto中构建内核的菜单linux-imx_4.14.98.bb源码,当没指定MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT="1"时,
内核构建会依赖于kernel-module-imx-gpu-viv菜单,该菜单中指定从内核的imx_4.9.88_2.0.0_ga分支中找到gpu驱动,并把他编译成内核的模块
kernel-module-imx-gpu-viv菜单部分源码如下:
SRCBRANCH = "imx_4.9.88_2.0.0_ga"
LOCALVERSION = "-${SRCBRANCH}"

KERNEL_SRC ?= "git://source.codeaurora.org/external/imx/linux-imx.git;protocol=https"
SRC_URI = " \
${KERNEL_SRC};branch=${SRCBRANCH};subpath=drivers/mxc/gpu-viv;destsuffix=git/src \
file://Add-makefile.patch \
"
SRCREV = "5e23f9d6114784d77fd4ed5848953356c3575532"

S = "${WORKDIR}/git"

inherit module

EXTRA_OEMAKE += "CONFIG_MXC_GPU_VIV=m"

KERNEL_MODULE_AUTOLOAD = "galcore"
COMPATIBLE_MACHINE = "(imx)"
galcore.ko存放在/lib/modules/4.14.98-imx_4.14.98_2.0.0_ga+g5d6cbeafb80c/extra/目标下,在系统启动时,驱动galcore.ko已经被自动被加载到内核。如下图所示:

changshui_0-1629991532018.png

遗憾的是,装载该驱动后used by等于0,是不是没匹配到gpu device),gpu仍然不能工作!请问你还有其他方法帮助我解决这个问题吗?非常感谢!

0 Kudos
Reply

2,822 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello changshui,

 

The module is on and is not activated according to your image, you must run a graphics on it by example you can run the opengl unit test installed on your system, also you can run all samples for referring you can view the graphics user guide on your yocto documentation.

 

Regards

0 Kudos
Reply

2,819 Views
changshui
Contributor I

Hello, Bio_TICFSL,

Thank you for your reply! Although the GPU driver is loaded as a module, but it cannot work normally. The /dev/galcore device node cannot be found in the /dev directory,I tried to run the gpuinfo.sh script in the /unit_tests/GPU/ directory, but unfortunately I couldn't get any information about the gpu.

At the same time, when the system starts, systemd will start weston by default. Its backend uses gl-renderer.so, and it is not using gpu driver normally, so weston can't be run as well

I think the current situation may be that although the driver has been loaded into the kernel, it has not successfully matched the gpu device, or the sending error during the matching process may be returned.

here are some infomation, when I run gpuinfo.sh script in  console:

root@imx6qsabresd:/unit_tests/GPU# ./gpuinfo.sh

---- Running < gpuinfo.sh > test ----
GPU Info
cat: /sys/kernel/debug/gc/info: No such file or directory
cat: /sys/kernel/debug/gc/meminfo: No such file or directory
CMA memory info
cat: /sys/kernel/debug/gc/allocators/cma/cmausage: No such file or directory
cat: /sys/kernel/debug/gc/idle: No such file or directory
cat: /sys/kernel/debug/gc/clients: No such file or directory
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
cat: /sys/kernel/debug/gc/idle: No such file or directory
Idle percentage:%
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

---- Test < gpuinfo.sh > ended ----

 

0 Kudos
Reply

2,027 Views
ravicalm
Contributor I

Hi @changusai,

 

are u able to resolve this? I am also facing the same problem.

0 Kudos
Reply

2,017 Views
changshui
Contributor I

Hi ravicalm

    I did not solve this problemI tried to use the previous release kernel version(such as 4.1), the operation is normal. It may be that the new release of nxp is not compatible with the gpu

0 Kudos
Reply

2,011 Views
ravicalm
Contributor I
I don't have /unit_tests/folder itself bro even the imx-gpu-viv gputop imx-test related things are not compiling even though I have included in the corresponding image
Operating system: Operating System: Poky (Yocto Project Reference Distro) 2.7.1 (warrior)
any idea?
0 Kudos
Reply

2,012 Views
ravicalm
Contributor I
I am using the following board
root@fly : It has imx7ulp processor
0 Kudos
Reply

2,014 Views
ravicalm
Contributor I
I have the Kernel: Linux 4.14.98 version should I degrade to 4.1 now?
0 Kudos
Reply

2,009 Views
ravicalm
Contributor I

Hi @changshui 

Could you share the 4.1 release code to me

0 Kudos
Reply

1,971 Views
ravicalm
Contributor I

@changshui:

which kernel version are u using exactly to resolve this issue

0 Kudos
Reply

1,967 Views
changshui
Contributor I

my target machine is imx6q, I used the yocto project provided by nxp to build the system! At that time, the pull is 4.1 branch in imx-manifest. you can find the corresponding branch.

 

0 Kudos
Reply

1,960 Views
ravicalm
Contributor I

@changshui  could you please find out what all differences we have wrt galcore changes with the present and previous kernel . I am handling the internal project which is company propritery code evn though they tooks most from NXP finally I have to enable /sys/module/kernel/debug/gc folder I need gc folder for that what I need to enable

0 Kudos
Reply

1,907 Views
ravicalm
Contributor I
@changshui I am not able to access the imx-manifest file can u please give the diff of galcore module between the working and non working one
0 Kudos
Reply