# Mvn commamd built nd4j-native but not nd4j-cuda, what is the cause?

**URL:** <https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206>\
**Category:** ND4J\
**Created:** [February 26, 2021, 10:41am UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206 "2021-02-26T10:41:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TempKonduitUser1](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@TempKonduitUser1](https://community.konduit.ai/u/TempKonduitUser1)\
**Post date:** [February 26, 2021, 10:41am UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206/1 "2021-02-26T10:41:00Z")

</div>

#### Issue Description

Please describe our issue, along with:

- Successfully build nd4j-cuda
- nd4j-native was successfully built but nothing has been done with nd4j-cuda

#### Version Information

Please indicate relevant versions, including, if relevant:

- Deeplearning4j version - current newest version
- Platform information (OS, etc) - Windows 10
- CUDA version, - CUDA Driver Version / Runtime Version - 11.1 / 10.2

#### Additional Information

Factually we have successfully built nd4j-native by run the command

mvn clean install -DskipTests=true

followinmg the instructions on this page: [deeplearning4j/nd4j at master · deeplearning4j/deeplearning4j · GitHub](https://github.com/eclipse/deeplearning4j/tree/master/nd4j) .

But we found the build is successful but it only generated files in these folders:  
…\deeplearning4j\nd4j\nd4j-backends\nd4j-backend-impls\nd4j-native\target  
…\deeplearning4j\nd4j\nd4j-backends\nd4j-backend-impls\nd4j-native-platform\target

no files even no target directory was generated in these folders:  
…\deeplearning4j\nd4j\nd4j-backends\nd4j-backend-impls\nd4j-cuda  
…\deeplearning4j\nd4j\nd4j-backends\nd4j-backend-impls\nd4j-cuda-platform

What is the cause? Should there be some modification to the configuration files or additional parameters should be appended to the build command maven?

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [February 26, 2021, 10:53am UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206/2 "2021-02-26T10:53:16Z")

</div>

That is simply the default behavior.

If you want it to build cuda, add this two parameters: `-Dlibnd4j.chip=cuda -Pcuda ` when running the build.

If you only have a specific card in mind when building cuda support, you should also add `-Dlibnd4j.compute=` with the compute capability level of your GPU.

Otherwise it will take a really long time to build.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [February 26, 2021, 10:55am UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206/3 "2021-02-26T10:55:19Z")

</div>

@TempKonduitUser1 could you clarify what’s different about your question here vs your previous one you asked? I know you were trying to build cuda before. Last I knew, you had it working in some form and moved on.

---

<div class="post-metadata">

**Author:** ![TempKonduitUser1](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@TempKonduitUser1](https://community.konduit.ai/u/TempKonduitUser1)\
**Post date:** [February 26, 2021, 1:06pm UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206/4 "2021-02-26T13:06:08Z")

</div>

@agibsonccc Last time I built libnd4j, this time I build nd4j .

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [February 26, 2021, 1:15pm UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206/5 "2021-02-26T13:15:12Z")

</div>

You don’t need to build dl4j module by module, you can simply let maven build the entirety of dl4j from the top level directory.

When you use your original command from the first post in this thread, it will build everything it needs to run on CPU.

With the suggestions from my post, it will build everything it needs to run on the GPU.

---

<div class="post-metadata">

**Author:** ![TempKonduitUser1](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@TempKonduitUser1](https://community.konduit.ai/u/TempKonduitUser1)\
**Post date:** [February 27, 2021, 11:40am UTC](https://community.konduit.ai/t/mvn-commamd-built-nd4j-native-but-not-nd4j-cuda-what-is-the-cause/1206/6 "2021-02-27T11:40:17Z")

</div>

@treo Thank you! Your last post solved my problem!
