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

Unable to successfully run examples #14

Open
nmsutton opened this issue Sep 2, 2021 · 4 comments
Open

Unable to successfully run examples #14

nmsutton opened this issue Sep 2, 2021 · 4 comments

Comments

@nmsutton
Copy link

nmsutton commented Sep 2, 2021

I made some updates for CUDA 11 and was able to install CARLsim 5.0 and it reported installing with no errors. However, when I run the hello_world project I am getting a “Segmentation fault (core dumped)” error and CARLsim does not appear to detect and use my graphics card. I tried the 5.0 stable version and latest dev version with the same results. Please tell me, what can I do to try to get the software working for me?

I read in issue 7 that running in GPU mode potentially fixes the issue, so my primary interest is how to get CARLsim using my GPU instead of CPU. I suspect that CARLsim does not yet know how to use my Nvidia 30 series GPU (relatively new tech). I would be glad to help work on the code to get this working if someone could please help point me in a useful direction.

Install records from 5.0 stable version:
system_specs.txt
installation_notes.docx
CARLsim5_make_record.txt
CARLsim5_install_record.txt
CARLsim5_hello_world_record.txt
CARLsim5_make_test_record.txt

@nmsutton
Copy link
Author

nmsutton commented Sep 3, 2021

Some good news is that I found a way to get the helloworld example to work. In "carlsim.h", I changed the "preferredSimMode = CPU_MODE" to "preferredSimMode = GPU_MODE" and recompiled CARLsim. This was able to run the software using my GPU successfully. However, when I try to run the test regression suite or example "lif_izhi_random_spnet" I am getting an error CUDA error at carlsim/kernel/src/gpu_module/snn_gpu_module.cu:328 code=13(cudaErrorInvalidSymbol) "cudaMemcpyToSymbol(loadBufferCount, &bufferCnt, sizeof(int), 0, cudaMemcpyHostToDevice)"

Upon Googling such a cudaMemcpyToSymbol error I found "you don’t have device code compiled in that supports the correct compute capability level" (source). Might CARLsim need to have code added to it to support a newer GPU (Nvidia 30 series) and compute capability (8.6) like mine? Could anyone please point me toward generally where that may be able to be added in the code?

Records:
CARLsim5_lif_izhi_random_spnet_record.txt
CARLsim5_make_test_record_2.txt

@nmsutton
Copy link
Author

nmsutton commented Sep 4, 2021

I tried downgrading to CUDA 10.1 and compiling CARLsim5 with GCC 8.5 instead of 11.2 but still I am getting the same error.

@nmsutton
Copy link
Author

nmsutton commented Sep 6, 2021

After swapping in my older Nvidia GTX 680 card I was able to get CARLsim5 to it appears work on Ubuntu 21.10. It successfully ran a couple of example projects and it seems most test cases in "make test" (63/65 and crash on 65). I needed to compile it with CUDA 10.1 and GCC 7.5 to get it working. This is related to the observation @SigmaX made in issue 4 that newer GCC versions do not appear to be compatible with CARLsim. When I swapped back in my Nvidia RTX 3090 card it creates the same cudaErrorInvalidSymbol error. This leads me to think that something about the newer graphics card is not correctly processed by CARLsim5. One clue is that "make test" now reports "MapSMtoCores for SM 8.6 is undefined. Default to use 64 Cores/SM" in addition to that error. Could anyone please point me in the direction of where additional settings may need to be included in CARLsim code for new graphics cards?

@nmsutton
Copy link
Author

nmsutton commented Sep 7, 2021

Looks like I got it running at least at a basic level. I added:
GENCODE_SM86 := -gencode arch=compute_86,code=sm_86
$(eval NVCCFL += $(GENCODE_SM86))
to carlsim/configure.mk. This adds more compatibility with my GPU which has a compute capability of 8.6.
I am using CUDA 11.4, GCC 7.5, Ubuntu 21.10. CARLsim5 is now able to pass 63/65 tests attempted with "make test" and crashes on the 65th test with:
[ RUN ] MultiRuntimes.spikesSingleVsMultiX2_2_GPU_MultiGPU
carlsim_tests: carlsim/kernel/src/gpu_module/snn_gpu_module.cu:3583: void SNN::checkAndSetGPUDevice(int): Assertion 'netId >= 0 && netId < numAvailableGPUs' failed.
It also successfully runs with GPU mode some examples and tutorial projects but fails/hangs some.
I will create a push request with the modifications I made to get it to work on the newer OS/CUDA/GPU. It seems likely this will add positive abilities to the project with no anticipated downside.
I will also start developing my own custom programs and deal with future errors on a case-by-case basis. Based on some reading I think my newer GPU may only be compatible with CUDA 11+ (that is only one handling compute capability 8.6) so I will work with that version out of necessity (reference).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant