wiselabaep / gmmnlse-solver-final Goto Github PK
View Code? Open in Web Editor NEWSolves the GMMNLSE in MATLAB for pulse propagation in multimode fiber, with an efficient GPU implementation
Solves the GMMNLSE in MATLAB for pulse propagation in multimode fiber, with an efficient GPU implementation
Hi,
I came across a CUDA_ERROR_LAUNCH_FAILED error when trying to run the GMMNLSE_driver_gpu_1550_linear.m file. The full error output is as follows.
Warning: An unexpected error occurred during CUDA execution. The CUDA error was:
CUDA_ERROR_LAUNCH_FAILED
> In GMMNLSE_propagate (line 37)
In GMMNLSE_driver_gpu_1550_linear (line 74)
Error using gpuArray/ifft
An error occurred during PTX compilation of <image>.
The information log was:
The error log was:
The CUDA error code was: CUDA_ERROR_LAUNCH_FAILED.
Error in GMMNLSE_MPA_step (line 96)
Vpl = dt*fft(hrw.*ifft(Vpl));
Error in GMMNLSE_propagate (line 308)
[num_it, last_result] = GMMNLSE_MPA_step(last_result, initial_condition.dt, sim, nonlin_const, mode_info, omegas, D_pos,
D_neg, hrw);
Error in GMMNLSE_driver_gpu_1550_linear (line 74)
prop_output = GMMNLSE_propagate(fiber, initial_condition, sim); % This actually does the propagation
I believe the CUDA and VC toolchains I installed were working just fine. And other .m files like GMMNLSE_driver_gpu_1550_GRINMMS_XPM.m etc worked normally on my PC.
The error may be related to Line 22, fiber.SR = 0*SR;
, in the GMMNLSE_driver_gpu_1550_linear.m file. Once I changed that line to like fiber.SR = 1e-6*SR;
, the error disappeared and the result is almost the same to those shown in the Advanced Example pdf.
This could be a temporary solution for me and I don't know if other people had the same issue. Also, it would be nice if anyone knows a properer solution for this error. Thanks.
I will post my computing environment here for your reference.
Intel Xeon CPU E5-2620 [email protected]
CUDADevice with properties:
Name: 'Quadro K620'
Index: 1
ComputeCapability: '5.0'
SupportsDouble: 1
DriverVersion: 9.1000
ToolkitVersion: 8
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 2.1475e+09
MultiprocessorCount: 3
ClockRateKHz: 1124000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 0
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1
Windows10 Ver.1709
Cuda compilation tools, release 9.1, V9.1.85
Visual C++ 2015 toolset
Hi:
I want to run your process on CPU using the GMMNLSE_ss_step method, but there are some wrong when running it, can you help me, please? The question is below:
Error using .*
Matrix dimensions must agree.
Error in GMMNLSE_ss_step>get_dA_dz (line 99)
Vpl = dt*fft(hrw.*ifft(Vpl));
I checked hrw is a 327681 dimensional matrix, while Vpl is a 32768num_modes*num_modes dimensional matrix, so they can not multiply. On the other hand, when I set sim.fr = 0; sim.sw = 0; then Vpl will be Vpl = zeros(2^15,3,3,'single'); when I run the process again, there are some other wrong,
Matrix dimensions must agree.
Error in GMMNLSE_ss_step>get_dA_dz (line 110)
dA_dz = fft(prefactor.*ifft(Up));
So I want to know how to solve the question, besides, I don't understand the function dA_dz = get_dA_dz(A_t, dt, sim, mode_info, hrw, prefactor), I want to know the meaning of Up, Vpl, T_mn and want to understand how to solving nonlinear interactions.
I really want to run this program successfully, so please help me. At the same time thank you very much for sharing the source code.
Hello,
First of all, thank you for the nice MMGNLSE code.
I am new to CUDA and therefore, find it difficult to understand the calculation of the overlap integrals in the CUDA file.
I would appreciate if anyone can help me to explain the below lines from the Calculate Tensors_single.cu file:
if (full_thread_idx >= nmp4) {
return;
}
// Turn linear index into components
unsigned int midx1 = full_thread_idx % num_modes;
unsigned int midx2 = (full_thread_idx/num_modes) % num_modes;
unsigned int midx3 = (full_thread_idx/num_modes/num_modes) % num_modes;
unsigned int midx4 = (full_thread_idx/num_modes/num_modes/num_modes);
// Compute the sum
for (int i = 0; i < Nx; i++) {
for (int j = 0; j < Nx; j++) {
SR[full_thread_idx] += fields[midx1+i*num_modes+j*Nxnm]*fields[midx2+i*num_modes+j*Nxnm]*fields[midx3+i*num_modes+j*Nxnm]*fields[midx4+i*num_modes+j*Nxnm];
}
}
// Normalize
SR[full_thread_idx] /= norms[midx1]*norms[midx2]*norms[midx3]*norms[midx4];
Thanks in advance!
I mean, setting the incident optical power is not the set energy divided by the TFWHM. Because when I use this program to simulate, many literature give the parameter is power.
Hi all:
Does anyone know why the step number ii begin from 2 not from 1? thanks so much.
%% Run the step function over each step
tic
for ii = 2:z_points
% Print the step number if verbose
if sim.verbose
t_in_loop = tic;
disp(ii)
end
Hello:
Recently, I want to study the energy flowing among different modes in GRIN-MMF. I set the first mode (fundamental mode) with the highest fraction(30%) of total energy. The 2nd mode is about 17%, the 3rd mode is about 17%, the 4th mode is about 17%, and 5th mode is about 17%. Other high order modes play a role as the background.
Unexpectedly, at the output of the fiber, the 3rd mode obtains the most of total energy among all modes. This result dose not conform to the experiment. Therefore, I would like to know which parameters should be pay attention to, when this code is used for simulation?
Hi:
I found a question: the fft function in your program is to transform from frequency domain to time domain, which is opposite to the essence of fft. Why can you do this? thank you so much who can answer my question.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.