python3-ImportError:没有名为“_chipset”的模块

python3-ImportError:没有名为“_chipset”的模块

我尝试运行如下的 python3 脚本:

$python3 quick_dump.py

...但每次我都会得到如下输出:

导入错误:没有名为“_chipset”的模块

我刚刚看了快速转储.py脚本导入如下:

#!/usr/bin/env python3

# register definition format:
# ('register name', 'register offset', 'register type')
#
# register types:
#  '' - normal register
#  'DPIO' - DPIO register
#
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

import argparse
import os
import sys
import ast
import subprocess
import chipset
import reg_access as reg

我尝试使用 $python3 -> help() 实用程序来查看芯片组模块是否可用;我可以看到芯片组模块出现在列表中;所以一切都应该没问题,但事实并非如此:P顺便说一句我没看到_芯片组列表中的模块,所以也许这就是事情?

我查看了chipset.py脚本及其代码:

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.





from sys import version_info
if version_info >= (2,6,0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_chipset', [dirname(__file__)])
        except ImportError:
            import _chipset
            return _chipset
        if fp is not None:
            try:
                _mod = imp.load_module('_chipset', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _chipset = swig_import_helper()
    del swig_import_helper
else:
    import _chipset
del version_info
try:
    _swig_property = property
except NameError:
    pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
    if (name == "thisown"): return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name,None)
    if method: return method(self,value)
    if (not static):
        self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self,class_type,name,value):
    return _swig_setattr_nondynamic(self,class_type,name,value,0)

def _swig_getattr(self,class_type,name):
    if (name == "thisown"): return self.this.own()
    method = class_type.__swig_getmethods__.get(name,None)
    if method: return method(self)
    raise AttributeError(name)

def _swig_repr(self):
    try: strthis = "proxy of " + self.this.__repr__()
    except: strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object : pass
    _newclass = 0



def is_sandybridge(*args):
  return _chipset.is_sandybridge(*args)
is_sandybridge = _chipset.is_sandybridge

def is_ivybridge(*args):
  return _chipset.is_ivybridge(*args)
is_ivybridge = _chipset.is_ivybridge

def is_valleyview(*args):
  return _chipset.is_valleyview(*args)
is_valleyview = _chipset.is_valleyview

def is_cherryview(*args):
  return _chipset.is_cherryview(*args)
is_cherryview = _chipset.is_cherryview

def is_haswell(*args):
  return _chipset.is_haswell(*args)
is_haswell = _chipset.is_haswell

def is_broadwell(*args):
  return _chipset.is_broadwell(*args)
is_broadwell = _chipset.is_broadwell

def is_skylake(*args):
  return _chipset.is_skylake(*args)
is_skylake = _chipset.is_skylake

def intel_get_pci_device():
  return _chipset.intel_get_pci_device()
intel_get_pci_device = _chipset.intel_get_pci_device

def intel_register_access_init(*args):
  return _chipset.intel_register_access_init(*args)
intel_register_access_init = _chipset.intel_register_access_init

def intel_register_read(*args):
  return _chipset.intel_register_read(*args)
intel_register_read = _chipset.intel_register_read

def intel_register_write(*args):
  return _chipset.intel_register_write(*args)
intel_register_write = _chipset.intel_register_write

def intel_register_access_fini():
  return _chipset.intel_register_access_fini()
intel_register_access_fini = _chipset.intel_register_access_fini

def intel_register_access_needs_fakewake():
  return _chipset.intel_register_access_needs_fakewake()
intel_register_access_needs_fakewake = _chipset.intel_register_access_needs_fakewake

def pcidev_to_devid(*args):
  return _chipset.pcidev_to_devid(*args)
pcidev_to_devid = _chipset.pcidev_to_devid

def intel_dpio_reg_read(*args):
  return _chipset.intel_dpio_reg_read(*args)
intel_dpio_reg_read = _chipset.intel_dpio_reg_read

def intel_flisdsi_reg_read(*args):
  return _chipset.intel_flisdsi_reg_read(*args)
intel_flisdsi_reg_read = _chipset.intel_flisdsi_reg_read
# This file is compatible with both classic and new-style classes.

所以我的问题是...如何修复错误或者有没有最佳解决方法?


编辑 :

我尝试 a) 配置 b) 编译 c) 安装英特尔 GPU 工具使用 make util 编写源代码;所以现在似乎已经安装好了,但我仍然无法调用 quick_dump;我输入“$sudo quick_dump“但我明白”sudo:quick_dump:未找到命令“作为输出:(

请提示我做错了什么?

谢谢

答案1

_chipset应该是一个本机模块(chipset.i参见同一目录),显然您需要从源代码进行构建。

粗略的下载和编译说明:

  1. git使用包管理器安装并克隆存储库:

    git clone git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
    cd intel-gpu-tools
    
  2. 安装构建工具(build-essential autoconf automake gcc)、先决条件(参见的最后一部分README)并运行./autogen.sh(它会告诉您缺少的先决条件)。

  3. 建造:make -C tools/quick_dump

  4. 安装:sudo make -C tools/quick_dump install

我自己没有尝试过,因为在这里安装 i915 驱动程序开发文件会很困难。

相关内容