Vulkan physical device - gpu

I'm learning Vulkan by API spec (http://vulkan-spec-chunked.ahcox.com/ch02s09.html), and I'm little confused about how physical devices are in Vulkan. I do have only one intel physical video card device, but vkEnumeratePhysicalDevices returns count of 2. The devices are identical, but the queue flags seems differ, and the queue flags are undocumented (actually they are, but only to flag 8, in second queue I do have the flag values 16 and 32).
typedef enum VkQueueFlagBits {
VK_QUEUE_GRAPHICS_BIT = 0x00000001,
VK_QUEUE_COMPUTE_BIT = 0x00000002,
VK_QUEUE_TRANSFER_BIT = 0x00000004,
VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008,
} VkQueueFlagBits;
here is the output of my vulkan code:
GPU count: 2 ( physical devices )
Physical Device 0:
Device API version: 1.0.42 - 4194346
Device Vendor Id: 0x8086
Device Id: 1916
Device Driver version: 0.0.1 - 1
Device type: 1
Device Name: Intel(R) HD Graphics 520 (Skylake GT2)
Device Pipeline UID: f557cfd4
Queue Properties:
Flags: 7
Count: 1
ts Valid Bits: 24
Physical Device 1:
Device API version: 1.0.42 - 4194346
Device Vendor Id: 0x8086
Device Id: 1916
Device Driver version: 0.0.1 - 1
Device type: 1
Device Name: Intel(R) HD Graphics 520 (Skylake GT2)
Device Pipeline UID: f557cfd4
Queue Properties:
Flags: 49
Count: 0
ts Valid Bits: 1
Someone can help me understand why there is 2 physical devices for the same real device and the missing flags ?

The count=0 of the second device is curious. More seriously, its flags and tsVB values are corrupted (49 is not an valid value for flags and 1 not valid for tsVB).
This pretty much boils down to there being one extraneous *.json file on your system.
These *.json files store informations about ICDs present on the machine. They are stored in standard location(s).
vkEnumeratePhysicalDevices+vkGetPhysicalDeviceProperties are relatively dumb commands doing nothing much else than reading said *.json file(s) and returning its contents. I think though that calling something "real" like vkCreateDevice would not work on the badly installed driver.
What exactly happened to creare this problem is up to your curiosity to explore. For starters I believe on Linux distros there is a command to map a file to its originating package. It will probably be something about bad cleanup of previous driver, or possibly bug in the installation script of the new one. At least one person had this problem before.
Based on what I explained here, I believe this is relatively benign bug. The first device should work just fine. And you can just ignore the second one. Or simply delete its *.json manifest to prevent it from showing up in vkEnumeratePD.

Related

Can an end point is connected to more than one router in a NoC topology in gem5 garnet3.0?

I am running gem5 version 22.0.0.2. I operate Garnet in a standalone manner in conjunction with the Garnet Synthetic Traffic injector. I want to emulate a routerless NoC so I guess I need to connect an end point (e.g, Cores, Caches, Directories) to more than one "local" router. I just use a python configuration to configure the topology. But when I do this, there is a runtime error:
build/NULL/mem/ruby/network/garnet/GarnetNetwork.cc:125: info: Garnet version 3.0
build/NULL/base/stats/group.cc:121: panic: panic condition statGroups.find(name) != statGroups.end() occurred: Stats of the same group share the same name `power_state`.
Memory Usage: 692360 KBytes
Program aborted at tick 0
Here is a description from the gem5 documentation: "Each network interface is connected to one or more “local” routers which is could be connected through an “External” link." Here is the link:https://www.gem5.org/documentation/general_docs/ruby/heterogarnet/
Here is the constructor of Stats::Group
Group(Group *parent, const char *name = nullptr)
Here is a description from the gem5 documentation: "there are special cases where the parent group may be null. One such special case is SimObjects where the Python code performs late binding of the group parent."
Here is the link:https://www.gem5.org/documentation/general_docs/statistics/api.
I guess the error may be related to this, but I don't know the exact reason.
Any help would be appreciated.
Thank you.

JVM Runtime.availableProcessors() returns 2 when it should be 4

I'm running openjdk11 on alpine linux in a container in an AWS EKS cluster.
The application determines the size of a threadpool based on the number of CPUs as returned by Runtime.getRuntime().availableProcessors()
This call is returning 2 processors even though the container shows that 4 CPUs are available:
# cat /proc/cpuinfo | grep processor
processor : 0
processor : 1
processor : 2
processor : 3
Any idea why and how to solve the problem?
Update
Doing some more digging (prompted by some great questions from #gohm'c in the comments), I found a way to add some trace log prints to the JVM with -Xlog:os+container=trace
[0.001s][trace][os,container] CPU Shares is: 1536
[0.001s][trace][os,container] CPU Share count based on shares: 2
Now, I defined in resources.requests.cpu: "1500m".
I don't know why the slight discrepancy but I changed the value of the CPU request, and indeed the CPU Shares in the log trace changes accordingly.
I understand how the resources.limits.cpu value could affect the CPUs that the JVM sees. But why is the resources.requests.cpu value doing that! This seems like a bug to me? Any thoughts?

using gammu and a DKU2 cable to write a vCard to a nokia 6303i classic

I am trying out gammu for the 1st time because I want to transfer some google contacts back to a nokia 6303i .
While the phone database section in Gammu website states that a number of bluetooth connection settings can be used with this phone, I have no bluetooth connection and will thus have to resort to a DKU2 usb cable that I have. The cable is actually a CA-101 nokia cable but according to gnokii wiki they are technically the same.
I have attempted several different connection types. from the ~/.gammurc
[gammu]
#model = NAUTO
device = 01a5:-1
connection = dku2
synchronizetime = yes
logfile = gammu0.log
logformat = text
use_locking =
gammuloc =
[gammu1]
device = /dev/ttyACM0
connection = at
synchronizetime = yes
logfile = gammu1.log
logformat = text
use_locking =
gammuloc =
[gammu2]
#model = NAUTO
device = /dev/ttyACM0
connection = fbus
synchronizetime = yes
logfile = gammu2.log
logformat = text
use_locking =
gammuloc =
[gammu3]
#model = NAUTO
device = 01a5:-1
connection = fbususb
synchronizetime = yes
logfile = gammu2.log
logformat = text
use_locking =
gammuloc =
I have managed to use the "at" connection with gammu -s 1 identify and correctly read phone info. Then I tried to copy a simple (albeit non gammu generated) vCard from those I exported from google contacts.
It was typically formatted like so:
BEGIN:VCARD
VERSION:2.1
FN:Name Surname
N:Surname;Name
EMAIL;CHARSET=UTF-8;ENCODING=8BIT:name.surname#domain.com
TEL;TYPE=CELL:+10123456789
TEL;TYPE=CELL:+19876543210
END:VCARD
What is frustrating is that from a Windows Pc running nokia PC suite I was able to correctly send that same vCard to the nokia 6303i over the same cable.
However from gammu I have -at most- been able to send the surname from the "N:Surname;Name;;;" field (the contact only shows up with the surname) and the 1st telephone number. So the email and the 2nd phone number have been omitted.
This is not enough for me , because I need all phones, all emails and notes to be transferred. I have not found any information abotu whether the "at" connection supports the "enhancedphonebook" functionality (it appears that it does not), but I apart from "bluefbus" which supposedly supported the "enhancedphonebook" in the "Nokia 6303i Cliassic" I don't know which other cabled connection supports it.
so I have tried
the variations gammu(0) , gammu2 and gammu3 as seen in the config file
but these two do not work.
The gammu and gammu3 dump the following in the log
[Gammu - 1.31.0 built 12:51:10 Jul 24 2016 using GCC 4.7]
[Connection - "dku2"] #or "fbususb for gammu3
[Connection index - 0]
[Model type - ""]
[Device - "01a5:-1"]
[Running on - Linux, kernel 3.2.29-gaze5 (#1 SMP Sat Apr 20 13:57:31 EEST 2013)]
Checking 1d6b:0002 (bus 1, device 1)
Checking 1d6b:0002 (bus 2, device 1)
Checking 1d6b:0001 (bus 3, device 1)
Checking 1d6b:0001 (bus 4, device 1)
Checking 1d6b:0001 (bus 5, device 1)
Checking 1d6b:0001 (bus 6, device 1)
Checking 1d6b:0001 (bus 7, device 1)
Checking 0421:0359 (bus 7, device 35)
Extra CDC subheader: 171
Trying to open device, config=1, c_iface=2, c_alt=0, d_iface=3, d_alt=1
Configuration change not required, unhooking only required interfaces!
Detaching kernel driver from inteface 2
Claiming USB control interface...
Configuring USB control interface...
Claiming USB data interface...
Configuring USB data interface...
Connected!
[Module - "auto"]
Getting model
SENDING frametype 0xD1/length 0x05/5
00 |01 |00 |03 |00 .....
Failed to read from usb (-99)!
Other error
Failed to read from usb (-99)!
Other error
Failed to read from usb (-99)!
Other error
and gammu2
[Gammu - 1.31.0 built 12:51:10 Jul 24 2016 using GCC 4.7]
[Connection - "fbus"]
[Connection index - 0]
[Model type - ""]
[Device - "/dev/ttyACM0"]
[Running on - Linux, kernel 3.2.29-gaze5 (#1 SMP Sat Apr 20 13:57:31 EEST 2013)]
Setting speed to 115200
Serial device: DTR is up, RTS is down, CAR is down, CTS is up
(... and it gets stuck here)
So the main question is: how can I achieve transferring the vCard (and many others) to the phone, over a usb cable???????
Thank you

lxc container can't use nfc usb device

I have been trying to use libnfc in a lxc container running debian wheezy.
Having tried several things and libraries, thus justifying the lxc way, I finally reached a point where I don't know where to look.
The problem is that the hosts sees my usb device, but not the container.
I added the following in the container's lxc config file:
lxc.cgroup.devices.allow = c 189:* rwm
When I try lsusb on the container I get:
root#nfc:~/libnfc# lsusb
unable to initialize libusb: -99
Whereas the host gives:
Bus 006 Device 003: ID 072f:2200 Advanced Card Systems, Ltd
Which is the device I'm looking for.
Surprisingly the container can see the device:
root#nfc:~/libnfc# usb-devices
[...]
T: Bus=06 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=072f ProdID=2200 Rev=02.14
S: Manufacturer=ACS
S: Product=ACR122U PICC Interface
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=0b(scard) Sub=00 Prot=00 Driver=(none)
I have checked libusb versions, kernel modules, dependencies, but being quite ignorant there I'm a bit lost.
Any ideas ?
Adding:
lxc.mount.entry = /dev/bus/usb dev/bus/usb none bind,optional,create=dir
To the container configuration file in addition to lxc.cgroup.devices.allow = c 189:* rwm
worked for me.

Google Cloud - Compute Engine - Error starting instance when attached disk in READ_ONLY

I have a instance (F1-Micro) and a root persistent disk (10GB) on Google Cloud, Compute Engine service. When I start an instance and attach a disk in READ_WRITE the instance starts normally, executes my startup script and I can access through SSH. However, when I change the disk mode parameter to READ_ONLY the instance apparently starts normally and I can't do SSH giving me a timeout connection. Also, my startup script does not start. I suspect that or I need to attach more one root persistent disk with READ_WRITE permission or I need to setup some configuration in my disk. Someone could give me insight about what are happening? Below I give some data and logs:
Body Request:
instance = {
'name': instance_name,
'machineType': machine_type_url,
'disks': [{
'index' : 0,
'autoDelete': 'false',
'boot': 'true',
'type': 'PERSISTENT',
'mode' : 'READ_ONLY', # READ_ONLY, READ_WRITE
'deviceName' : root_disk_name,
'source' : source_root_disk
}],
'networkInterfaces': [{
'accessConfigs': [{
'type': 'ONE_TO_ONE_NAT',
'name': 'External NAT'
}],
'network': network_url
}],
'serviceAccounts': [{
'email': service_email,
'scopes': scopes
}]
}
Log of started instance on GC-CE:
Changing serial settings was 0/0 now 3/0
Start bios (version 1.7.2-20131007_152402-google)
No Xen hypervisor found.
Unable to unlock ram - bridge not found
Ram Size=0x26600000 (0x0000000000000000 high)
Relocating low data from 0x000e10a0 to 0x000ef780 (size 2161)
Relocating init from 0x000e1911 to 0x265d07a0 (size 63291)
CPU Mhz=2601
=== PCI bus & bridge init ===
PCI: pci_bios_init_bus_rec bus = 0x0
=== PCI device probing ===
Found 4 PCI devices (max PCI bus is 00)
=== PCI new allocation pass #1 ===
PCI: check devices
=== PCI new allocation pass #2 ===
PCI: map device bdf=00:03.0 bar 0, addr 0000c000, size 00000040 [io]
PCI: map device bdf=00:04.0 bar 0, addr 0000c040, size 00000040 [io]
PCI: map device bdf=00:04.0 bar 1, addr febff000, size 00001000 [mem]
PCI: init bdf=00:01.0 id=8086:7110
PIIX3/PIIX4 init: elcr=00 0c
PCI: init bdf=00:01.3 id=8086:7113
Using pmtimer, ioport 0xb008, freq 3579 kHz
PCI: init bdf=00:03.0 id=1af4:1004
PCI: init bdf=00:04.0 id=1af4:1000
Found 1 cpu(s) max supported 1 cpu(s)
MP table addr=0x000fdaf0 MPC table addr=0x000fdb00 size=240
SMBIOS ptr=0x000fdad0 table=0x000fd9c0 size=269
Memory hotplug not enabled. [MHPE=0xffffffff]
ACPI DSDT=0x265fe1f0
ACPI tables: RSDP=0x000fd990 RSDT=0x265fe1c0
Scan for VGA option rom
WARNING - Timeout at i8042_flush:68!
All threads complete.
Found 0 lpt ports
Found 0 serial ports
found virtio-scsi at 0:3
Searching bootorder for: /pci#i0cf8/*#3/*#0/*#0,0
Searching bootorder for: /pci#i0cf8/*#3/*#0/*#1,0
virtio-scsi vendor='Google' product='PersistentDisk' rev='1' type=0 removable=0
virtio-scsi blksize=512 sectors=20971520
Searching bootorder for: /pci#i0cf8/*#3/*#0/*#2,0
...
Searching bootorder for: /pci#i0cf8/*#3/*#0/*#255,0
Scan for option roms
Searching bootorder for: HALT
drive 0x000fd950: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=20971520
Space available for UMB: 000c0000-000eb800
Returned 122880 bytes of ZoneHigh
e820 map has 6 items:
0: 0000000000000000 - 000000000009fc00 = 1 RAM
1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED
2: 00000000000f0000 - 0000000000100000 = 2 RESERVED
3: 0000000000100000 - 00000000265fe000 = 1 RAM
4: 00000000265fe000 - 0000000026600000 = 2 RESERVED
5: 00000000fffbc000 - 0000000100000000 = 2 RESERVED
Unable to lock ram - bridge not found
Changing serial settings was 3/2 now 3/0
enter handle_19:
NULL
Booting from Hard Disk...
Booting from 0000:7c00
[ 1.386940] i8042: No controller found
Loading, please wait...
INIT: version 2.88 booting
[[36minfo[39;49m] Using makefile-style concurrent boot in runlevel S.
[....] Starting the hotplug events dispatcher: udevd[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0c.
[....] Synthesizing the initial hotplug events...[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0cdone.
[....] Waiting for /dev to be fully populated...[ 8.524814] piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0cdone.
[....] Activating swap...[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0cdone.
[....] Checking root file system...fsck from util-linux 2.20.1
fsck.ext4: Operation not permitted while trying to open /dev/sda1
You must have r/w access to the filesystem or be root
fsck died with exit status 8
[?25l[?1c7[1G[[31mFAIL[39;49m8[?25h[?0c[31mfailed (code 8).[39;49m
[....] An automatic file system check (fsck) of the root filesystem failed. A manual fsck must be performed, then the system restarted. The fsck should be performed in maintenance mode with the root filesystem mounted in read-only mode. ...[?25l[?1c7[1G[[31mFAIL[39;49m8[? 25h[?0c [31mfailed![39;49m
[....] The root filesystem is currently mounted in read-only mode. A maintenance shell will now be started. After performing system maintenance, press CONTROL-D to terminate the maintenance shell and restart the system. ...[?25l[?1c7[1G[[33mwarn[39;49m8[?25h[?0c [33m(warning).[39;49m
sulogin: root account is locked, starting shell
root#localhost:~#
Thanks!
You're correct in assuming that the boot disk for a GCE instance needs to appear in read-write mode. The documentation for root persistent disks says:
To start an instance with an existing root persistent disk in gcutil,
provide the boot parameter when you attach the disk. When you create a
root persistent disk using a Google-provided image, you must attach it
to your instance in read-write mode. If you try to attach it in
read-only mode, your instance may be created successfully, but it
won't boot up correctly.