This version of the k-Wave Toolbox has been modified by bobqianic. The modifications include adding support for the latest hardware and fixing bugs. These modifications are also distributed under the terms of the GNU Lesser General Public License as specified above.
Important
If you are an Imperial HPC user, please see this
The following guidance is for non-HPC users
Requires at least 8 GiB of RAM (Support Ubuntu, Debian, CentOS)
sudo curl -L https://raw.githubusercontent.com/bobqianic/k-Wave/main/install_lib.sh | bashThe default install location is /usr/local.
If you want to install to a custom location, you can use the following command:
sudo curl -L https://raw.githubusercontent.com/bobqianic/k-Wave/main/install_lib.sh HDF5_DIR ZLIB_DIR SZIP_DIR | bashDownload the latest source code from this repo.
wget https://github.com/bobqianic/k-Wave/archive/refs/heads/main.zipUnzip the souce code.
unzip ./main.zipChange current directory to kspaceFirstOrder-CUDA
cd ./k-Wave-main/kspaceFirstOrder-CUDAModify the CUDA_DIR, HDF5_DIR, ZLIB_DIR, and SZIP_DIR in the Makefile to point to your library installation locations.
CUDA_DIR = "/usr/local/cuda-12.1"
HDF5_DIR = "/usr/local/hdf5"
ZLIB_DIR = "/usr/local/zlib"
SZIP_DIR = "/usr/local/szip"Run make to compile k-Wave.
make -j $(nproc)- Download Visual Studio 2022 (https://visualstudio.microsoft.com/vs/) and install the
Desktop development with C++workload.
- Download and unzip VCPKG source code (https://github.com/microsoft/vcpkg). Run the
bootstrap-vcpkg.batin the folder to compile vcpkg and generate the executable file.
- Run
./vcpkg.exe install --triplet x64-windows hdf5 zlib szipin PowerShell to install libraries.
- Modify
kspaceFirstOrder-CUDA.vcxproj. Replace"$(VCTargetsPath)\BuildCustomizations\CUDA 12.4.props"and"$(VCTargetsPath)\BuildCustomizations\CUDA 12.4.targets"to your CUDA Toolkit version.
For example, if your CUDA Toolkit version is 12.6.X:
"$(VCTargetsPath)\BuildCustomizations\CUDA 12.4.props" -> "$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.props"
"$(VCTargetsPath)\BuildCustomizations\CUDA 12.4.targets" -> "$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.targets"
- Add new CUDA architecture for you GPU to
<CodeGeneration>section if its a newer GPU (B100, B200, RTX5090, etc.)
<CodeGeneration>compute_50,sm_50;compute_52,sm_52;compute_60,sm_60;compute_61,sm_61;compute_70,sm_70;compute_75,sm_75;compute_80,sm_80;compute_86,sm_86;compute_89,sm_89;compute_90,sm_90;</CodeGen
- If you encounter error
LNK1811: cannot open input file 'libszip.lib'/'libhdf5.lib'..., please remove them fromProperties->Linker->Input->Additional Dependencies.
