Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue executing CPU binary #252

Closed
waltsims opened this issue Jan 15, 2024 · 1 comment
Closed

[BUG] Issue executing CPU binary #252

waltsims opened this issue Jan 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@waltsims
Copy link
Owner

waltsims commented Jan 15, 2024

Describe the bug

I have encountered an execution error likely related to the cross-compilation compatibility of the CPU binaries. When running a simple example with:

 execution_options = SimulationExecutionOptions(is_gpu_simulation=False)

I get the following error:

/bin/sh: 1: /home/wsimson/git/k-wave-python/kwave/bin/linux/kspaceFirstOrder-OMP: Exec format error

To Reproduce

Here is the full example code:

import numpy as np
from kwave.data import Vector
from kwave.kgrid import kWaveGrid
from kwave.kmedium import kWaveMedium
from kwave.ksensor import kSensor
from kwave.ksource import kSource
from kwave.kspaceFirstOrder2D import kspaceFirstOrder2DC
from kwave.options.simulation_execution_options import SimulationExecutionOptions
from kwave.options.simulation_options import SimulationOptions
from kwave.utils.conversion import cart2grid
from kwave.utils.kwave_array import kWaveArray
from kwave.utils.mapgen import make_cart_circle, make_disc
from kwave.utils.signals import reorder_binary_sensor_data

phantom_path = 'phantom_data.mat'
density_map_path = '../density_map.mat'

density_map = np.ones((512,512)) * 1000
phantom = np.zeros((512, 512))



# grid
PMLSize = Vector([20, 20])
grid_dsize = Vector([1e-4, 1e-4])
grid_pixel = Vector([512, 512])
kgrid = kWaveGrid(grid_pixel, grid_dsize)

# medium
medium = kWaveMedium(
    sound_speed=1.5*density_map,
    density=density_map,
    alpha_coeff=0.75,
    alpha_power=1.5,
    BonA=6
)
kgrid.makeTime(medium.sound_speed)

# sensor
sensor = kSensor()
sensor_mask = np.zeros(grid_pixel)
sensor_radius = 200
sensor_angle = 2*np.pi
sensor_pos = grid_dsize / 2
sensor_points = 100
sensor_mask_idx = make_cart_circle(
    radius=sensor_radius,
    num_points=sensor_points,
    arc_angle=sensor_angle,
).astype(np.int16)
for x, y in sensor_mask_idx.T:
    sensor_mask[x, y] = 1
sensor.mask = sensor_mask

# source
source = kSource()
x = 250
y = 300
source_radius = 5
disc = make_disc(
    grid_size=grid_pixel,
    center=Vector([x, y]),
    radius=source_radius
)

source.p0 = phantom + disc

# simulation
simulation_options = SimulationOptions(
    pml_size=PMLSize,
    pml_inside=False,
    save_to_disk=True
)

execution_options = SimulationExecutionOptions(is_gpu_simulation=False)

sensor_data = kspaceFirstOrder2D(
    kgrid=kgrid,
    source=source,
    sensor=sensor,
    medium=medium,
    simulation_options=simulation_options,
    execution_options=execution_options)

Desktop (please complete the following information):

  • OS: Linux 5.15.0-88-generic
  • Version: k-wave-python commit e057f87
  • Python Version: 3.8.10
    Additional context
    lscpu output:

Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
Address sizes:                      46 bits physical, 48 bits virtual
CPU(s):                             20
On-line CPU(s) list:                0-19
Thread(s) per core:                 1
Core(s) per socket:                 12
Socket(s):                          1
NUMA node(s):                       1
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              151
Model name:                         12th Gen Intel(R) Core(TM) i7-12700K

@waltsims waltsims added the bug Something isn't working label Jan 15, 2024
@waltsims waltsims added this to the v0.3.3 milestone Feb 27, 2024
@waltsims waltsims self-assigned this Feb 27, 2024
@waltsims waltsims modified the milestones: v0.3.3, v0.3.4 Apr 1, 2024
@waltsims
Copy link
Owner Author

could not reproduce. closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant