GPU=1 (GeForce GTX 1080) threadph=244 extra=5760 np=10000000 nthread=40960 maxgate=10 repetition=1initializing streams ... MCXLAB ERROR -13 in unit mcx_core.cu:1185Error: invalid device symbolGreat work Dr. Fang,Have been running MCXLAB using a GTX 770 with CUDA 7.0 and no issues.
Recently got access to a new Pascal architecture GPU card. Plopped it in and tried running basic demo scripts. Got this error:
GPU=1 (GeForce GTX 1080) threadph=244 extra=5760 np=10000000 nthread=40960 maxgate=10 repetition=1initializing streams ... MCXLAB ERROR -13 in unit mcx_core.cu:1185Error: invalid device symbol
I know that CUDA 7.0 or 7.5 doesn't officially support Pascal architecture. Anyone know if there's a quick fix for this in the source, or is this something that's going to have to wait until CUDA 8.0 is out and tested?
--Thanks,
Nich
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To post to this group, send email to mcx-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mcx-users.
For more options, visit https://groups.google.com/d/optout.
Output argument "flux" (and maybe others) not assigned during call to "mcxlab".
E:\Box Sync\Data\mcx\mcx-src-nightly.tar\mcx\src>mingw32-make fermimexprocess_begin: CreateProcess(NULL, uname -s, ...) failed.process_begin: CreateProcess(NULL, uname -s, ...) failed.process_begin: CreateProcess(NULL, uname -m, ...) failed.-z was unexpected at this time.Makefile:166: recipe for target 'cudasdk' failedmingw32-make: *** [cudasdk] Error 255
E:\Box Sync\Data\mcx\mcx-src-nightly.tar\mcx\src>HR2@HR2-PC /cygdrive/e/Box Sync/Data/mcx/mcx-src-nightly.tar/mcx/src$ mingw32-make fermimex/usr/bin/sh: line 0: [: too many argumentsnvcc -c -lineinfo -Xcompiler -Wall -Xcompiler "/openmp /W0" -DUSE_ATOMIC -use_fast_math -DSAVE_DETECTORS -DUSE_CACHEBOX -use_fast_math -arch=sm_20 -DMCX_TARGET_NAME='"Fermi MCX"' --compiler-options "" -DMCX_CONTAINER -o mcx_core.obj mcx_core.cunvcc fatal : Cannot find compiler 'cl.exe' in PATHMakefile:161: recipe for target 'mcx_core.obj' failedmingw32-make: *** [mcx_core.obj] Error 1
Thanks Dr. Fang,
We had some money we had to spend and we're trying to use the software to optimize some imaging parameters, so buying the new card seemed like a good option.
I got the nightly build from July 21, 2016. I'm trying to run the demo_mcxlab_basic.m and I'm getting the common error below, without the mcxlab output even displaying on the screenOutput argument "flux" (and maybe others) not assigned during call to "mcxlab".
I've also downloaded both CUDA 8.0 RC. I've navigated to the ../src/ folder in the extracted nightly build folder. I have both Cygwin64 and MinGW on the system. I'm trying to compile from cmd.exe, this is what I'm getting:
E:\Box Sync\Data\mcx\mcx-src-nightly.tar\mcx\src>mingw32-make fermimexprocess_begin: CreateProcess(NULL, uname -s, ...) failed.process_begin: CreateProcess(NULL, uname -s, ...) failed.process_begin: CreateProcess(NULL, uname -m, ...) failed.-z was unexpected at this time.Makefile:166: recipe for target 'cudasdk' failedmingw32-make: *** [cudasdk] Error 255
E:\Box Sync\Data\mcx\mcx-src-nightly.tar\mcx\src>
And when I try to compile from the same location using the Cygwin64 shell, this is what I get.
HR2@HR2-PC /cygdrive/e/Box Sync/Data/mcx/mcx-src-nightly.tar/mcx/src$ mingw32-make fermimex/usr/bin/sh: line 0: [: too many argumentsnvcc -c -lineinfo -Xcompiler -Wall -Xcompiler "/openmp /W0" -DUSE_ATOMIC -use_fast_math -DSAVE_DETECTORS -DUSE_CACHEBOX -use_fast_math -arch=sm_20 -DMCX_TARGET_NAME='"Fermi MCX"' --compiler-options "" -DMCX_CONTAINER -o mcx_core.obj mcx_core.cunvcc fatal : Cannot find compiler 'cl.exe' in PATHMakefile:161: recipe for target 'mcx_core.obj' failedmingw32-make: *** [mcx_core.obj] Error 1
I've tried a mingw32-make clean also, but the results are the same. I'm not very savvy with C/C++, so I apologize if I'm overlooking something obvious. I called nvcc --version to verify, and it's calling version 8.0. This is a total guess, but is it possible the calls in the makefile describing CUGENCODE are incomplete, only going up to compute capability 5.2 (the GTX 1080 is 6.1).
-arch=sm_20 should work for nd@nd-HR-Mint ~/Downloads/mcx/example/validation $ ./run_validation.sh
###############################################################################
# Monte Carlo eXtreme (MCX) -- CUDA #
# Copyright (c) 2009-2016 Qianqian Fang <q.fang at neu.edu> #
# http://mcx.space/ #
# #
# Computational Imaging Laboratory (CIL) [http://fanglab.org] #
# Department of Bioengineering, Northeastern University #
###############################################################################
# The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365 #
###############################################################################
$Rev::9b5ee4 $ Last $Date::2016-07-02 17:18:52 -04$ by $Author::Qianqian Fang $
###############################################################################
- variant name: [Fermi] compiled for GPU Capability [100] with CUDA [7000]
- compiled with: RNG [xorshift128+] with Seed Length [4]
- this version CAN save photons at the detectors
GPU=1 (GeForce GTX 1080) threadph=2441 extra=16640 np=100000000 nthread=40960 maxgate=50 repetition=1
initializing streams ...
MCX ERROR(-13):invalid device symbol in unit mcx_core.cu:1218
Command exited with non-zero status 243
0.02user 0.12system 0:00.16elapsed 91%CPU (0avgtext+0avgdata 105012maxresident)k
0inputs+0outputs (0major+4345minor)pagefaults 0swaps
nd@nd-HR-Mint ~/Downloads/mcx/src $ make xorpas
cc mcx_core.o mcx_utils.o mcx_shapes.o tictoc.o mcextreme.o cjson/cJSON.o -o ../bin/mcx -L/usr/local/cuda/lib64 -lcudart -lm -lstdc++ -fopenmp
mcx_core.o: In function `mcx_list_gpu':
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x37b): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x3e0): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x956): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x9fb): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0xa72): undefined reference to `mexPrintf'
mcx_core.o:tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0xb9e): more undefined references to `mexPrintf' follow
mcx_utils.o: In function `mcx_error':
/home/nd/Downloads/mcx/src/mcx_utils.c:231: undefined reference to `mcx_throw_exception'
mcx_utils.o: In function `mcx_printheader':
/home/nd/Downloads/mcx/src/mcx_utils.c:1387: undefined reference to `mexPrintf'
collect2: error: ld returned 1 exit status
make: *** [../bin/mcx] Error 1
nd@nd-HR-Mint ~/Downloads/mcx/src $ make pascalmex
mex mcx_core.o mcx_utils.o mcx_shapes.o tictoc.o mcextreme.o cjson/cJSON.o -o ../mcxlab/mcxlab -L/usr/local/cuda/lib64 -lcudart -lm -lstdc++ CXXFLAGS='$CXXFLAGS -DSAVE_DETECTORS -DUSE_CACHEBOX -DMCX_CONTAINER -fopenmp -DUSE_XORSHIFT128P_RAND ' -lgomp LDFLAGS='$LDFLAGS -fopenmp ' mcxlab.cpp -cxx -outdir ../mcxlab -I/usr/local/cuda/include
Unknown MEX argument '-o'.
make: *** [../bin/mcx] Error 255
nd@nd-HR-Mint ~/Downloads/mcx/src $
Dr. Fang,
Thank you for you/your teams swift replies.
I updated the Makefile, and also submitted a github correction in relation to an error I was getting during compilation (Thank you for the Nsight compiler tutorial, very helpful!!!).
After compilation I was able to execute various example scripts using mcx, everything seems to be working, which is great
When trying to compile a Matlab executable, I'm getting an error:
nd@nd-HR-Mint ~/Downloads/mcx/src $ make xorpas
cc mcx_core.o mcx_utils.o mcx_shapes.o tictoc.o mcextreme.o cjson/cJSON.o -o ../bin/mcx -L/usr/local/cuda/lib64 -lcudart -lm -lstdc++ -fopenmp
mcx_core.o: In function `mcx_list_gpu':
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x37b): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x3e0): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x956): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0x9fb): undefined reference to `mexPrintf'
tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0xa72): undefined reference to `mexPrintf'
mcx_core.o:tmpxft_000016c8_00000000-4_mcx_core.cudafe1.cpp:(.text+0xb9e): more undefined references to `mexPrintf' follow
mcx_utils.o: In function `mcx_error':
/home/nd/Downloads/mcx/src/mcx_utils.c:231: undefined reference to `mcx_throw_exception'
mcx_utils.o: In function `mcx_printheader':
/home/nd/Downloads/mcx/src/mcx_utils.c:1387: undefined reference to `mexPrintf'
collect2: error: ld returned 1 exit status
make: *** [../bin/mcx] Error 1
nd@nd-HR-Mint ~/Downloads/mcx/src $ make pascalmex
mex mcx_core.o mcx_utils.o mcx_shapes.o tictoc.o mcextreme.o cjson/cJSON.o -o ../mcxlab/mcxlab -L/usr/local/cuda/lib64 -lcudart -lm -lstdc++ CXXFLAGS='$CXXFLAGS -DSAVE_DETECTORS -DUSE_CACHEBOX -DMCX_CONTAINER -fopenmp -DUSE_XORSHIFT128P_RAND ' -lgomp LDFLAGS='$LDFLAGS -fopenmp ' mcxlab.cpp -cxx -outdir ../mcxlab -I/usr/local/cuda/include
Unknown MEX argument '-o'.
make: *** [../bin/mcx] Error 255
nd@nd-HR-Mint ~/Downloads/mcx/src $
make clean
make pascalmex
mex mcx_core.o mcx_utils.o mcx_shapes.o tictoc.o mcextreme.o cjson/cJSON.o-output../mcxlab/mcxlab -L/usr/local/cuda/lib64 -lcudart -lm -lstdc++ CXXFLAGS='$CXXFLAGS -DSAVE_DETECTORS -DUSE_CACHEBOX -DMCX_CONTAINER -fopenmp -DUSE_XORSHIFT128P_RAND ' -lgomp LDFLAGS='$LDFLAGS -fopenmp ' mcxlab.cpp -cxx -outdir ../mcxlab -I/usr/local/cuda/include
nd@nd-HR-Mint ~/Downloads/mcx/src $ make clean
rm -f mcx_core.o mcx_utils.o mcx_shapes.o tictoc.o mcextreme.o cjson/cJSON.o ../bin/mcx ../bin/mcx_atomic ../bin/mcx_det
nd@nd-HR-Mint ~/Downloads/mcx/src $ make pascalmex
nvcc -c -lineinfo -Xcompiler -Wall -Xcompiler -fopenmp -m64 -DUSE_XORSHIFT128P_RAND -DUSE_ATOMIC -use_fast_math -DSAVE_DETECTORS -DUSE_CACHEBOX -use_fast_math -arch=compute_20 -code=sm_20 -code=sm_30 -code=sm_35 -code=sm_50 -code=sm_52 -code=sm_61 -DMCX_TARGET_NAME='"Fermi MCX"' --compiler-options "-fPIC" -DMCX_CONTAINER -o mcx_core.o mcx_core.cu
nvcc fatal : Value 'sm_61' is not defined for option 'gpu-code'
make: *** [mcx_core.o] Error 1
pascaloct pascalmex: CUGENCODE=-arch=compute_20 -code=sm_20 -code=sm_30 -code=sm_35 -code=sm_50 -code=sm_52 -code=sm_61
...
pascal: CUGENCODE=-arch=compute_20 -code=sm_20 -code=sm_30 -code=sm_35 -code=sm_50 -code=sm_52 -code=sm_61
Hi Nicholas,According to nvcc, compiling with -arch=compute_20 should generate the IR (PTX) for all compute capabilities (including the recent one sm_61), and when you run mcx, it should create the respective binary for sm_61. So I would say try to compile with just -arch=compute_20 (none sm_xx specified)
Hi Nicholas,libcudart error is because the environment variable wasn't able to be set properly. Try to check it using:echo $LD_LIBRARY_PATHYou should get the path of your library something like: /usr/local/cuda-8.0/lib64
If not, please export your environment variable using:
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
Also, you can add the last line to your bash profile so it will be added for each time that you log in to that machine.
Could you checknvidia-smiThis should list GPU cards. What I see is that the CUDA framework is not able to see your card.
However, when I run the binary ../bin/mcx -L, the error is differentI corrected the issues with LD_LIBRARY_PATH. For some reason, even when I define it in the .bash_profile file, it's not recognized, but I explicitly define it for the terminal session and it worked.Anyway, I recompiled both the mcx binary and the mcxlab binary. When I try to run the demo_mcxlab_basic, I'm getting the same error
{Invalid MEX-file '/home/nd/Downloads/mcx/mcxlab/mcxlab.mexa64': libcudart.so.8.0: cannot open shared
object file: No such file or directory}
{No CUDA-capable GPU device found
MCX ERROR(-1):No GPU device found
in unit mcextreme.c:37}
which nvcc
nvcc -V
echo $SHELL
echo $LD_LIBRARY_PATH
cd /path/to/mcx/bin/
ldd mcx
matlab -nojvm", and type
! echo $LD_LIBRARY_PATH
! ldd /path/to/mcx/mcxlab/mcxlab.mexa64--
"which nvccnvcc -Vecho $SHELLecho $LD_LIBRARY_PATH
nd@nd-HR-Mint ~/Downloads/mcx/bin $ which nvcc
/usr/local/cuda/bin/nvcc
nd@nd-HR-Mint ~/Downloads/mcx/bin $ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Wed_May__4_21:01:56_CDT_2016
Cuda compilation tools, release 8.0, V8.0.26
nd@nd-HR-Mint ~/Downloads/mcx/bin $ echo $SHELL
/bin/bash
nd@nd-HR-Mint ~/Downloads/mcx/bin $ echo $LD_LIBRARY_PATH
/usr/local/cuda/lib64
nd@nd-HR-Mint ~/Downloads/mcx/bin $
nd@nd-HR-Mint ~/Downloads/mcx/bin $ ldd mcx
linux-vdso.so.1 => (0x00007fffcbb38000)
libcudart.so.8.0 => /usr/local/cuda/lib64/libcudart.so.8.0 (0x00007fe8814b3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe8811ad000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe880ea9000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fe880c9a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe880a7c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe8806b7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe8804b3000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe8802ab000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe881714000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe880095000)
in the same shell, run "matlab -nojvm", and type
! echo $LD_LIBRARY_PATH
! ldd /path/to/mcx/mcxlab/mcxlab.mexa64
nd@nd-HR-Mint ~/Downloads/mcx/bin $ matlab -nojvm
< M A T L A B (R) >
Copyright 1984-2016 The MathWorks, Inc.
R2016a (9.0.0.341360) 64-bit (glnxa64)
February 11, 2016
For online documentation, see http://www.mathworks.com/support
For product information, visit www.mathworks.com.
Academic License
>> ! echo $LD_LIBRARY_PATH
/home/MATLAB/R2016a/sys/opengl/lib/glnxa64:/home/MATLAB/R2016a/sys/os/glnxa64:/home/MATLAB/R2016a/bin/glnxa64:/home/MATLAB/R2016a/extern/lib/glnxa64:/home/MATLAB/R2016a/runtime/glnxa64:/home/MATLAB/R2016a/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/home/MATLAB/R2016a/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/cuda/lib64
>> ! ldd ~/Downloads/mcx/mcxlab/mcxlab.mexa64
linux-vdso.so.1 => (0x00007ffc6d6f5000)
libcudart.so.8.0 => /usr/local/cuda/lib64/libcudart.so.8.0 (0x00007fe5a19a0000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe5a169c000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fe5a148d000)
libmx.so => /home/MATLAB/R2016a/bin/glnxa64/libmx.so (0x00007fe5a10f6000)
libmex.so => /home/MATLAB/R2016a/bin/glnxa64/libmex.so (0x00007fe5a0ec7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe5a0bc1000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe5a09ab000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe5a05e6000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe5a03e2000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe5a01c4000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe59ffbc000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe5a1e33000)
libmwresource_core.so => /home/MATLAB/R2016a/bin/glnxa64/libmwresource_core.so (0x00007fe59fdba000)
libmwi18n.so => /home/MATLAB/R2016a/bin/glnxa64/libmwi18n.so (0x00007fe59fa96000)
libut.so => /home/MATLAB/R2016a/bin/glnxa64/libut.so (0x00007fe59f7d4000)
libmwfl.so => /home/MATLAB/R2016a/bin/glnxa64/libmwfl.so (0x00007fe59f3ce000)
libboost_chrono.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_chrono.so.1.56.0 (0x00007fe59f1c7000)
libboost_date_time.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_date_time.so.1.56.0 (0x00007fe59efb7000)
libboost_filesystem.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_filesystem.so.1.56.0 (0x00007fe59eda2000)
libboost_log.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_log.so.1.56.0 (0x00007fe59eaca000)
libboost_regex.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_regex.so.1.56.0 (0x00007fe59e7ac000)
libboost_signals.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_signals.so.1.56.0 (0x00007fe59e594000)
libboost_system.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_system.so.1.56.0 (0x00007fe59e391000)
libboost_thread.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_thread.so.1.56.0 (0x00007fe59e16c000)
libmwcpp11compat.so => /home/MATLAB/R2016a/bin/glnxa64/libmwcpp11compat.so (0x00007fe59df57000)
libicudata.so.54 => /home/MATLAB/R2016a/bin/glnxa64/libicudata.so.54 (0x00007fe59c52b000)
libicuuc.so.54 => /home/MATLAB/R2016a/bin/glnxa64/libicuuc.so.54 (0x00007fe59c19f000)
libicui18n.so.54 => /home/MATLAB/R2016a/bin/glnxa64/libicui18n.so.54 (0x00007fe59bd50000)
libicuio.so.54 => /home/MATLAB/R2016a/bin/glnxa64/libicuio.so.54 (0x00007fe59bb43000)
libtbb.so.2 => /home/MATLAB/R2016a/bin/glnxa64/libtbb.so.2 (0x00007fe59b8f8000)
libtbbmalloc.so.2 => /home/MATLAB/R2016a/bin/glnxa64/libtbbmalloc.so.2 (0x00007fe59b6a6000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe59b48d000)
libmwservices.so => /home/MATLAB/R2016a/bin/glnxa64/libmwservices.so (0x00007fe59ad4e000)
libmwmpath.so => /home/MATLAB/R2016a/bin/glnxa64/libmwmpath.so (0x00007fe59aac5000)
libmwm_dispatcher.so => /home/MATLAB/R2016a/bin/glnxa64/libmwm_dispatcher.so (0x00007fe59a7cf000)
libmwmlutil.so => /home/MATLAB/R2016a/bin/glnxa64/libmwmlutil.so (0x00007fe599f71000)
libexpat.so.1 => /home/MATLAB/R2016a/bin/glnxa64/libexpat.so.1 (0x00007fe599d49000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fe599b10000)
libboost_serialization.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_serialization.so.1.56.0 (0x00007fe5998aa000)
libunwind.so.8 => /home/MATLAB/R2016a/bin/glnxa64/libunwind.so.8 (0x00007fe59968b000)
libssl.so.1.0.0 => /home/MATLAB/R2016a/bin/glnxa64/libssl.so.1.0.0 (0x00007fe599420000)
libcrypto.so.1.0.0 => /home/MATLAB/R2016a/bin/glnxa64/libcrypto.so.1.0.0 (0x00007fe59903d000)
libmwdisplay_device.so => /home/MATLAB/R2016a/bin/glnxa64/libmwdisplay_device.so (0x00007fe598e36000)
libmwregexp.so => /home/MATLAB/R2016a/bin/glnxa64/libmwregexp.so (0x00007fe598bee000)
libmwsettingscore.so => /home/MATLAB/R2016a/bin/glnxa64/libmwsettingscore.so (0x00007fe598776000)
libmwms.so => /home/MATLAB/R2016a/bin/glnxa64/libmwms.so (0x00007fe5980c4000)
libmwnativedisplay.so => /home/MATLAB/R2016a/bin/glnxa64/libmwnativedisplay.so (0x00007fe597eba000)
libmwopccore.so => /home/MATLAB/R2016a/bin/glnxa64/libmwopccore.so (0x00007fe597c5a000)
libmwopcmodel.so => /home/MATLAB/R2016a/bin/glnxa64/libmwopcmodel.so (0x00007fe5979d3000)
libmwopczippackage.so => /home/MATLAB/R2016a/bin/glnxa64/libmwopczippackage.so (0x00007fe5977af000)
libmwopcmwservices.so => /home/MATLAB/R2016a/bin/glnxa64/libmwopcmwservices.so (0x00007fe5972bb000)
libmwwebproxy.so => /home/MATLAB/R2016a/bin/glnxa64/libmwwebproxy.so (0x00007fe5970ae000)
libmwmcos.so => /home/MATLAB/R2016a/bin/glnxa64/libmwmcos.so (0x00007fe596e60000)
libboost_iostreams.so.1.56.0 => /home/MATLAB/R2016a/bin/glnxa64/libboost_iostreams.so.1.56.0 (0x00007fe596c4c000)
libCppMicroServices.so.2.1.0 => /home/MATLAB/R2016a/bin/glnxa64/libCppMicroServices.so.2.1.0 (0x00007fe5969b5000)
libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007fe596792000)
libPocoCrypto.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoCrypto.so.23 (0x00007fe596570000)
libPocoFoundation.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoFoundation.so.23 (0x00007fe5961bc000)
libPocoJSON.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoJSON.so.23 (0x00007fe595f6f000)
libPocoNet.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoNet.so.23 (0x00007fe595c65000)
libPocoNetSSL.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoNetSSL.so.23 (0x00007fe595a24000)
libPocoUtil.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoUtil.so.23 (0x00007fe5957b9000)
libPocoXML.so.23 => /home/MATLAB/R2016a/bin/glnxa64/libPocoXML.so.23 (0x00007fe59552c000)
libxerces-c-3.1.so => /home/MATLAB/R2016a/bin/glnxa64/libxerces-c-3.1.so (0x00007fe594ea7000)
libmwflnetwork.so => /home/MATLAB/R2016a/bin/glnxa64/libmwflnetwork.so (0x00007fe594bc5000)
libmwflstoragevfs.so => /home/MATLAB/R2016a/bin/glnxa64/libmwflstoragevfs.so (0x00007fe5948ff000)
libmwflstorageprovider.so => /home/MATLAB/R2016a/bin/glnxa64/libmwflstorageprovider.so (0x00007fe59467f000)
libmwstorageshlibstoragesys.so => /home/MATLAB/R2016a/bin/glnxa64/libmwstorageshlibstoragesys.so (0x00007fe594436000)
libmwxmlcore.so => /home/MATLAB/R2016a/bin/glnxa64/libmwxmlcore.so (0x00007fe5941bf000)
libminizip.so => /home/MATLAB/R2016a/bin/glnxa64/libminizip.so (0x00007fe593fb3000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fe593d8a000)
libmwflstorageevents.so => /home/MATLAB/R2016a/bin/glnxa64/libmwflstorageevents.so (0x00007fe593b84000)
libmwstoragesharedlib.so => /home/MATLAB/R2016a/bin/glnxa64/libmwstoragesharedlib.so (0x00007fe59396c000)
Dr. Fang,
Apologies for missing your earlier reply. Here is what you requested
"which nvcc
nvcc -V
echo $SHELL
echo $LD_LIBRARY_PATH
gedit /etc/apt/sources.list
Added the following lines at the end of the filedeb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe deb http://dk.archive.ubuntu.com/ubuntu/ trusty-updates main universe
Save file and run the following:sudo apt-get update
sudo apt-get install gcc-4.8
sudo apt-get install g++-4.8sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
Verify that the system is using the correct version with gcc --version
5. Close the x-server service in order to install the driver with sudo service lightdm stop
6. Log back in on the command line and navigate to driver location, install with sudo sh ./NVIDIA-Linux-x86_64-367.18.run
7. Complete installation and sudo service lightdm restart if desired
8. Navigate to the location of cuda_8.0.27_linux.run file and sudo sh ./cuda_8.0.27_linux.run to install
Complete installation with desired options (samples, links, etc.)10. Update PATH and LD_LIBRARY_PATH variables to include folder with nvcc and libcuda64, respectively - I did the following:sudo nano ~/.profile
Added the following lines
PATH=$PATH:/usr/local/cuda-8.0/bin
export PATH
LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64
export LD_LIBRARY_PATH
Save file
11. Reboot and verify settings with the following:nvcc -Vecho $PATHecho $LD_LIBRARY_PATH
Quirky thing is that a call to nvidia-smi doesn't recognize the GPU, it lists it as "Graphics Device", but the memory, temperature, etc. appear to be recognized correctly
I'm not proficient with Linux at all, so if there are obvious mistakes or unnecessary steps I've done, feel free to correct me. Hope this helps.
Cheers,
NichI finally got mcx and mcxlab working with a GTX 1080 in Ubuntu 16.04 using CUDA 8.0 and NVIDIA-367.18 driver.
Here's the steps I took from a fresh install of Ubuntu 16.04 (only offer 64bit version):
1. Download NVIDIA-Linux-x86_64-367.18.run driver file (http://www.geforce.com/drivers/results/103732)
2. Download CUDA Toolkit 8.0 cuda_8.0.27_linux.run file (https://developer.nvidia.com/cuda-toolkit)
3. CUDA 8.0 isn't compatible with gcc-5, so I installed gcc and g++ 4.8 in the following way
gedit /etc/apt/sources.list
Added the following lines at the end of the file
deb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe deb http://dk.archive.ubuntu.com/ubuntu/ trusty-updates main universe Save file and run the following:sudo apt-get update sudo apt-get install gcc-4.8 sudo apt-get install g++-4.8sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10Verify that the system is using the correct version with gcc --version5. Close the x-server service in order to install the driver with sudo service lightdm stop 6. Log back in on the command line and navigate to driver location, install with sudo sh ./NVIDIA-Linux-x86_64-367.18.run 7. Complete installation and sudo service lightdm restart if desired 8. Navigate to the location of cuda_8.0.27_linux.run file and sudo sh ./cuda_8.0.27_linux.run to installIMPORTANT: Do not install the driver version 361 when prompted
9.Complete installation with desired options (samples, links, etc.)
10. Update PATH and LD_LIBRARY_PATH variables to include folder with nvcc and libcuda64, respectively - I did the following:
sudo nano ~/.profile
Added the following lines
PATH=$PATH:/usr/local/cuda-8.0/bin
export PATH
LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64
export LD_LIBRARY_PATH
Save file
11. Reboot and verify settings with the following:
nvcc -V
echo $PATH
echo $LD_LIBRARY_PATH
Quirky thing is that a call to nvidia-smi doesn't recognize the GPU, it lists it as "Graphics Device", but the memory, temperature, etc. appear to be recognized correctly
I'm not proficient with Linux at all, so if there are obvious mistakes or unnecessary steps I've done, feel free to correct me. Hope this helps.
Cheers,
Nich
6. Log back in on the command line and navigate to driver location, install with sudo sh ./NVIDIA-Linux-x86_64-367.18.runsudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-367 libcuda1-367Great work Dr. Fang,Have been running MCXLAB using a GTX 770 with CUDA 7.0 and no issues.Recently got access to a new Pascal architecture GPU card. Plopped it in and tried running basic demo scripts. Got this error:
GPU=1 (GeForce GTX 1080) threadph=244 extra=5760 np=10000000 nthread=40960 maxgate=10 repetition=1initializing streams ... MCXLAB ERROR -13 in unit mcx_core.cu:1185Error: invalid device symbol
I know that CUDA 7.0 or 7.5 doesn't officially support Pascal architecture. Anyone know if there's a quick fix for this in the source, or is this something that's going to have to wait until CUDA 8.0 is out and tested?
Thanks,Nich
Hi Dr. Fang and Nicholas,
Thanks for this excellent discussion.
I am new to CUDA and MCX. We recently got a dual 1080 workstation and I have been trying to setup and run MCX for the past week. Currently we have WIN10-64bit installed and I managed to compile MCX and MCXLAB with CUDA 8.0 toolkit and Driver Version 368.81. I had to make some changes to the MAKEFILE included in the mcx-nightly distribution and some tweaks in the MEX configuration file before I could successfully compile. I ran the benchmark examples and posted some results here.
The results are not very impressive when compared to the 980's and what Dr.Fang managed to get on his 1080. I tried to go back to CUDA7.5 as suggested by Dr. Fang, but I get a compilation error saying, "sm61 is not a valid gpu-id". Is there any other tweaks I could try to improve performance on Windows, without resorting to UBUNTU ?
nvcc -c -lineinfo -Xcompiler -Wall -Xcompiler -fopenmp -m64
-DUSE_ATOMIC -use_fast_math -DSAVE_DETECTORS -DUSE_CACHEBOX
-use_fast_math -arch=sm_20 -DMCX_TARGET_NAME='"Fermi MCX"'
-DUSE_XORSHIFT128P_RAND -o mcx_core.o mcx_core.cu
where most -D____ flags are important. If you miss any one of
the flags, -DUSE_XORSHIFT128P_RAND line -use_fast_math
will also giveI also ran into a peculiar error with MCXLAB. When I run the benchmark problems from command line using the MCX binary, the results seem fine for both single and dual GPU simulations. But, when I use MCXLAB to run the benchmark problems, the single GPU runs yield similar statistics as running from command line, but the dual GPU runs returned an "output absorption fraction is incorrect" error.
I ran some diagnostics and found that the flux values returned for both MCX (data in the MC2 output file) and MCXLAB (flux.data returned by mcxlab(cfg)) simulations are same, but the "energytot" and "energyabs" variables do not agree for the dual GPU simulations. I am attaching some screenshots of the results. I am wondering if this behavior is caused by some incorrect compilation of the MEX file on my side or there is something I am missing.
Looking forward for your suggestions.
Thanks!
Elan
On Wednesday, July 20, 2016 at 7:46:11 PM UTC-5, Nicholas Dana wrote:Great work Dr. Fang,Have been running MCXLAB using a GTX 770 with CUDA 7.0 and no issues.
Recently got access to a new Pascal architecture GPU card. Plopped it in and tried running basic demo scripts. Got this error:
GPU=1 (GeForce GTX 1080) threadph=244 extra=5760 np=10000000 nthread=40960 maxgate=10 repetition=1initializing streams ... MCXLAB ERROR -13 in unit mcx_core.cu:1185Error: invalid device symbol
I know that CUDA 7.0 or 7.5 doesn't officially support Pascal architecture. Anyone know if there's a quick fix for this in the source, or is this something that's going to have to wait until CUDA 8.0 is out and tested?
Thanks,
Nich
--
Thanks for the quick reply Dr. Fang.
The new Makefile worked and with CUDA7.5, my results are on top. Thanks a bunch for saving me from going through the trouble of installing UBUNTU!
I am attaching the edited Makefile with the tweaks I made and also the screen shots of my compilation.
There is one more tweak I had to make to the mex config file:
1. In Matlab, type: mex -setup c++Also initially I was constantly getting timed out errors when I tried to run the example problems, even if I tried to run on a dedicated CUDA GPU and I followed the instructions on this link to modify Windows registry and now everything is stable.
2. Open the xml file returned by the above command.
3. Replace '/MD' flags with '/MT' in the CODEFLAGS variable.
4. This will help to avoid dynamic library vs static library mismatch that happened when compiling MCXLAB using mex and linking to the other source file compiled using nvcc.
Regarding the MCXLAB error, it happened for all Dual GPU runs and I had to get around it by multiplying 2 to the "flux.stat.energytot" variable in the IF condition for benchmarks 1 and 2. Benchmark 3 does not check for that condition. Sorry, I forgot to include this detail in my previous post.
Thanks,
Elan
On Wednesday, July 20, 2016 at 7:46:11 PM UTC-5, Nicholas Dana wrote:Great work Dr. Fang,Have been running MCXLAB using a GTX 770 with CUDA 7.0 and no issues.
Recently got access to a new Pascal architecture GPU card. Plopped it in and tried running basic demo scripts. Got this error:
GPU=1 (GeForce GTX 1080) threadph=244 extra=5760 np=10000000 nthread=40960 maxgate=10 repetition=1initializing streams ... MCXLAB ERROR -13 in unit mcx_core.cu:1185Error: invalid device symbol
I know that CUDA 7.0 or 7.5 doesn't officially support Pascal architecture. Anyone know if there's a quick fix for this in the source, or is this something that's going to have to wait until CUDA 8.0 is out and tested?
Thanks,
Nich
--
thanks for sharing your mods to the Makefile. I had been using
VS for compiling mcx, but for the past few releases, I switched
to cygwin gcc. It looks compiling with VS seems to be smooth
with your makefile. I will definitely give it a try.
On a side note, I think you should do a "make clean" before
moving to "make -f ... mex". There are a couple of macro
defined for matlab in the .c units, you had to recompile
those with make mex.
Apparently, without those, you can still run mcxlab, but I
guess you will not be able to see the printed outputs
and maybe error handling (such as quitting matlab when
an exception is caught).
HR2@HR2-PC /cygdrive/e/Box Sync/Data/mcx/mcx-src-nightly-20160815/src$ make cleanrm -f mcx_core.obj mcx_utils.obj mcx_shapes.obj tictoc.obj mcextreme.obj cjson/cJSON.obj ../bin/mcx.exe ../bin/mcx_atomic.exe ../bin/mcx_det.exe
HR2@HR2-PC /cygdrive/e/Box Sync/Data/mcx/mcx-src-nightly-20160815/src$ make -f MakefileCF mexMakefileCF:184: warning: overriding recipe for target '../bin/mcx'MakefileCF:172: warning: ignoring old recipe for target '../bin/mcx'/bin/sh: line 0: [: too many argumentsnvcc -c -lineinfo -Xcompiler -Wall -Xcompiler "/openmp /W0" -DUSE_ATOMIC -use_fast_math -DSAVE_DETECTORS -DUSE_CACHEBOX -use_fast_math -arch=sm_20 -DMCX_TARGET_NAME='"Fermi MCX"' --compiler-options "" -DMCX_CONTAINER -DUSE_XORSHIFT128P_RAND -o mcx_core.obj mcx_core.cue:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1333) : warning C4701: potentially uninitialized local variable 'gdebugdata' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1333) : warning C4703: potentially uninitialized local pointer variable 'gdebugdata' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1296) : warning C4701: potentially uninitialized local variable 'greplayw' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1296) : warning C4703: potentially uninitialized local pointer variable 'greplayw' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1296) : warning C4701: potentially uninitialized local variable 'greplaytof' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1296) : warning C4703: potentially uninitialized local pointer variable 'greplaytof' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1232) : warning C4701: potentially uninitialized local variable 'gsrcpattern' usede:\box sync\data\mcx\mcx-src-nightly-20160815\src\mcx_core.cu(1232) : warning C4703: potentially uninitialized local pointer variable 'gsrcpattern' usednvcc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I/c/CUDA/include -c -D_CRT_SECURE_NO_DEPRECATE -DWIN32 -Xcompiler /openmp -DMCX_CONTAINER -c -o mcx_utils.obj mcx_utils.cmcx_utils.cnvcc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I/c/CUDA/include -c -D_CRT_SECURE_NO_DEPRECATE -DWIN32 -Xcompiler /openmp -DMCX_CONTAINER -c -o mcx_shapes.obj mcx_shapes.cmcx_shapes.cnvcc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I/c/CUDA/include -c -D_CRT_SECURE_NO_DEPRECATE -DWIN32 -Xcompiler /openmp -DMCX_CONTAINER -c -o tictoc.obj tictoc.ctictoc.cnvcc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I/c/CUDA/include -c -D_CRT_SECURE_NO_DEPRECATE -DWIN32 -Xcompiler /openmp -DMCX_CONTAINER -c -o mcextreme.obj mcextreme.cmcextreme.cnvcc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I/c/CUDA/include -c -D_CRT_SECURE_NO_DEPRECATE -DWIN32 -Xcompiler /openmp -DMCX_CONTAINER -c -o cjson/cJSON.obj cjson/cJSON.ccJSON.cmex.bat mcx_core.obj mcx_utils.obj mcx_shapes.obj tictoc.obj mcextreme.obj cjson/cJSON.obj -output ../mcxlab/mcxlab -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\x64" -lcudart mcxlab.cpp -cxx -outdir ../mcxlab -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I/c/CUDA/include'C:\Program' is not recognized as an internal or external command,operable program or batch file.make: *** [MakefileCF:184: ../bin/mcx] Error 1